-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Gisel][AArch64] legalize G_IS_FPCLASS (#72796)
- Loading branch information
Showing
3 changed files
with
90 additions
and
2 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
86 changes: 86 additions & 0 deletions
86
llvm/test/CodeGen/AArch64/GlobalISel/legalize-fp-class.mir
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,86 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4 | ||
# RUN: llc -mtriple=aarch64 -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s | ||
|
||
--- | ||
name: isnan_32 | ||
liveins: | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: isnan_32 | ||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) | ||
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2147483647 | ||
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 2139095040 | ||
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] | ||
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[AND]](s32), [[C1]] | ||
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 | ||
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[C2]], [[ICMP]] | ||
; CHECK-NEXT: $w0 = COPY [[OR]](s32) | ||
%0:_(s32) = COPY $w0 | ||
%1:_(s1) = nofpexcept G_IS_FPCLASS %0(s32), 3 | ||
%2:_(s32) = G_ANYEXT %1(s1) | ||
$w0 = COPY %2(s32) | ||
... | ||
--- | ||
name: isnormal_32 | ||
liveins: | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: isnormal_32 | ||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) | ||
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2147483647 | ||
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] | ||
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8388608 | ||
; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[AND]], [[C1]] | ||
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2130706432 | ||
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[SUB]](s32), [[C2]] | ||
; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 | ||
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[C3]], [[ICMP]] | ||
; CHECK-NEXT: $w0 = COPY [[OR]](s32) | ||
%0:_(s32) = COPY $w0 | ||
%1:_(s1) = nofpexcept G_IS_FPCLASS %0(s32), 264 | ||
%2:_(s32) = G_ANYEXT %1(s1) | ||
$w0 = COPY %2(s32) | ||
... | ||
--- | ||
name: iszero_32 | ||
liveins: | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: iszero_32 | ||
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) | ||
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2147483647 | ||
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 | ||
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] | ||
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[AND]](s32), [[C1]] | ||
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C1]](s32) | ||
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY2]], [[ICMP]] | ||
; CHECK-NEXT: $w0 = COPY [[OR]](s32) | ||
%0:_(s32) = COPY $w0 | ||
%1:_(s1) = nofpexcept G_IS_FPCLASS %0(s32), 96 | ||
%2:_(s32) = G_ANYEXT %1(s1) | ||
$w0 = COPY %2(s32) | ||
... | ||
--- | ||
name: iszero_64 | ||
liveins: | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: iszero_64 | ||
; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY [[COPY]](s64) | ||
; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 9223372036854775807 | ||
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 | ||
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]] | ||
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[AND]](s64), [[C1]] | ||
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 | ||
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[C2]], [[ICMP]] | ||
; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[OR]](s32) | ||
; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64) | ||
%0:_(s64) = COPY $x0 | ||
%1:_(s1) = nofpexcept G_IS_FPCLASS %0(s64), 96 | ||
%2:_(s64) = G_ANYEXT %1(s1) | ||
$x0 = COPY %2(s64) | ||
... |
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