diff options
| author | Tim Northover <tnorthover@apple.com> | 2014-07-14 11:16:02 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2014-07-14 11:16:02 +0000 |
| commit | 3cb24110b19b03de8ec628ea10a80320e6b70314 (patch) | |
| tree | d26611c761215c976844aa3ecdd7f06c3bd4d6b3 /llvm/lib/Target | |
| parent | 9ee2aee85962b453801a06eac3258595f193ec4a (diff) | |
| download | bcm5719-llvm-3cb24110b19b03de8ec628ea10a80320e6b70314.tar.gz bcm5719-llvm-3cb24110b19b03de8ec628ea10a80320e6b70314.zip | |
AArch64: remove unnecessary pseudo-instruction.
Sufficiently twisted use of TableGen lets us write patterns directly for f16
(as an i16 promoted to i32) -> f32 conversion.
llvm-svn: 212933
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp | 13 | ||||
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64InstrInfo.td | 5 |
2 files changed, 3 insertions, 15 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp b/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp index a76fd76e5ed..8839085c4a8 100644 --- a/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp +++ b/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp @@ -634,19 +634,6 @@ bool AArch64ExpandPseudo::expandMI(MachineBasicBlock &MBB, return true; } - case AArch64::FCVTSHpseudo: { - MachineOperand Src = MI.getOperand(1); - Src.setImplicit(); - unsigned SrcH = - TII->getRegisterInfo().getSubReg(Src.getReg(), AArch64::hsub); - auto MIB = BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::FCVTSHr)) - .addOperand(MI.getOperand(0)) - .addReg(SrcH, RegState::Undef) - .addOperand(Src); - transferImpOps(MI, MIB, MIB); - MI.eraseFromParent(); - return true; - } case AArch64::LOADgot: { // Expand into ADRP + LDR. unsigned DstReg = MI.getOperand(0).getReg(); diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.td b/llvm/lib/Target/AArch64/AArch64InstrInfo.td index 1211fba60c2..3ec0212b416 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.td +++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.td @@ -2239,8 +2239,9 @@ def : Pat<(f32_to_f16 FPR32:$Rn), (f32 (SUBREG_TO_REG (i32 0), (FCVTHSr FPR32:$Rn), hsub)), GPR32))>; -def FCVTSHpseudo : Pseudo<(outs FPR32:$Rd), (ins FPR32:$Rn), - [(set (f32 FPR32:$Rd), (f16_to_f32 i32:$Rn))]>; +def : Pat<(f32 (f16_to_f32 i32:$Rn)), + (FCVTSHr (EXTRACT_SUBREG (i32 (COPY_TO_REGCLASS i32:$Rn, FPR32)), + hsub))>; // When converting from f16 coming directly from a load, make sure we // load into the FPR16 registers rather than going through the GPRs. |

