diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td index d83ecc699b192b..2340be5b591551 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td @@ -4780,6 +4780,7 @@ class PPCAsmPseudo 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]>; diff --git a/llvm/test/MC/PowerPC/ppc64-encoding-bookII.s b/llvm/test/MC/PowerPC/ppc64-encoding-bookII.s index bd50e2321ffdfa..70410fa30ae528 100644 --- a/llvm/test/MC/PowerPC/ppc64-encoding-bookII.s +++ b/llvm/test/MC/PowerPC/ppc64-encoding-bookII.s @@ -207,6 +207,9 @@ # 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