ARM tighten up the register classes for the PKH instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139748 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach
2011-09-14 22:52:14 +00:00
parent 8adf62034a
commit e1d58a6556

View File

@@ -3857,37 +3857,38 @@ def : ARMV6Pat<(or (sra (shl GPR:$Rm, (i32 24)), (i32 16)),
(and (srl GPR:$Rm, (i32 8)), 0xFF)), (and (srl GPR:$Rm, (i32 8)), 0xFF)),
(REVSH GPR:$Rm)>; (REVSH GPR:$Rm)>;
def PKHBT : APKHI<0b01101000, 0, (outs GPR:$Rd), def PKHBT : APKHI<0b01101000, 0, (outs GPRnopc:$Rd),
(ins GPR:$Rn, GPR:$Rm, pkh_lsl_amt:$sh), (ins GPRnopc:$Rn, GPRnopc:$Rm, pkh_lsl_amt:$sh),
IIC_iALUsi, "pkhbt", "\t$Rd, $Rn, $Rm$sh", IIC_iALUsi, "pkhbt", "\t$Rd, $Rn, $Rm$sh",
[(set GPR:$Rd, (or (and GPR:$Rn, 0xFFFF), [(set GPRnopc:$Rd, (or (and GPRnopc:$Rn, 0xFFFF),
(and (shl GPR:$Rm, pkh_lsl_amt:$sh), (and (shl GPRnopc:$Rm, pkh_lsl_amt:$sh),
0xFFFF0000)))]>, 0xFFFF0000)))]>,
Requires<[IsARM, HasV6]>; Requires<[IsARM, HasV6]>;
// Alternate cases for PKHBT where identities eliminate some nodes. // Alternate cases for PKHBT where identities eliminate some nodes.
def : ARMV6Pat<(or (and GPR:$Rn, 0xFFFF), (and GPR:$Rm, 0xFFFF0000)), def : ARMV6Pat<(or (and GPRnopc:$Rn, 0xFFFF), (and GPRnopc:$Rm, 0xFFFF0000)),
(PKHBT GPR:$Rn, GPR:$Rm, 0)>; (PKHBT GPRnopc:$Rn, GPRnopc:$Rm, 0)>;
def : ARMV6Pat<(or (and GPR:$Rn, 0xFFFF), (shl GPR:$Rm, imm16_31:$sh)), def : ARMV6Pat<(or (and GPRnopc:$Rn, 0xFFFF), (shl GPRnopc:$Rm, imm16_31:$sh)),
(PKHBT GPR:$Rn, GPR:$Rm, imm16_31:$sh)>; (PKHBT GPRnopc:$Rn, GPRnopc:$Rm, imm16_31:$sh)>;
// Note: Shifts of 1-15 bits will be transformed to srl instead of sra and // Note: Shifts of 1-15 bits will be transformed to srl instead of sra and
// will match the pattern below. // will match the pattern below.
def PKHTB : APKHI<0b01101000, 1, (outs GPR:$Rd), def PKHTB : APKHI<0b01101000, 1, (outs GPRnopc:$Rd),
(ins GPR:$Rn, GPR:$Rm, pkh_asr_amt:$sh), (ins GPRnopc:$Rn, GPRnopc:$Rm, pkh_asr_amt:$sh),
IIC_iBITsi, "pkhtb", "\t$Rd, $Rn, $Rm$sh", IIC_iBITsi, "pkhtb", "\t$Rd, $Rn, $Rm$sh",
[(set GPR:$Rd, (or (and GPR:$Rn, 0xFFFF0000), [(set GPRnopc:$Rd, (or (and GPRnopc:$Rn, 0xFFFF0000),
(and (sra GPR:$Rm, pkh_asr_amt:$sh), (and (sra GPRnopc:$Rm, pkh_asr_amt:$sh),
0xFFFF)))]>, 0xFFFF)))]>,
Requires<[IsARM, HasV6]>; Requires<[IsARM, HasV6]>;
// Alternate cases for PKHTB where identities eliminate some nodes. Note that // Alternate cases for PKHTB where identities eliminate some nodes. Note that
// a shift amount of 0 is *not legal* here, it is PKHBT instead. // a shift amount of 0 is *not legal* here, it is PKHBT instead.
def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000), (srl GPR:$src2, imm16_31:$sh)), def : ARMV6Pat<(or (and GPRnopc:$src1, 0xFFFF0000),
(PKHTB GPR:$src1, GPR:$src2, imm16_31:$sh)>; (srl GPRnopc:$src2, imm16_31:$sh)),
def : ARMV6Pat<(or (and GPR:$src1, 0xFFFF0000), (PKHTB GPRnopc:$src1, GPRnopc:$src2, imm16_31:$sh)>;
(and (srl GPR:$src2, imm1_15:$sh), 0xFFFF)), def : ARMV6Pat<(or (and GPRnopc:$src1, 0xFFFF0000),
(PKHTB GPR:$src1, GPR:$src2, imm1_15:$sh)>; (and (srl GPRnopc:$src2, imm1_15:$sh), 0xFFFF)),
(PKHTB GPRnopc:$src1, GPRnopc:$src2, imm1_15:$sh)>;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Comparison Instructions... // Comparison Instructions...
@@ -4882,10 +4883,10 @@ def : MnemonicAlias<"stmea", "stm">;
// PKHBT/PKHTB with default shift amount. PKHTB is equivalent to PKHBT when the // PKHBT/PKHTB with default shift amount. PKHTB is equivalent to PKHBT when the
// shift amount is zero (i.e., unspecified). // shift amount is zero (i.e., unspecified).
def : InstAlias<"pkhbt${p} $Rd, $Rn, $Rm", def : InstAlias<"pkhbt${p} $Rd, $Rn, $Rm",
(PKHBT GPR:$Rd, GPR:$Rn, GPR:$Rm, 0, pred:$p)>, (PKHBT GPRnopc:$Rd, GPRnopc:$Rn, GPRnopc:$Rm, 0, pred:$p)>,
Requires<[IsARM, HasV6]>; Requires<[IsARM, HasV6]>;
def : InstAlias<"pkhtb${p} $Rd, $Rn, $Rm", def : InstAlias<"pkhtb${p} $Rd, $Rn, $Rm",
(PKHBT GPR:$Rd, GPR:$Rn, GPR:$Rm, 0, pred:$p)>, (PKHBT GPRnopc:$Rd, GPRnopc:$Rn, GPRnopc:$Rm, 0, pred:$p)>,
Requires<[IsARM, HasV6]>; Requires<[IsARM, HasV6]>;
// PUSH/POP aliases for STM/LDM // PUSH/POP aliases for STM/LDM