Skip to content

Commit ae3ef53

Browse files
authored
[AArch64][GlobalISel] Add patterns for signed scalar extend intrinsics (#201617)
Follow on from #201546 Add patterns for signed versions of scalar extend intrinsics as well.
1 parent fdd3e7c commit ae3ef53

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6696,8 +6696,13 @@ defm UQXTN : SIMDTwoScalarMixedBHS<1, 0b10100, "uqxtn", int_aarch64_neon_scalar
66966696
defm USQADD : SIMDTwoScalarBHSDTied< 1, 0b00011, "usqadd", AArch64usqadd,
66976697
int_aarch64_neon_usqadd>;
66986698

6699+
// Scalar i32 -> i64 extend
66996700
def : Pat<(i32 (int_aarch64_neon_scalar_uqxtn (i64 FPR64:$Rn))),
67006701
(i32 (UQXTNv1i32 FPR64:$Rn))>;
6702+
def : Pat<(i32 (int_aarch64_neon_scalar_sqxtn (i64 FPR64:$Rn))),
6703+
(i32 (SQXTNv1i32 FPR64:$Rn))>;
6704+
def : Pat<(i32 (int_aarch64_neon_scalar_sqxtun (i64 FPR64:$Rn))),
6705+
(i32 (SQXTUNv1i32 FPR64:$Rn))>;
67016706

67026707
// ssub_sat(0, R) -> sqneg(R)
67036708
def : Pat<(v16i8 (ssubsat immAllZerosV, V128:$reg)),

llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ static bool isFPIntrinsic(const MachineRegisterInfo &MRI,
654654
case Intrinsic::aarch64_neon_sqneg:
655655
case Intrinsic::aarch64_neon_sqabs:
656656
case Intrinsic::aarch64_neon_scalar_uqxtn:
657+
case Intrinsic::aarch64_neon_scalar_sqxtn:
658+
case Intrinsic::aarch64_neon_scalar_sqxtun:
657659
case Intrinsic::aarch64_crypto_sha1h:
658660
case Intrinsic::aarch64_crypto_sha1c:
659661
case Intrinsic::aarch64_crypto_sha1p:

llvm/test/CodeGen/AArch64/arm64-arith-saturating.ll

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc < %s -mtriple=arm64-eabi -mcpu=cyclone | FileCheck %s --check-prefixes=CHECK
3-
; RUN: llc < %s -mtriple=arm64-eabi -mcpu=cyclone -global-isel -global-isel-abort=2 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-GI
4-
5-
; CHECK-GI: warning: Instruction selection used fallback path for vqmovund
6-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for vqmovnd_s
7-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for sqxtn_ins
8-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for sqxtun_insext
9-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for saddluse
2+
; RUN: llc < %s -mtriple=arm64-eabi -mcpu=cyclone | FileCheck %s
3+
; RUN: llc < %s -mtriple=arm64-eabi -mcpu=cyclone -global-isel | FileCheck %s
104

115
define i32 @qadds(<4 x i32> %b, <4 x i32> %c) nounwind readnone optsize ssp {
126
; CHECK-LABEL: qadds:

0 commit comments

Comments
 (0)