summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC
diff options
context:
space:
mode:
authorChuang-Yu Cheng <cycheng@multicorewareinc.com>2016-04-06 01:47:02 +0000
committerChuang-Yu Cheng <cycheng@multicorewareinc.com>2016-04-06 01:47:02 +0000
commit024a623c5599bd11839939dfed0eeecbc389201e (patch)
tree18d437143f33d3e35eb7128eea65234527d99caf /llvm/test/MC
parenteaf4b3d75ca523b19b4da1a329775ae988633c07 (diff)
downloadbcm5719-llvm-024a623c5599bd11839939dfed0eeecbc389201e.tar.gz
bcm5719-llvm-024a623c5599bd11839939dfed0eeecbc389201e.zip
[Power9] Implement add-pc, multiply-add, modulo, extend-sign-shift, random number, set bool, and dfp test significance
This patch implement the following instructions: - addpcis subpcis - maddhd maddhdu maddld - modsw moduw modsd modud - darn - extswsli extswsli. - setb - dtstsfi dtstsfiq Total 15 instructions Reviewers: nemanjai hfinkel tjablin amehsan kbarton http://reviews.llvm.org/D17885 llvm-svn: 265505
Diffstat (limited to 'llvm/test/MC')
-rw-r--r--llvm/test/MC/Disassembler/PowerPC/ppc64-encoding.txt44
-rw-r--r--llvm/test/MC/PowerPC/ppc64-encoding-ext.s9
-rw-r--r--llvm/test/MC/PowerPC/ppc64-encoding.s58
3 files changed, 111 insertions, 0 deletions
diff --git a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding.txt b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding.txt
index b18d056046e..4406e916bdc 100644
--- a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding.txt
+++ b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding.txt
@@ -670,6 +670,50 @@
# CHECK: mfsrin 10, 12
0x7d 0x40 0x65 0x26
+# ISA3.0 Instructions:
+
+# CHECK: addpcis 1, -12345
+0x4c 0x23 0xcf 0xc5
+
+# CHECK: maddhd 30, 27, 7, 2
+0x13 0xdb 0x38 0xb0
+
+# CHECK: maddhdu 15, 12, 1, 3
+0x11 0xec 0x08 0xf1
+
+# CHECK: maddld 13, 10, 6, 4
+0x11 0xaa 0x31 0x33
+
+# CHECK: modsw 2, 3, 4
+0x7c 0x43 0x26 0x16
+
+# CHECK: moduw 3, 7, 5
+0x7c 0x67 0x2a 0x16
+
+# CHECK: modsd 10, 13, 14
+0x7d 0x4d 0x76 0x12
+
+# CHECK: modud 21, 15, 27
+0x7e 0xaf 0xda 0x12
+
+# CHECK: darn 31, 2
+0x7f 0xe2 0x05 0xe6
+
+# CHECK: extswsli 15, 18, 63
+0x7e 0x4f 0xfe 0xf6
+
+# CHECK: extswsli. 11, 27, 31
+0x7f 0x6b 0xfe 0xf5
+
+# CHECK: setb 2, 7
+0x7c 0x5c 0x01 0x00
+
+# CHECK: dtstsfi 7, 63, 1
+0xef 0xbf 0x0d 0x46
+
+# CHECK: dtstsfiq 4, 63, 4
+0xfe 0x3f 0x25 0x46
+
# CHECK: copy 2, 19, 1
0x7c 0x22 0x9e 0x0c
diff --git a/llvm/test/MC/PowerPC/ppc64-encoding-ext.s b/llvm/test/MC/PowerPC/ppc64-encoding-ext.s
index 682a737547d..228ff2834a6 100644
--- a/llvm/test/MC/PowerPC/ppc64-encoding-ext.s
+++ b/llvm/test/MC/PowerPC/ppc64-encoding-ext.s
@@ -3666,6 +3666,15 @@
# CHECK-LE: attn # encoding: [0x00,0x02,0x00,0x00]
attn
+# ISA3.0 Instructions:
+# Extended Mnemonics of ADDPCIS
+# CHECK-BE: addpcis 1, -12345 # encoding: [0x4c,0x23,0xcf,0xc5]
+# CHECK-LE: addpcis 1, -12345 # encoding: [0xc5,0xcf,0x23,0x4c]
+ subpcis 1, 12345
+# CHECK-BE: addpcis 12, 0 # encoding: [0x4d,0x80,0x00,0x04]
+# CHECK-LE: addpcis 12, 0 # encoding: [0x04,0x00,0x80,0x4d]
+ lnia 12
+
# Copy-Paste Facility (Extended Mnemonics):
# CHECK-BE: copy 2, 19, 0 # encoding: [0x7c,0x02,0x9e,0x0c]
# CHECK-LE: copy 2, 19, 0 # encoding: [0x0c,0x9e,0x02,0x7c]
diff --git a/llvm/test/MC/PowerPC/ppc64-encoding.s b/llvm/test/MC/PowerPC/ppc64-encoding.s
index f809aa412eb..5b46fa42c74 100644
--- a/llvm/test/MC/PowerPC/ppc64-encoding.s
+++ b/llvm/test/MC/PowerPC/ppc64-encoding.s
@@ -855,6 +855,64 @@
# CHECK-LE: mfsrin 10, 12 # encoding: [0x26,0x65,0x40,0x7d]
mfsrin %r10,%r12
+# ISA3.0 Instructions:
+
+# Add PC Immediate Shifted
+# CHECK-BE: addpcis 1, -12345 # encoding: [0x4c,0x23,0xcf,0xc5]
+# CHECK-LE: addpcis 1, -12345 # encoding: [0xc5,0xcf,0x23,0x4c]
+ addpcis 1, -12345
+
+# 64-bit Fixed-Point Multiply-Add High-DWord/High-DWord-Unsigned/Low-DWord
+# CHECK-BE: maddhd 30, 27, 7, 2 # encoding: [0x13,0xdb,0x38,0xb0]
+# CHECK-LE: maddhd 30, 27, 7, 2 # encoding: [0xb0,0x38,0xdb,0x13]
+ maddhd 30, 27, 7, 2
+# CHECK-BE: maddhdu 15, 12, 1, 3 # encoding: [0x11,0xec,0x08,0xf1]
+# CHECK-LE: maddhdu 15, 12, 1, 3 # encoding: [0xf1,0x08,0xec,0x11]
+ maddhdu 15, 12, 1, 3
+# CHECK-BE: maddld 13, 10, 6, 4 # encoding: [0x11,0xaa,0x31,0x33]
+# CHECK-LE: maddld 13, 10, 6, 4 # encoding: [0x33,0x31,0xaa,0x11]
+ maddld 13, 10, 6, 4
+
+# Modulo {Signed/Unsigned}-{Word/DWord}
+# CHECK-BE: modsw 2, 3, 4 # encoding: [0x7c,0x43,0x26,0x16]
+# CHECK-LE: modsw 2, 3, 4 # encoding: [0x16,0x26,0x43,0x7c]
+ modsw 2, 3, 4
+# CHECK-BE: moduw 3, 7, 5 # encoding: [0x7c,0x67,0x2a,0x16]
+# CHECK-LE: moduw 3, 7, 5 # encoding: [0x16,0x2a,0x67,0x7c]
+ moduw 3, 7, 5
+# CHECK-BE: modsd 10, 13, 14 # encoding: [0x7d,0x4d,0x76,0x12]
+# CHECK-LE: modsd 10, 13, 14 # encoding: [0x12,0x76,0x4d,0x7d]
+ modsd 10, 13, 14
+# CHECK-BE: modud 21, 15, 27 # encoding: [0x7e,0xaf,0xda,0x12]
+# CHECK-LE: modud 21, 15, 27 # encoding: [0x12,0xda,0xaf,0x7e]
+ modud 21, 15, 27
+
+# Deliver A Random Number
+# CHECK-BE: darn 31, 2 # encoding: [0x7f,0xe2,0x05,0xe6]
+# CHECK-LE: darn 31, 2 # encoding: [0xe6,0x05,0xe2,0x7f]
+ darn 31, 2
+
+# Extend-Sign Word and Shift Left Immediate
+# CHECK-BE: extswsli 15, 18, 63 # encoding: [0x7e,0x4f,0xfe,0xf6]
+# CHECK-LE: extswsli 15, 18, 63 # encoding: [0xf6,0xfe,0x4f,0x7e]
+ extswsli 15, 18, 63
+# CHECK-BE: extswsli. 11, 27, 31 # encoding: [0x7f,0x6b,0xfe,0xf5]
+# CHECK-LE: extswsli. 11, 27, 31 # encoding: [0xf5,0xfe,0x6b,0x7f]
+ extswsli. 11, 27, 31
+
+# Set Boolean
+# CHECK-BE: setb 2, 7 # encoding: [0x7c,0x5c,0x01,0x00]
+# CHECK-LE: setb 2, 7 # encoding: [0x00,0x01,0x5c,0x7c]
+ setb 2, 7
+
+# DFP Test Significance Immediate [Quad]
+# CHECK-BE: dtstsfi 7, 63, 1 # encoding: [0xef,0xbf,0x0d,0x46]
+# CHECK-LE: dtstsfi 7, 63, 1 # encoding: [0x46,0x0d,0xbf,0xef]
+ dtstsfi 7, 63, 1
+# CHECK-BE: dtstsfiq 4, 63, 4 # encoding: [0xfe,0x3f,0x25,0x46]
+# CHECK-LE: dtstsfiq 4, 63, 4 # encoding: [0x46,0x25,0x3f,0xfe]
+ dtstsfiq 4, 63, 4
+
# Copy-Paste Facility
# CHECK-BE: copy 2, 19, 1 # encoding: [0x7c,0x22,0x9e,0x0c]
# CHECK-LE: copy 2, 19, 1 # encoding: [0x0c,0x9e,0x22,0x7c]
OpenPOWER on IntegriCloud