1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=aarch64-none-linux-gnu %s -o - | FileCheck --check-prefix=DAG %s
3 ; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel %s -o - | FileCheck --check-prefix=GIS %s
5 declare i32 @llvm.get.fpmode.i32()
6 declare void @llvm.set.fpmode.i32(i32 %fpmode)
7 declare void @llvm.reset.fpmode()
9 define i32 @func_get_fpmode_soft() #0 {
10 ; DAG-LABEL: func_get_fpmode_soft:
11 ; DAG: // %bb.0: // %entry
12 ; DAG-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
13 ; DAG-NEXT: add x0, sp, #12
14 ; DAG-NEXT: bl fegetmode
15 ; DAG-NEXT: ldr w0, [sp, #12]
16 ; DAG-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
19 ; GIS-LABEL: func_get_fpmode_soft:
20 ; GIS: // %bb.0: // %entry
21 ; GIS-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
22 ; GIS-NEXT: add x0, sp, #12
23 ; GIS-NEXT: bl fegetmode
24 ; GIS-NEXT: ldr w0, [sp, #12]
25 ; GIS-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
28 %fpmode = call i32 @llvm.get.fpmode.i32()
32 define void @func_set_fpmode_soft(i32 %fpmode) #0 {
33 ; DAG-LABEL: func_set_fpmode_soft:
34 ; DAG: // %bb.0: // %entry
35 ; DAG-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
36 ; DAG-NEXT: str w0, [sp, #12]
37 ; DAG-NEXT: add x0, sp, #12
38 ; DAG-NEXT: bl fesetmode
39 ; DAG-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
42 ; GIS-LABEL: func_set_fpmode_soft:
43 ; GIS: // %bb.0: // %entry
44 ; GIS-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
45 ; GIS-NEXT: str w0, [sp, #12]
46 ; GIS-NEXT: add x0, sp, #12
47 ; GIS-NEXT: bl fesetmode
48 ; GIS-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
51 call void @llvm.set.fpmode.i32(i32 %fpmode)
55 define void @func_reset_fpmode_soft() #0 {
56 ; DAG-LABEL: func_reset_fpmode_soft:
57 ; DAG: // %bb.0: // %entry
58 ; DAG-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
59 ; DAG-NEXT: mov x0, #-1 // =0xffffffffffffffff
60 ; DAG-NEXT: bl fesetmode
61 ; DAG-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
64 ; GIS-LABEL: func_reset_fpmode_soft:
65 ; GIS: // %bb.0: // %entry
66 ; GIS-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
67 ; GIS-NEXT: mov x0, #-1 // =0xffffffffffffffff
68 ; GIS-NEXT: bl fesetmode
69 ; GIS-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
72 call void @llvm.reset.fpmode()
76 attributes #0 = { nounwind "use-soft-float"="true" }