summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2015-07-06 16:01:04 +0000
committerJames Y Knight <jyknight@google.com>2015-07-06 16:01:04 +0000
commit7208a12eef689eddbfd1d1cd6a36a4164221a313 (patch)
tree9ce8fe4a52f824ddf456dbb8825ed12ac554bbb7 /llvm/lib/Target/Sparc
parent05ab2374be544bbda7deaa7593b3a884e64bd1bd (diff)
downloadbcm5719-llvm-7208a12eef689eddbfd1d1cd6a36a4164221a313.tar.gz
bcm5719-llvm-7208a12eef689eddbfd1d1cd6a36a4164221a313.zip
[Sparc] Add support for flush instruction.
Differential Revision: http://reviews.llvm.org/D9833 llvm-svn: 241460
Diffstat (limited to 'llvm/lib/Target/Sparc')
-rw-r--r--llvm/lib/Target/Sparc/SparcInstrAliases.td3
-rw-r--r--llvm/lib/Target/Sparc/SparcInstrInfo.td14
2 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/SparcInstrAliases.td b/llvm/lib/Target/Sparc/SparcInstrAliases.td
index 670e9e989c8..12d05dd4523 100644
--- a/llvm/lib/Target/Sparc/SparcInstrAliases.td
+++ b/llvm/lib/Target/Sparc/SparcInstrAliases.td
@@ -306,6 +306,9 @@ def : InstAlias<"mov $rs2, $rd", (ORrr IntRegs:$rd, G0, IntRegs:$rs2)>;
// mov simm13, rd -> or %g0, simm13, rd
def : InstAlias<"mov $simm13, $rd", (ORri IntRegs:$rd, G0, i32imm:$simm13)>;
+// flush -> flush %g0
+def : InstAlias<"flush", (FLUSH), 0>;
+
// set value, rd
// (turns into a sequence of sethi+or, depending on the value)
// def : InstAlias<"set $val, $rd", (ORri IntRegs:$rd, (SETHIi (HI22 imm:$val)), (LO10 imm:$val))>;
diff --git a/llvm/lib/Target/Sparc/SparcInstrInfo.td b/llvm/lib/Target/Sparc/SparcInstrInfo.td
index a02bae07a33..39abc727f26 100644
--- a/llvm/lib/Target/Sparc/SparcInstrInfo.td
+++ b/llvm/lib/Target/Sparc/SparcInstrInfo.td
@@ -828,6 +828,20 @@ let rd = 0 in
def UNIMP : F2_1<0b000, (outs), (ins i32imm:$imm22),
"unimp $imm22", []>;
+// Section B.32 - Flush Instruction Memory
+let rd = 0 in {
+ def FLUSHrr : F3_1<2, 0b111011, (outs), (ins MEMrr:$addr),
+ "flush $addr", []>;
+ def FLUSHri : F3_2<2, 0b111011, (outs), (ins MEMri:$addr),
+ "flush $addr", []>;
+
+ // The no-arg FLUSH is only here for the benefit of the InstAlias
+ // "flush", which cannot seem to use FLUSHrr, due to the inability
+ // to construct a MEMrr with fixed G0 registers.
+ let rs1 = 0, rs2 = 0 in
+ def FLUSH : F3_1<2, 0b111011, (outs), (ins), "flush %g0", []>;
+}
+
// Section B.33 - Floating-point Operate (FPop) Instructions
// Convert Integer to Floating-point Instructions, p. 141
OpenPOWER on IntegriCloud