-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GlobalISel] Add support for *_fpmode intrinsics
The change implements support of the intrinsics `get_fpmode`, `set_fpmode` and `reset_fpmode` in Global Instruction Selector. Now they are lowered into library function calls. Differential Revision: https://reviews.llvm.org/D158260
- Loading branch information
Showing
13 changed files
with
439 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-fpenv.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
; RUN: llc -O0 -mtriple=aarch64-linux-gnu -global-isel -stop-after=irtranslator %s -o - | FileCheck %s | ||
|
||
declare i32 @llvm.get.fpmode.i32() | ||
declare void @llvm.set.fpmode.i32(i32 %fpmode) | ||
declare void @llvm.reset.fpmode() | ||
|
||
define i32 @func_get_fpmode() #0 { | ||
; CHECK-LABEL: name: func_get_fpmode | ||
; CHECK: bb.1.entry: | ||
; CHECK-NEXT: [[GET_FPMODE:%[0-9]+]]:_(s32) = G_GET_FPMODE | ||
; CHECK-NEXT: $w0 = COPY [[GET_FPMODE]](s32) | ||
; CHECK-NEXT: RET_ReallyLR implicit $w0 | ||
entry: | ||
%fpmode = call i32 @llvm.get.fpmode.i32() | ||
ret i32 %fpmode | ||
} | ||
|
||
define void @func_set_fpmode(i32 %fpmode) #0 { | ||
; CHECK-LABEL: name: func_set_fpmode | ||
; CHECK: bb.1.entry: | ||
; CHECK-NEXT: liveins: $w0 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 | ||
; CHECK-NEXT: G_SET_FPMODE [[COPY]](s32) | ||
; CHECK-NEXT: RET_ReallyLR | ||
entry: | ||
call void @llvm.set.fpmode.i32(i32 %fpmode) | ||
ret void | ||
} | ||
|
||
|
||
define void @func_reset() #0 { | ||
; CHECK-LABEL: name: func_reset | ||
; CHECK: bb.1.entry: | ||
; CHECK-NEXT: G_RESET_FPMODE | ||
; CHECK-NEXT: RET_ReallyLR | ||
entry: | ||
call void @llvm.reset.fpmode() | ||
ret void | ||
} | ||
|
||
attributes #0 = { nounwind "use-soft-float"="true" } |
Oops, something went wrong.