summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc
diff options
context:
space:
mode:
authorVenkatraman Govindaraju <venkatra@cs.wisc.edu>2014-03-01 01:04:26 +0000
committerVenkatraman Govindaraju <venkatra@cs.wisc.edu>2014-03-01 01:04:26 +0000
commitf7eecf80c4133dff74c242b8ee0d8d6273998bec (patch)
tree5ec4f4330649ec3e2b7e1c210eb1b6af9f34dc17 /llvm/lib/Target/Sparc
parentfed55979b1e2f7a33ac9e9ab967bc40ee037a841 (diff)
downloadbcm5719-llvm-f7eecf80c4133dff74c242b8ee0d8d6273998bec.tar.gz
bcm5719-llvm-f7eecf80c4133dff74c242b8ee0d8d6273998bec.zip
[Sparc] Emit 'restore' instead of 'restore %g0, %g0, %g0'. This improves the readability of the generated code.
llvm-svn: 202563
Diffstat (limited to 'llvm/lib/Target/Sparc')
-rw-r--r--llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp8
-rw-r--r--llvm/lib/Target/Sparc/SparcInstrAliases.td3
2 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp b/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
index 0e44b31ae38..239d4ef9958 100644
--- a/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
+++ b/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
@@ -20,6 +20,14 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
+// The generated AsmMatcher SparcGenAsmWriter uses "Sparc" as the target
+// namespace. But SPARC backend uses "SP" as its namespace.
+namespace llvm {
+namespace Sparc {
+ using namespace SP;
+}
+}
+
#define GET_INSTRUCTION_NAME
#define PRINT_ALIAS_INSTR
#include "SparcGenAsmWriter.inc"
diff --git a/llvm/lib/Target/Sparc/SparcInstrAliases.td b/llvm/lib/Target/Sparc/SparcInstrAliases.td
index 7242c59059a..efa79243847 100644
--- a/llvm/lib/Target/Sparc/SparcInstrAliases.td
+++ b/llvm/lib/Target/Sparc/SparcInstrAliases.td
@@ -140,3 +140,6 @@ 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)>;
+
+// restore -> restore %g0, %g0, %g0
+def : InstAlias<"restore", (RESTORErr G0, G0, G0)>;
OpenPOWER on IntegriCloud