summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2015-05-18 16:35:04 +0000
committerJames Y Knight <jyknight@google.com>2015-05-18 16:35:04 +0000
commit24060be73ac17046cdd05c384ed23aa346148f3c (patch)
treef87b278846bfada9c3ca517eda61b3cdf0562e48 /llvm/test
parent807563df227b4d9961d60adf73c26e571615a815 (diff)
downloadbcm5719-llvm-24060be73ac17046cdd05c384ed23aa346148f3c.tar.gz
bcm5719-llvm-24060be73ac17046cdd05c384ed23aa346148f3c.zip
Sparc: Add the "alternate address space" load/store instructions.
- Adds support for the asm syntax, which has an immediate integer "ASI" (address space identifier) appearing after an address, before a comma. - Adds the various-width load, store, and swap in alternate address space instructions. (ldsba, ldsha, lduba, lduha, lda, stba, stha, sta, swapa) This does not attempt to hook these instructions up to pointer address spaces in LLVM, although that would probably be a reasonable thing to do in the future. Differential Revision: http://reviews.llvm.org/D8904 llvm-svn: 237581
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/MC/Disassembler/Sparc/sparc-mem.txt6
-rw-r--r--llvm/test/MC/Sparc/sparc-atomic-instructions.s11
-rw-r--r--llvm/test/MC/Sparc/sparc-mem-instructions.s16
-rw-r--r--llvm/test/MC/Sparc/sparcv9-atomic-instructions.s10
4 files changed, 35 insertions, 8 deletions
diff --git a/llvm/test/MC/Disassembler/Sparc/sparc-mem.txt b/llvm/test/MC/Disassembler/Sparc/sparc-mem.txt
index f92e052650f..5f8886ef8b7 100644
--- a/llvm/test/MC/Disassembler/Sparc/sparc-mem.txt
+++ b/llvm/test/MC/Disassembler/Sparc/sparc-mem.txt
@@ -215,3 +215,9 @@
# CHECK: swap [%g1], %o2
0xd4 0x78 0x40 0x00
+
+# CHECK: swapa [%i0+%l6] 131, %o2
+0xd4 0xfe 0x10 0x76
+
+# CHECK: swapa [%g1] 131, %o2
+0xd4 0xf8 0x50 0x60
diff --git a/llvm/test/MC/Sparc/sparc-atomic-instructions.s b/llvm/test/MC/Sparc/sparc-atomic-instructions.s
index 5c46067ea3b..17f97d4b535 100644
--- a/llvm/test/MC/Sparc/sparc-atomic-instructions.s
+++ b/llvm/test/MC/Sparc/sparc-atomic-instructions.s
@@ -1,7 +1,5 @@
! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s
-
- ! CHECK: membar 15 ! encoding: [0x81,0x43,0xe0,0x0f]
- membar 15
+! RUN: llvm-mc %s -arch=sparc -show-encoding | FileCheck %s
! CHECK: stbar ! encoding: [0x81,0x43,0xc0,0x00]
stbar
@@ -12,8 +10,5 @@
! CHECK: swap [%i0+32], %o2 ! encoding: [0xd4,0x7e,0x20,0x20]
swap [%i0+32], %o2
- ! CHECK: cas [%i0], %l6, %o2 ! encoding: [0xd5,0xe6,0x10,0x16]
- cas [%i0], %l6, %o2
-
- ! CHECK: casx [%i0], %l6, %o2 ! encoding: [0xd5,0xf6,0x10,0x16]
- casx [%i0], %l6, %o2
+ ! CHECK: swapa [%i0+%l6] 131, %o2 ! encoding: [0xd4,0xfe,0x10,0x76]
+ swapa [%i0+%l6] 131, %o2
diff --git a/llvm/test/MC/Sparc/sparc-mem-instructions.s b/llvm/test/MC/Sparc/sparc-mem-instructions.s
index 40ccd13e7ec..ba4c0f2d104 100644
--- a/llvm/test/MC/Sparc/sparc-mem-instructions.s
+++ b/llvm/test/MC/Sparc/sparc-mem-instructions.s
@@ -7,6 +7,8 @@
ldsb [%i0 + 32], %o2
! CHECK: ldsb [%g1], %o4 ! encoding: [0xd8,0x48,0x40,0x00]
ldsb [%g1], %o4
+ ! CHECK: ldsba [%i0+%l6] 131, %o2 ! encoding: [0xd4,0xce,0x10,0x76]
+ ldsba [%i0 + %l6] 131, %o2
! CHECK: ldsh [%i0+%l6], %o2 ! encoding: [0xd4,0x56,0x00,0x16]
ldsh [%i0 + %l6], %o2
@@ -14,6 +16,8 @@
ldsh [%i0 + 32], %o2
! CHECK: ldsh [%g1], %o4 ! encoding: [0xd8,0x50,0x40,0x00]
ldsh [%g1], %o4
+ ! CHECK: ldsha [%i0+%l6] 131, %o2 ! encoding: [0xd4,0xd6,0x10,0x76]
+ ldsha [%i0 + %l6] 131, %o2
! CHECK: ldub [%i0+%l6], %o2 ! encoding: [0xd4,0x0e,0x00,0x16]
ldub [%i0 + %l6], %o2
@@ -21,6 +25,8 @@
ldub [%i0 + 32], %o2
! CHECK: ldub [%g1], %o2 ! encoding: [0xd4,0x08,0x40,0x00]
ldub [%g1], %o2
+ ! CHECK: lduba [%i0+%l6] 131, %o2 ! encoding: [0xd4,0x8e,0x10,0x76]
+ lduba [%i0 + %l6] 131, %o2
! CHECK: lduh [%i0+%l6], %o2 ! encoding: [0xd4,0x16,0x00,0x16]
lduh [%i0 + %l6], %o2
@@ -28,6 +34,8 @@
lduh [%i0 + 32], %o2
! CHECK: lduh [%g1], %o2 ! encoding: [0xd4,0x10,0x40,0x00]
lduh [%g1], %o2
+ ! CHECK: lduha [%i0+%l6] 131, %o2 ! encoding: [0xd4,0x96,0x10,0x76]
+ lduha [%i0 + %l6] 131, %o2
! CHECK: ld [%i0+%l6], %o2 ! encoding: [0xd4,0x06,0x00,0x16]
ld [%i0 + %l6], %o2
@@ -35,6 +43,8 @@
ld [%i0 + 32], %o2
! CHECK: ld [%g1], %o2 ! encoding: [0xd4,0x00,0x40,0x00]
ld [%g1], %o2
+ ! CHECK: lda [%i0+%l6] 131, %o2 ! encoding: [0xd4,0x86,0x10,0x76]
+ lda [%i0 + %l6] 131, %o2
! CHECK: stb %o2, [%i0+%l6] ! encoding: [0xd4,0x2e,0x00,0x16]
stb %o2, [%i0 + %l6]
@@ -42,6 +52,8 @@
stb %o2, [%i0 + 32]
! CHECK: stb %o2, [%g1] ! encoding: [0xd4,0x28,0x40,0x00]
stb %o2, [%g1]
+ ! CHECK: stba %o2, [%i0+%l6] 131 ! encoding: [0xd4,0xae,0x10,0x76]
+ stba %o2, [%i0 + %l6] 131
! CHECK: sth %o2, [%i0+%l6] ! encoding: [0xd4,0x36,0x00,0x16]
sth %o2, [%i0 + %l6]
@@ -49,6 +61,8 @@
sth %o2, [%i0 + 32]
! CHECK: sth %o2, [%g1] ! encoding: [0xd4,0x30,0x40,0x00]
sth %o2, [%g1]
+ ! CHECK: stha %o2, [%i0+%l6] 131 ! encoding: [0xd4,0xb6,0x10,0x76]
+ stha %o2, [%i0 + %l6] 131
! CHECK: st %o2, [%i0+%l6] ! encoding: [0xd4,0x26,0x00,0x16]
st %o2, [%i0 + %l6]
@@ -56,3 +70,5 @@
st %o2, [%i0 + 32]
! CHECK: st %o2, [%g1] ! encoding: [0xd4,0x20,0x40,0x00]
st %o2, [%g1]
+ ! CHECK: sta %o2, [%i0+%l6] 131 ! encoding: [0xd4,0xa6,0x10,0x76]
+ sta %o2, [%i0 + %l6] 131
diff --git a/llvm/test/MC/Sparc/sparcv9-atomic-instructions.s b/llvm/test/MC/Sparc/sparcv9-atomic-instructions.s
new file mode 100644
index 00000000000..40619a75548
--- /dev/null
+++ b/llvm/test/MC/Sparc/sparcv9-atomic-instructions.s
@@ -0,0 +1,10 @@
+! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s
+
+ ! CHECK: membar 15 ! encoding: [0x81,0x43,0xe0,0x0f]
+ membar 15
+
+ ! CHECK: cas [%i0], %l6, %o2 ! encoding: [0xd5,0xe6,0x10,0x16]
+ cas [%i0], %l6, %o2
+
+ ! CHECK: casx [%i0], %l6, %o2 ! encoding: [0xd5,0xf6,0x10,0x16]
+ casx [%i0], %l6, %o2
OpenPOWER on IntegriCloud