1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=s390x-linux-gnu -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -mtriple=s390x-linux-gnu -verify-machineinstrs -O3 < %s | FileCheck %s
5 @changed = dso_local global i32 0, align 4
7 define dso_local signext i32 @test_flt_rounds() nounwind {
8 ; CHECK-LABEL: test_flt_rounds:
10 ; CHECK-NEXT: efpc %r0
11 ; CHECK-NEXT: nilf %r0, 3
12 ; CHECK-NEXT: rxsbg %r0, %r0, 33, 63, 63
13 ; CHECK-NEXT: xilf %r0, 1
14 ; CHECK-NEXT: llgfr %r2, %r0
16 %1 = call i32 @llvm.get.rounding()
20 declare i32 @llvm.get.rounding() nounwind
22 define dso_local signext i32 @test_order(i32 noundef signext %0) nounwind {
23 ; CHECK-LABEL: test_order:
25 ; CHECK-NEXT: stmg %r13, %r15, 104(%r15)
26 ; CHECK-NEXT: aghi %r15, -160
27 ; CHECK-NEXT: efpc %r13
28 ; CHECK-NEXT: nilf %r13, 3
29 ; CHECK-NEXT: rxsbg %r13, %r13, 33, 63, 63
30 ; CHECK-NEXT: xilf %r13, 1
31 ; CHECK-NEXT: brasl %r14, fesetround@PLT
32 ; CHECK-NEXT: efpc %r0
33 ; CHECK-NEXT: nilf %r0, 3
34 ; CHECK-NEXT: rxsbg %r0, %r0, 33, 63, 63
35 ; CHECK-NEXT: xilf %r0, 1
36 ; CHECK-NEXT: crje %r13, %r0, .LBB1_2
37 ; CHECK-NEXT: # %bb.1:
38 ; CHECK-NEXT: lhi %r0, 1
39 ; CHECK-NEXT: strl %r0, changed
40 ; CHECK-NEXT: .LBB1_2:
41 ; CHECK-NEXT: llgfr %r2, %r13
42 ; CHECK-NEXT: lmg %r13, %r15, 264(%r15)
44 %2 = call i32 @llvm.get.rounding()
45 %3 = call signext i32 @fesetround(i32 noundef signext %0)
46 %4 = call i32 @llvm.get.rounding()
47 %5 = icmp ne i32 %2, %4
48 br i1 %5, label %6, label %7
51 store i32 1, ptr @changed, align 4
58 declare dso_local signext i32 @fesetround(i32 noundef signext) nounwind