[Power9] Implement copy-paste, msgsync, slb, and stop instructions

This patch implements the following BookII and Book III instructions:
- copy copy_first cp_abort paste paste. paste_last
- msgsync
- slbieg slbsync
- stop

Total 10 instructions

Reviewers: nemanjai hfinkel tjablin amehsan kbarton
llvm-svn: 265504
diff --git a/llvm/test/MC/PowerPC/ppc64-encoding-ext.s b/llvm/test/MC/PowerPC/ppc64-encoding-ext.s
index 143a306..682a737 100644
--- a/llvm/test/MC/PowerPC/ppc64-encoding-ext.s
+++ b/llvm/test/MC/PowerPC/ppc64-encoding-ext.s
@@ -3666,3 +3666,16 @@
 # CHECK-LE: attn                             # encoding: [0x00,0x02,0x00,0x00]
             attn
 
+# 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]
+            copy 2, 19
+# CHECK-BE: copy 2, 19, 1                      # encoding: [0x7c,0x22,0x9e,0x0c]
+# CHECK-LE: copy 2, 19, 1                      # encoding: [0x0c,0x9e,0x22,0x7c]
+            copy_first 2, 19
+# CHECK-BE: paste 17, 1, 0                     # encoding: [0x7c,0x11,0x0f,0x0c]
+# CHECK-LE: paste 17, 1, 0                     # encoding: [0x0c,0x0f,0x11,0x7c]
+            paste 17, 1
+# CHECK-BE: paste. 17, 1, 1                    # encoding: [0x7c,0x31,0x0f,0x0d]
+# CHECK-LE: paste. 17, 1, 1                    # encoding: [0x0d,0x0f,0x31,0x7c]
+            paste_last 17, 1
diff --git a/llvm/test/MC/PowerPC/ppc64-encoding.s b/llvm/test/MC/PowerPC/ppc64-encoding.s
index 84f1812..f809aa4 100644
--- a/llvm/test/MC/PowerPC/ppc64-encoding.s
+++ b/llvm/test/MC/PowerPC/ppc64-encoding.s
@@ -854,3 +854,34 @@
 # CHECK-BE: mfsrin  10, 12                    # encoding: [0x7d,0x40,0x65,0x26]
 # CHECK-LE: mfsrin  10, 12                    # encoding: [0x26,0x65,0x40,0x7d]
             mfsrin  %r10,%r12
+
+# 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]
+            copy 2, 19, 1
+# CHECK-BE: paste 17, 1, 1                     # encoding: [0x7c,0x31,0x0f,0x0c]
+# CHECK-LE: paste 17, 1, 1                     # encoding: [0x0c,0x0f,0x31,0x7c]
+            paste 17, 1, 1
+# CHECK-BE: cp_abort                           # encoding: [0x7c,0x00,0x06,0x8c]
+# CHECK-LE: cp_abort                           # encoding: [0x8c,0x06,0x00,0x7c]
+            cp_abort
+
+# Message Synchronize
+# CHECK-BE: msgsync                            # encoding: [0x7c,0x00,0x06,0xec]
+# CHECK-LE: msgsync                            # encoding: [0xec,0x06,0x00,0x7c]
+            msgsync
+
+# SLB Invalidate Entry Global
+# CHECK-BE: slbieg 6, 21                       # encoding: [0x7c,0xc0,0xab,0xa4]
+# CHECK-LE: slbieg 6, 21                       # encoding: [0xa4,0xab,0xc0,0x7c]
+            slbieg 6, 21
+
+# SLB Synchronize
+# CHECK-BE: slbsync                            # encoding: [0x7c,0x00,0x02,0xa4]
+# CHECK-LE: slbsync                            # encoding: [0xa4,0x02,0x00,0x7c]
+            slbsync
+
+# Power-Saving Mode Instruction
+# CHECK-BE: stop                               # encoding: [0x4c,0x00,0x02,0xe4]
+# CHECK-LE: stop                               # encoding: [0xe4,0x02,0x00,0x4c]
+            stop