1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
2 # RUN: llc -mtriple=aarch64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s
5 target triple = "aarch64-unknown-linux-gnu"
7 declare i32 @llvm.get.fpmode.i32()
8 declare void @llvm.set.fpmode.i32(i32)
9 declare void @llvm.reset.fpmode()
11 define i32 @func_get_fpmode() #0 {
13 %fpmode = call i32 @llvm.get.fpmode.i32()
17 define void @func_set_fpmode(i32 %fpmode) #0 {
19 call void @llvm.set.fpmode.i32(i32 %fpmode)
23 define void @func_reset() #0 {
25 call void @llvm.reset.fpmode()
29 attributes #0 = { nounwind "use-soft-float"="true" }
34 tracksRegLiveness: true
37 ; CHECK-LABEL: name: func_get_fpmode
38 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
39 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
40 ; CHECK-NEXT: $x0 = COPY [[FRAME_INDEX]](p0)
41 ; CHECK-NEXT: BL &fegetmode, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0
42 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
43 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX]](p0) :: (load (s32) from %stack.0)
44 ; CHECK-NEXT: $w0 = COPY [[LOAD]](s32)
45 ; CHECK-NEXT: RET_ReallyLR implicit $w0
46 %0:_(s32) = G_GET_FPMODE
48 RET_ReallyLR implicit $w0
53 tracksRegLiveness: true
58 ; CHECK-LABEL: name: func_set_fpmode
61 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
62 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
63 ; CHECK-NEXT: G_STORE [[COPY]](s32), [[FRAME_INDEX]](p0) :: (store (s32) into %stack.0)
64 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
65 ; CHECK-NEXT: $x0 = COPY [[FRAME_INDEX]](p0)
66 ; CHECK-NEXT: BL &fesetmode, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0
67 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
68 ; CHECK-NEXT: RET_ReallyLR
76 tracksRegLiveness: true
79 ; CHECK-LABEL: name: func_reset
80 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
81 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[C]](s64)
82 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
83 ; CHECK-NEXT: $x0 = COPY [[INTTOPTR]](p0)
84 ; CHECK-NEXT: BL &fesetmode, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0
85 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
86 ; CHECK-NEXT: RET_ReallyLR