summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-08-10 16:46:36 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-08-10 16:46:36 +0000
commita3386501afd12a5680545c9c462fac67561a48fa (patch)
treef93b1e2df00cf61ee5c224d03ac3ff7fc5361b6b /llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp
parentb2a9c0252179d9334967266182bad77c1d3e6579 (diff)
downloadbcm5719-llvm-a3386501afd12a5680545c9c462fac67561a48fa.tar.gz
bcm5719-llvm-a3386501afd12a5680545c9c462fac67561a48fa.zip
[Hexagon] Use integer instructions for floating point immediates
Floating point instructions use general purpose registers, so the few instructions that can put floating point immediates into registers are, in fact, integer instruction. Use them explicitly instead of having pseudo-instructions specifically for dealing with floating point values. Simplify the constant loading instructions (from sdata) to have only two: one for 32-bit values and one for 64-bit values: CONST32 and CONST64. llvm-svn: 278244
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp b/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp
index 172df0c8271..c4a0a62e043 100644
--- a/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp
@@ -1971,14 +1971,13 @@ bool HexagonConstEvaluator::evaluate(const MachineInstr &MI,
default:
return false;
case Hexagon::A2_tfrsi:
- case Hexagon::CONST32:
case Hexagon::A2_tfrpi:
- case Hexagon::CONST32_Int_Real:
- case Hexagon::CONST64_Int_Real:
+ case Hexagon::CONST32:
+ case Hexagon::CONST64:
{
const MachineOperand &VO = MI.getOperand(1);
- // The operand of CONST32_Int_Real can be a blockaddress, e.g.
- // %vreg0<def> = CONST32_Int_Real <blockaddress(@eat, %L)>
+ // The operand of CONST32 can be a blockaddress, e.g.
+ // %vreg0<def> = CONST32 <blockaddress(@eat, %L)>
// Do this check for all instructions for safety.
if (!VO.isImm())
return false;
@@ -2326,10 +2325,9 @@ bool HexagonConstEvaluator::rewrite(MachineInstr &MI, const CellMap &Inputs) {
default:
break;
case Hexagon::A2_tfrsi:
- case Hexagon::CONST32:
case Hexagon::A2_tfrpi:
- case Hexagon::CONST32_Int_Real:
- case Hexagon::CONST64_Int_Real:
+ case Hexagon::CONST32:
+ case Hexagon::CONST64:
case Hexagon::TFR_PdTrue:
case Hexagon::TFR_PdFalse:
return false;
@@ -2921,7 +2919,7 @@ bool HexagonConstEvaluator::rewriteHexConstDefs(MachineInstr &MI,
.addImm(Hi)
.addImm(Lo);
} else {
- NewD = &HII.get(Hexagon::CONST64_Int_Real);
+ NewD = &HII.get(Hexagon::CONST64);
NewMI = BuildMI(B, At, DL, *NewD, NewR)
.addImm(V);
}
OpenPOWER on IntegriCloud