[llvm] r207399 - [ARM64]Fix a bug cannot select UQSHL/SQSHL with constant i64 shift amount.
Hao Liu
Hao.Liu at arm.com
Mon Apr 28 00:34:36 PDT 2014
Author: haoliu
Date: Mon Apr 28 02:34:27 2014
New Revision: 207399
URL: http://llvm.org/viewvc/llvm-project?rev=207399&view=rev
Log:
[ARM64]Fix a bug cannot select UQSHL/SQSHL with constant i64 shift amount.
Added:
llvm/trunk/test/CodeGen/ARM64/2014-04-28-sqshl-uqshl-i64Contant.ll
Modified:
llvm/trunk/lib/Target/ARM64/ARM64InstrFormats.td
Modified: llvm/trunk/lib/Target/ARM64/ARM64InstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM64/ARM64InstrFormats.td?rev=207399&r1=207398&r2=207399&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM64/ARM64InstrFormats.td (original)
+++ llvm/trunk/lib/Target/ARM64/ARM64InstrFormats.td Mon Apr 28 02:34:27 2014
@@ -6868,10 +6868,12 @@ multiclass SIMDScalarLShiftBHSD<bit U, b
def d : BaseSIMDScalarShift<U, opc, {1,?,?,?,?,?,?},
FPR64, FPR64, vecshiftL64, asm,
- [(set (v1i64 FPR64:$Rd), (OpNode (v1i64 FPR64:$Rn),
- (i32 vecshiftL64:$imm)))]> {
+ [(set (i64 FPR64:$Rd), (OpNode (i64 FPR64:$Rn), (i32 vecshiftL64:$imm)))]> {
let Inst{21-16} = imm{5-0};
}
+
+ def : Pat<(v1i64 (OpNode (v1i64 FPR64:$Rn), (i32 vecshiftL64:$imm))),
+ (!cast<Instruction>(NAME # "d") FPR64:$Rn, vecshiftL64:$imm)>;
}
multiclass SIMDScalarRShiftBHSD<bit U, bits<5> opc, string asm> {
Added: llvm/trunk/test/CodeGen/ARM64/2014-04-28-sqshl-uqshl-i64Contant.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM64/2014-04-28-sqshl-uqshl-i64Contant.ll?rev=207399&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM64/2014-04-28-sqshl-uqshl-i64Contant.ll (added)
+++ llvm/trunk/test/CodeGen/ARM64/2014-04-28-sqshl-uqshl-i64Contant.ll Mon Apr 28 02:34:27 2014
@@ -0,0 +1,19 @@
+; RUN: llc < %s -verify-machineinstrs -march=arm64 | FileCheck %s
+
+; Check if sqshl/uqshl with constant shift amout can be selected.
+define i64 @test_vqshld_s64_i(i64 %a) {
+; CHECK-LABEL: test_vqshld_s64_i:
+; CHECK: sqshl {{d[0-9]+}}, {{d[0-9]+}}, #36
+ %1 = tail call i64 @llvm.arm64.neon.sqshl.i64(i64 %a, i64 36)
+ ret i64 %1
+}
+
+define i64 @test_vqshld_u64_i(i64 %a) {
+; CHECK-LABEL: test_vqshld_u64_i:
+; CHECK: uqshl {{d[0-9]+}}, {{d[0-9]+}}, #36
+ %1 = tail call i64 @llvm.arm64.neon.uqshl.i64(i64 %a, i64 36)
+ ret i64 %1
+}
+
+declare i64 @llvm.arm64.neon.uqshl.i64(i64, i64)
+declare i64 @llvm.arm64.neon.sqshl.i64(i64, i64)
More information about the llvm-commits
mailing list