Home | History | Annotate | Download | only in SystemZ
      1 ; Test conversion of floating-point values to unsigned integers.
      2 ;
      3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | FileCheck %s
      4 
      5 ; Test f32->i32.
      6 define i32 @f1(float %f) {
      7 ; CHECK-LABEL: f1:
      8 ; CHECK: clfebr %r2, 5, %f0, 0
      9 ; CHECK: br %r14
     10   %conv = fptoui float %f to i32
     11   ret i32 %conv
     12 }
     13 
     14 ; Test f64->i32.
     15 define i32 @f2(double %f) {
     16 ; CHECK-LABEL: f2:
     17 ; CHECK: clfdbr %r2, 5, %f0, 0
     18 ; CHECK: br %r14
     19   %conv = fptoui double %f to i32
     20   ret i32 %conv
     21 }
     22 
     23 ; Test f128->i32.
     24 define i32 @f3(fp128 *%src) {
     25 ; CHECK-LABEL: f3:
     26 ; CHECK-DAG: ld %f0, 0(%r2)
     27 ; CHECK-DAG: ld %f2, 8(%r2)
     28 ; CHECK: clfxbr %r2, 5, %f0, 0
     29 ; CHECK: br %r14
     30   %f = load fp128 , fp128 *%src
     31   %conv = fptoui fp128 %f to i32
     32   ret i32 %conv
     33 }
     34 
     35 ; Test f32->i64.
     36 define i64 @f4(float %f) {
     37 ; CHECK-LABEL: f4:
     38 ; CHECK: clgebr %r2, 5, %f0, 0
     39 ; CHECK: br %r14
     40   %conv = fptoui float %f to i64
     41   ret i64 %conv
     42 }
     43 
     44 ; Test f64->i64.
     45 define i64 @f5(double %f) {
     46 ; CHECK-LABEL: f5:
     47 ; CHECK: clgdbr %r2, 5, %f0, 0
     48 ; CHECK: br %r14
     49   %conv = fptoui double %f to i64
     50   ret i64 %conv
     51 }
     52 
     53 ; Test f128->i64.
     54 define i64 @f6(fp128 *%src) {
     55 ; CHECK-LABEL: f6:
     56 ; CHECK-DAG: ld %f0, 0(%r2)
     57 ; CHECK-DAG: ld %f2, 8(%r2)
     58 ; CHECK: clgxbr %r2, 5, %f0, 0
     59 ; CHECK: br %r14
     60   %f = load fp128 , fp128 *%src
     61   %conv = fptoui fp128 %f to i64
     62   ret i64 %conv
     63 }
     64