1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -mtriple=aarch64-none-linux-gnu %s -o - | FileCheck %s
4 define void @func_set_rounding_dyn(i32 %rm) {
5 ; CHECK-LABEL: func_set_rounding_dyn:
7 ; CHECK-NEXT: sub w9, w0, #1
8 ; CHECK-NEXT: mrs x8, FPCR
9 ; CHECK-NEXT: and w9, w9, #0x3
10 ; CHECK-NEXT: and x8, x8, #0xffffffffff3fffff
11 ; CHECK-NEXT: lsl w9, w9, #22
12 ; CHECK-NEXT: orr x8, x8, x9
13 ; CHECK-NEXT: msr FPCR, x8
15 call void @llvm.set.rounding(i32 %rm)
19 define void @func_set_rounding_toward_zero() {
20 ; CHECK-LABEL: func_set_rounding_toward_zero:
22 ; CHECK-NEXT: mrs x8, FPCR
23 ; CHECK-NEXT: orr x8, x8, #0xc00000
24 ; CHECK-NEXT: msr FPCR, x8
26 call void @llvm.set.rounding(i32 0)
30 define void @func_set_rounding_tonearest_even() {
31 ; CHECK-LABEL: func_set_rounding_tonearest_even:
33 ; CHECK-NEXT: mrs x8, FPCR
34 ; CHECK-NEXT: and x8, x8, #0xffffffffff3fffff
35 ; CHECK-NEXT: msr FPCR, x8
37 call void @llvm.set.rounding(i32 1)
41 define void @func_set_rounding_upward() {
42 ; CHECK-LABEL: func_set_rounding_upward:
44 ; CHECK-NEXT: mrs x8, FPCR
45 ; CHECK-NEXT: and x8, x8, #0xffffffffff3fffff
46 ; CHECK-NEXT: orr x8, x8, #0x400000
47 ; CHECK-NEXT: msr FPCR, x8
49 call void @llvm.set.rounding(i32 2)
53 define void @func_set_rounding_downward() {
54 ; CHECK-LABEL: func_set_rounding_downward:
56 ; CHECK-NEXT: mrs x8, FPCR
57 ; CHECK-NEXT: and x8, x8, #0xffffffffff3fffff
58 ; CHECK-NEXT: orr x8, x8, #0x800000
59 ; CHECK-NEXT: msr FPCR, x8
61 call void @llvm.set.rounding(i32 3)
65 declare void @llvm.set.rounding(i32)