Skip to content

Commit 029f1c3

Browse files
committed
Make (ADDPT|SUBPT) shift operand an i64 as opposed to i32
To avoid the trunc_imm. Representing it as an i64 seems like a more natural type for something based on pointers, even if the exact type does not matter due to the range.
1 parent fcde60c commit 029f1c3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/lib/Target/AArch64/AArch64InstrFormats.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13124,7 +13124,7 @@ def LSLImm3ShiftOperand : AsmOperandClass {
1312413124
let DiagnosticType = "AddSubLSLImm3ShiftLarge";
1312513125
}
1312613126

13127-
def lsl_imm3_shift_operand : Operand<i32> {
13127+
def lsl_imm3_shift_operand : Operand<i64> {
1312813128
let PrintMethod = "printShifter";
1312913129
let ParserMatchClass = LSLImm3ShiftOperand;
1313013130
}

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10718,15 +10718,15 @@ let Predicates = [HasCPA] in {
1071810718
def MSUBPT : MulAccumCPA<1, "msubpt">;
1071910719

1072010720
def : Pat<(ptradd GPR64sp:$Rn, GPR64sp:$Rm),
10721-
(ADDPT_shift GPR64sp:$Rn, GPR64sp:$Rm, (i32 0))>;
10721+
(ADDPT_shift GPR64sp:$Rn, GPR64sp:$Rm, (i64 0))>;
1072210722
def : Pat<(ptradd GPR64sp:$Rn, (shl GPR64sp:$Rm, (i64 imm0_7:$imm))),
1072310723
(ADDPT_shift GPR64sp:$Rn, GPR64sp:$Rm,
10724-
(i32 (trunc_imm imm0_7:$imm)))>;
10724+
(i64 imm0_7:$imm))>;
1072510725
def : Pat<(ptradd GPR64sp:$Rn, (ineg GPR64sp:$Rm)),
10726-
(SUBPT_shift GPR64sp:$Rn, GPR64sp:$Rm, (i32 0))>;
10726+
(SUBPT_shift GPR64sp:$Rn, GPR64sp:$Rm, (i64 0))>;
1072710727
def : Pat<(ptradd GPR64sp:$Rn, (ineg (shl GPR64sp:$Rm, (i64 imm0_7:$imm)))),
1072810728
(SUBPT_shift GPR64sp:$Rn, GPR64sp:$Rm,
10729-
(i32 (trunc_imm imm0_7:$imm)))>;
10729+
(i64 imm0_7:$imm))>;
1073010730
def : Pat<(ptradd GPR64:$Ra, (mul GPR64:$Rn, GPR64:$Rm)),
1073110731
(MADDPT GPR64:$Rn, GPR64:$Rm, GPR64:$Ra)>;
1073210732
def : Pat<(ptradd GPR64:$Ra, (mul GPR64:$Rn, (ineg GPR64:$Rm))),

0 commit comments

Comments
 (0)