[PowerPC] Implement instruction definitions/MC Tests for xvcvspbf16 and xvcvbf16spn
authorAmy Kwan <amy.kwan1@ibm.com>
Tue, 1 Sep 2020 15:15:45 +0000 (10:15 -0500)
committerAmy Kwan <amy.kwan1@ibm.com>
Tue, 1 Sep 2020 15:59:43 +0000 (10:59 -0500)
This patch adds the td instruction definitions of the xvcvspbf16 and xvcvbf16spn
instructions, along with their respective MC tests.

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

llvm/lib/Target/PowerPC/PPCInstrPrefix.td
llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-ISA31.txt
llvm/test/MC/PowerPC/ppc64-encoding-ISA31.s

index f517685..fc4e57e 100644 (file)
@@ -1300,6 +1300,11 @@ let Predicates = [IsISA3_1] in {
   def XSCVSQQP : X_VT5_XO5_VB5<63, 11, 836, "xscvsqqp", []>;
 }
 
+let Predicates = [IsISA3_1, HasVSX] in {
+  def XVCVSPBF16 : XX2_XT6_XO5_XB6<60, 17, 475, "xvcvspbf16", vsrc, []>;
+  def XVCVBF16SPN : XX2_XT6_XO5_XB6<60, 16, 475, "xvcvbf16spn", vsrc, []>;
+}
+
 //---------------------------- Anonymous Patterns ----------------------------//
 let Predicates = [IsISA3_1] in {
   // Exploit the vector multiply high instructions using intrinsics.
index eb17515..a07f10d 100644 (file)
 
 # CHECK: vstrihl. 2, 2
 0x10 0x42 0x14 0x0d
+
+# CHECK: xvcvspbf16 33, 34
+0xf0 0x31 0x17 0x6f
+
+# CHECK: xvcvbf16spn 33, 34
+0xf0 0x30 0x17 0x6f
index d925f71..29e9a7a 100644 (file)
 # CHECK-BE: vstrihl. 2, 2                         # encoding: [0x10,0x42,0x14,0x0d]
 # CHECK-LE: vstrihl. 2, 2                         # encoding: [0x0d,0x14,0x42,0x10]
             vstrihl. 2, 2
+# CHECK-BE: xvcvspbf16 33, 34                     # encoding: [0xf0,0x31,0x17,0x6f]
+# CHECK-LE: xvcvspbf16 33, 34                     # encoding: [0x6f,0x17,0x31,0xf0]
+            xvcvspbf16 33, 34
+# CHECK-BE: xvcvbf16spn 33, 34                    # encoding: [0xf0,0x30,0x17,0x6f]
+# CHECK-LE: xvcvbf16spn 33, 34                    # encoding: [0x6f,0x17,0x30,0xf0]
+            xvcvbf16spn 33, 34