[PowerPC] Support extended sc mnemonic
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 10 Jun 2013 17:19:43 +0000 (17:19 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 10 Jun 2013 17:19:43 +0000 (17:19 +0000)
A plain "sc" without argument is supposed to be treated like "sc 0"
by the assembler.  This patch adds a corresponding alias.

Problem reported by Joerg Sonnenberger.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183687 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCInstrInfo.td
test/MC/PowerPC/ppc64-encoding.s

index e5daafe072fd48efba3f5b76ae00fc3c09a72c7f..1b7ea93c45f7ee7177e6fb5e7f48295243e2060d 100644 (file)
@@ -2154,6 +2154,8 @@ class PPCAsmPseudo<string asm, dag iops>
   let isPseudo = 1;
 }
 
+def : InstAlias<"sc", (SC 0)>;
+
 def : InstAlias<"mr $rA, $rB", (OR8 g8rc:$rA, g8rc:$rB, g8rc:$rB)>;
 
 def SLWI : PPCAsmPseudo<"slwi $rA, $rS, $n",
index a955f4f80706c7ef88ab3900b1d507593a3e0d92..d11ad4f61a14f8f7bc1416a2feb3f399e4374bac 100644 (file)
@@ -43,6 +43,8 @@
 
 # CHECK: sc 1                            # encoding: [0x44,0x00,0x00,0x22]
          sc 1
+# CHECK: sc 0                            # encoding: [0x44,0x00,0x00,0x02]
+         sc
 
 # Fixed-point facility