1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -O0 -mtriple=aarch64-linux-gnu -global-isel -stop-after=irtranslator %s -o - | FileCheck %s
4 declare i64 @llvm.get.fpenv.i64()
5 declare void @llvm.set.fpenv.i64(i64 %fpenv)
6 declare void @llvm.reset.fpenv()
7 declare i32 @llvm.get.fpmode.i32()
8 declare void @llvm.set.fpmode.i32(i32 %fpmode)
9 declare void @llvm.reset.fpmode()
11 define i64 @func_get_fpenv() #0 {
12 ; CHECK-LABEL: name: func_get_fpenv
14 ; CHECK-NEXT: [[GET_FPENV:%[0-9]+]]:_(s64) = G_GET_FPENV
15 ; CHECK-NEXT: $x0 = COPY [[GET_FPENV]](s64)
16 ; CHECK-NEXT: RET_ReallyLR implicit $x0
18 %fpenv = call i64 @llvm.get.fpenv.i64()
22 define void @func_set_fpenv(i64 %fpenv) #0 {
23 ; CHECK-LABEL: name: func_set_fpenv
25 ; CHECK-NEXT: liveins: $x0
27 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
28 ; CHECK-NEXT: G_SET_FPENV [[COPY]](s64)
29 ; CHECK-NEXT: RET_ReallyLR
31 call void @llvm.set.fpenv.i64(i64 %fpenv)
35 define void @func_reset_fpenv() #0 {
36 ; CHECK-LABEL: name: func_reset_fpenv
38 ; CHECK-NEXT: G_RESET_FPENV
39 ; CHECK-NEXT: RET_ReallyLR
41 call void @llvm.reset.fpenv()
45 define i32 @func_get_fpmode() #0 {
46 ; CHECK-LABEL: name: func_get_fpmode
48 ; CHECK-NEXT: [[GET_FPMODE:%[0-9]+]]:_(s32) = G_GET_FPMODE
49 ; CHECK-NEXT: $w0 = COPY [[GET_FPMODE]](s32)
50 ; CHECK-NEXT: RET_ReallyLR implicit $w0
52 %fpmode = call i32 @llvm.get.fpmode.i32()
56 define void @func_set_fpmode(i32 %fpmode) #0 {
57 ; CHECK-LABEL: name: func_set_fpmode
59 ; CHECK-NEXT: liveins: $w0
61 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
62 ; CHECK-NEXT: G_SET_FPMODE [[COPY]](s32)
63 ; CHECK-NEXT: RET_ReallyLR
65 call void @llvm.set.fpmode.i32(i32 %fpmode)
70 define void @func_reset() #0 {
71 ; CHECK-LABEL: name: func_reset
73 ; CHECK-NEXT: G_RESET_FPMODE
74 ; CHECK-NEXT: RET_ReallyLR
76 call void @llvm.reset.fpmode()
80 attributes #0 = { nounwind "use-soft-float"="true" }