From edb32ec09939acc9dc896e27b74d4cbd2e017133 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Mon, 10 Aug 2015 22:32:25 +0000 Subject: [PATCH] Add support for the signx instrution alias of SPARCv9. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244519 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Sparc/SparcInstrAliases.td | 5 +++++ test/MC/Sparc/sparcv9-instructions.s | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/Target/Sparc/SparcInstrAliases.td b/lib/Target/Sparc/SparcInstrAliases.td index 25cc652dbd9..41a6fca75a5 100644 --- a/lib/Target/Sparc/SparcInstrAliases.td +++ b/lib/Target/Sparc/SparcInstrAliases.td @@ -450,3 +450,8 @@ def : InstAlias<"fcmpeq $rs1, $rs2", (V9FCMPEQ FCC0, QFPRegs:$rs1, QFPRegs:$rs2)>, Requires<[HasHardQuad]>; +// signx rd -> sra rd, %g0, rd +def : InstAlias<"signx $rd", (SRArr IntRegs:$rd, IntRegs:$rd, G0), 0>, Requires<[HasV9]>; + +// signx reg, rd -> sra reg, %g0, rd +def : InstAlias<"signx $rs1, $rd", (SRArr IntRegs:$rd, IntRegs:$rs1, G0), 0>, Requires<[HasV9]>; diff --git a/test/MC/Sparc/sparcv9-instructions.s b/test/MC/Sparc/sparcv9-instructions.s index e2cb87e0630..6125469b8e8 100644 --- a/test/MC/Sparc/sparcv9-instructions.s +++ b/test/MC/Sparc/sparcv9-instructions.s @@ -26,3 +26,12 @@ ! V9: popc %g1, %g2 ! encoding: [0x85,0x70,0x00,0x01] popc %g1, %g2 + + ! V8: error: instruction requires a CPU feature not currently enabled + ! V8-NEXT: signx %g1, %g2 + ! V9: sra %g1, %g0, %g2 ! encoding: [0x85,0x38,0x40,0x00] + signx %g1, %g2 + ! V8: error: instruction requires a CPU feature not currently enabled + ! V8-NEXT: signx %g1 + ! V9: sra %g1, %g0, %g1 ! encoding: [0x83,0x38,0x40,0x00] + signx %g1 -- 2.34.1