[PowerPC] Support hwsync extended mnemonic
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Mon, 20 Dec 2021 15:52:11 +0000 (09:52 -0600)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Mon, 20 Dec 2021 16:08:31 +0000 (10:08 -0600)
This mnemonic has been supported by GAS for years and
it was added to the PowerPC ISA as of ISA 3.1. We will
support the mnemonic to be compatible with GAS.

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

index d83ecc6..2340be5 100644 (file)
@@ -4780,6 +4780,7 @@ class PPCAsmPseudo<string asm, dag iops>
 def : InstAlias<"sc", (SC 0)>;
 
 def : InstAlias<"sync", (SYNC 0)>, Requires<[HasSYNC]>;
+def : InstAlias<"hwsync", (SYNC 0), 0>, Requires<[HasSYNC]>;
 def : InstAlias<"msync", (SYNC 0), 0>, Requires<[HasSYNC]>;
 def : InstAlias<"lwsync", (SYNC 1)>, Requires<[HasSYNC]>;
 def : InstAlias<"ptesync", (SYNC 2)>, Requires<[HasSYNC]>;
index bd50e23..70410fa 100644 (file)
 # CHECK-BE: lwsync                          # encoding: [0x7c,0x20,0x04,0xac]
 # CHECK-LE: lwsync                          # encoding: [0xac,0x04,0x20,0x7c]
             lwsync
+# CHECK-BE: sync                            # encoding: [0x7c,0x00,0x04,0xac]
+# CHECK-LE: sync                            # encoding: [0xac,0x04,0x00,0x7c]
+            hwsync
 # CHECK-BE: ptesync                         # encoding: [0x7c,0x40,0x04,0xac]
 # CHECK-LE: ptesync                         # encoding: [0xac,0x04,0x40,0x7c]
             ptesync