IR: add a second ordering operand to cmpxhg for failure
[oota-llvm.git] / test / CodeGen / SystemZ / fp-conv-10.ll
1 ; Test conversion of floating-point values to unsigned i32s.
2 ;
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5 ; z10 doesn't have native support for unsigned fp-to-i32 conversions;
6 ; they were added in z196 as the Convert to Logical family of instructions.
7 ; Promoting to i64 doesn't generate an inexact condition for values that are
8 ; outside the i32 range but in the i64 range, so use the default expansion.
9
10 ; Test f32->i32.
11 define i32 @f1(float %f) {
12 ; CHECK-LABEL: f1:
13 ; CHECK: cebr
14 ; CHECK: sebr
15 ; CHECK: cfebr
16 ; CHECK: xilf
17 ; CHECK: br %r14
18   %conv = fptoui float %f to i32
19   ret i32 %conv
20 }
21
22 ; Test f64->i32.
23 define i32 @f2(double %f) {
24 ; CHECK-LABEL: f2:
25 ; CHECK: cdbr
26 ; CHECK: sdbr
27 ; CHECK: cfdbr
28 ; CHECK: xilf
29 ; CHECK: br %r14
30   %conv = fptoui double %f to i32
31   ret i32 %conv
32 }
33
34 ; Test f128->i32.
35 define i32 @f3(fp128 *%src) {
36 ; CHECK-LABEL: f3:
37 ; CHECK: cxbr
38 ; CHECK: sxbr
39 ; CHECK: cfxbr
40 ; CHECK: xilf
41 ; CHECK: br %r14
42   %f = load fp128 *%src
43   %conv = fptoui fp128 %f to i32
44   ret i32 %conv
45 }