[PATCH] D48550: [PowerPC] Fix incorrectly encoded wait instruction
Lei Huang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 25 09:04:09 PDT 2018
lei created this revision.
lei added reviewers: sfertile, kbarton, nemanjai, hfinkel.
Encoding for the wait instruction was wrong. Fix according to ISA 3.0.
https://reviews.llvm.org/D48550
Files:
lib/Target/PowerPC/PPCInstrInfo.td
test/MC/Disassembler/PowerPC/ppc64-encoding-bookII.txt
test/MC/PowerPC/ppc64-encoding-bookII.s
Index: test/MC/PowerPC/ppc64-encoding-bookII.s
===================================================================
--- test/MC/PowerPC/ppc64-encoding-bookII.s
+++ test/MC/PowerPC/ppc64-encoding-bookII.s
@@ -97,8 +97,8 @@
# CHECK-BE: eieio # encoding: [0x7c,0x00,0x06,0xac]
# CHECK-LE: eieio # encoding: [0xac,0x06,0x00,0x7c]
eieio
-# CHECK-BE: waitimpl # encoding: [0x7c,0x40,0x00,0x7c]
-# CHECK-LE: waitimpl # encoding: [0x7c,0x00,0x40,0x7c]
+# CHECK-BE: waitimpl # encoding: [0x7c,0x40,0x00,0x3c]
+# CHECK-LE: waitimpl # encoding: [0x3c,0x00,0x40,0x7c]
wait 2
# CHECK-BE: mbar 1 # encoding: [0x7c,0x20,0x06,0xac]
# CHECK-LE: mbar 1 # encoding: [0xac,0x06,0x20,0x7c]
@@ -171,14 +171,14 @@
# CHECK-LE: ptesync # encoding: [0xac,0x04,0x40,0x7c]
ptesync
-# CHECK-BE: wait # encoding: [0x7c,0x00,0x00,0x7c]
-# CHECK-LE: wait # encoding: [0x7c,0x00,0x00,0x7c]
+# CHECK-BE: wait # encoding: [0x7c,0x00,0x00,0x3c]
+# CHECK-LE: wait # encoding: [0x3c,0x00,0x00,0x7c]
wait
-# CHECK-BE: waitrsv # encoding: [0x7c,0x20,0x00,0x7c]
-# CHECK-LE: waitrsv # encoding: [0x7c,0x00,0x20,0x7c]
+# CHECK-BE: waitrsv # encoding: [0x7c,0x20,0x00,0x3c]
+# CHECK-LE: waitrsv # encoding: [0x3c,0x00,0x20,0x7c]
waitrsv
-# CHECK-BE: waitimpl # encoding: [0x7c,0x40,0x00,0x7c]
-# CHECK-LE: waitimpl # encoding: [0x7c,0x00,0x40,0x7c]
+# CHECK-BE: waitimpl # encoding: [0x7c,0x40,0x00,0x3c]
+# CHECK-LE: waitimpl # encoding: [0x3c,0x00,0x40,0x7c]
waitimpl
# Time base instructions
Index: test/MC/Disassembler/PowerPC/ppc64-encoding-bookII.txt
===================================================================
--- test/MC/Disassembler/PowerPC/ppc64-encoding-bookII.txt
+++ test/MC/Disassembler/PowerPC/ppc64-encoding-bookII.txt
@@ -46,7 +46,7 @@
0x7c 0x00 0x06 0xac
# CHECK: waitimpl
-0x7c 0x40 0x00 0x7c
+0x7c 0x40 0x00 0x3c
# CHECK: mbar 1
0x7c 0x20 0x06 0xac
@@ -103,13 +103,13 @@
0x7c 0x40 0x04 0xac
# CHECK: wait
-0x7c 0x00 0x00 0x7c
+0x7c 0x00 0x00 0x3c
# CHECK: waitrsv
-0x7c 0x20 0x00 0x7c
+0x7c 0x20 0x00 0x3c
# CHECK: waitimpl
-0x7c 0x40 0x00 0x7c
+0x7c 0x40 0x00 0x3c
# CHECK: mftb 2, 123
0x7c 0x5b 0x1a 0xe6
Index: lib/Target/PowerPC/PPCInstrInfo.td
===================================================================
--- lib/Target/PowerPC/PPCInstrInfo.td
+++ lib/Target/PowerPC/PPCInstrInfo.td
@@ -3807,7 +3807,7 @@
def EnforceIEIO : XForm_24_eieio<31, 854, (outs), (ins),
"eieio", IIC_LdStLoad, []>;
-def WAIT : XForm_24_sync<31, 62, (outs), (ins i32imm:$L),
+def WAIT : XForm_24_sync<31, 30, (outs), (ins i32imm:$L),
"wait $L", IIC_LdStLoad, []>;
def MBAR : XForm_mbar<31, 854, (outs), (ins u5imm:$MO),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48550.152704.patch
Type: text/x-patch
Size: 3295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180625/0d64b445/attachment.bin>
More information about the llvm-commits
mailing list