OSDN Git Service

[PowerPC] Fix incorrectly encoded wait instruction
authorLei Huang <lei@ca.ibm.com>
Mon, 25 Jun 2018 19:28:27 +0000 (19:28 +0000)
committerLei Huang <lei@ca.ibm.com>
Mon, 25 Jun 2018 19:28:27 +0000 (19:28 +0000)
Encoding for the wait instruction was wrong. Fix according to ISA 3.0.

Differential Revision: https://reviews.llvm.org/D48550

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

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

index ece17a7..f80c109 100644 (file)
@@ -3807,7 +3807,7 @@ def ICBI : XForm_1a<31, 982, (outs), (ins memrr:$src),
 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),
index b486383..08ac70e 100644 (file)
@@ -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
 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 a6af0a9..70b635e 100644 (file)
@@ -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]
 # 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