aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/Mips
diff options
context:
space:
mode:
authorJack Carter <jcarter@mips.com>2013-02-20 23:11:17 +0000
committerJack Carter <jcarter@mips.com>2013-02-20 23:11:17 +0000
commit99e98551bf8719764f9345ce856118f3f1a9c441 (patch)
treefbb5a2aa4268e18cf3a6d5a4554a56e7884f36e7 /test/MC/Mips
parentbeda6ab879e35b6f7d998da980b30e3844d3bbeb (diff)
downloadexternal_llvm-99e98551bf8719764f9345ce856118f3f1a9c441.zip
external_llvm-99e98551bf8719764f9345ce856118f3f1a9c441.tar.gz
external_llvm-99e98551bf8719764f9345ce856118f3f1a9c441.tar.bz2
ELF symbol table field st_other support,
excluding visibility bits. Mips specific standalone assembler directive "set at". This directive changes the general purpose register that the assembler will use when given the symbolic register name $at. This does not include negative testing. That will come in a future patch. A side affect of this patch recognizes the different GPR register names for temporaries between old abi and new abi so a test case for that is included. Contributer: Vladimir Medic git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175686 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/Mips')
-rw-r--r--test/MC/Mips/mips_directives.s27
-rw-r--r--test/MC/Mips/nabi-regs.s36
-rw-r--r--test/MC/Mips/set-at-directive.s132
3 files changed, 182 insertions, 13 deletions
diff --git a/test/MC/Mips/mips_directives.s b/test/MC/Mips/mips_directives.s
index 5026b38..d0a3bea 100644
--- a/test/MC/Mips/mips_directives.s
+++ b/test/MC/Mips/mips_directives.s
@@ -2,18 +2,19 @@
#this test produces no output so there isS no FileCheck call
$BB0_2:
.ent directives_test
- .frame $sp,0,$ra
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- .set noat
+ .frame $sp,0,$ra
+ .mask 0x00000000,0
+ .fmask 0x00000000,0
+ .set noreorder
+ .set nomacro
+ .set noat
$JTI0_0:
- .gpword ($BB0_2)
- .word 0x77fffffc
+ .gpword ($BB0_2)
+ .word 0x77fffffc
# CHECK: $JTI0_0:
-# CHECK-NEXT: .4byte 2013265916
- .set at=$12
- .set macro
- .set reorder
- .end directives_test
+# CHECK-NEXT: .4byte 2013265916
+ .set at=$12
+ .set macro
+ .set reorder
+ .set at=$a0
+ .end directives_test
diff --git a/test/MC/Mips/nabi-regs.s b/test/MC/Mips/nabi-regs.s
new file mode 100644
index 0000000..9371208
--- /dev/null
+++ b/test/MC/Mips/nabi-regs.s
@@ -0,0 +1,36 @@
+# OABI (o32, o64) have a different symbolic register
+# set for the A and T registers because the NABI allows
+# for 4 more register parameters (A registers) offsetting
+# the T registers.
+#
+# For now just check N64
+# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding \
+# RUN: -mcpu=mips64r2 -arch=mips64 | \
+# RUN: FileCheck %s
+
+# CHECK: .section __TEXT,__text,regular,pure_instructions
+ .text
+foo:
+
+# CHECK: add $16, $16, $4 # encoding: [0x02,0x04,0x80,0x20]
+ add $s0,$s0,$a0
+# CHECK: add $16, $16, $6 # encoding: [0x02,0x06,0x80,0x20]
+ add $s0,$s0,$a2
+# CHECK: add $16, $16, $7 # encoding: [0x02,0x07,0x80,0x20]
+ add $s0,$s0,$a3
+# CHECK: add $16, $16, $8 # encoding: [0x02,0x08,0x80,0x20]
+ add $s0,$s0,$a4
+# CHECK: add $16, $16, $9 # encoding: [0x02,0x09,0x80,0x20]
+ add $s0,$s0,$a5
+# CHECK: add $16, $16, $10 # encoding: [0x02,0x0a,0x80,0x20]
+ add $s0,$s0,$a6
+# CHECK: add $16, $16, $11 # encoding: [0x02,0x0b,0x80,0x20]
+ add $s0,$s0,$a7
+# CHECK: add $16, $16, $12 # encoding: [0x02,0x0c,0x80,0x20]
+ add $s0,$s0,$t0
+# CHECK: add $16, $16, $13 # encoding: [0x02,0x0d,0x80,0x20]
+ add $s0,$s0,$t1
+# CHECK: add $16, $16, $14 # encoding: [0x02,0x0e,0x80,0x20]
+ add $s0,$s0,$t2
+# CHECK: add $16, $16, $15 # encoding: [0x02,0x0f,0x80,0x20]
+ add $s0,$s0,$t3
diff --git a/test/MC/Mips/set-at-directive.s b/test/MC/Mips/set-at-directive.s
new file mode 100644
index 0000000..98a3a35
--- /dev/null
+++ b/test/MC/Mips/set-at-directive.s
@@ -0,0 +1,132 @@
+# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | \
+# RUN: FileCheck %s
+# Check that the assembler can handle the documented syntax
+# for ".set at" and set the correct value.
+
+# CHECK: .section __TEXT,__text,regular,pure_instructions
+ .text
+foo:
+# CHECK: jr $1 # encoding: [0x08,0x00,0x20,0x00]
+ .set at=$1
+ jr $at
+ nop
+# CHECK: jr $2 # encoding: [0x08,0x00,0x40,0x00]
+ .set at=$2
+ jr $at
+ nop
+# CHECK: jr $3 # encoding: [0x08,0x00,0x60,0x00]
+ .set at=$3
+ jr $at
+ nop
+# CHECK: jr $4 # encoding: [0x08,0x00,0x80,0x00]
+ .set at=$a0
+ jr $at
+ nop
+# CHECK: jr $5 # encoding: [0x08,0x00,0xa0,0x00]
+ .set at=$a1
+ jr $at
+ nop
+# CHECK: jr $6 # encoding: [0x08,0x00,0xc0,0x00]
+ .set at=$a2
+ jr $at
+ nop
+# CHECK: jr $7 # encoding: [0x08,0x00,0xe0,0x00]
+ .set at=$a3
+ jr $at
+ nop
+# CHECK: jr $8 # encoding: [0x08,0x00,0x00,0x01]
+ .set at=$8
+ jr $at
+ nop
+# CHECK: jr $9 # encoding: [0x08,0x00,0x20,0x01]
+ .set at=$9
+ jr $at
+ nop
+# CHECK: jr $10 # encoding: [0x08,0x00,0x40,0x01]
+ .set at=$10
+ jr $at
+ nop
+# CHECK: jr $11 # encoding: [0x08,0x00,0x60,0x01]
+ .set at=$11
+ jr $at
+ nop
+# CHECK: jr $12 # encoding: [0x08,0x00,0x80,0x01]
+ .set at=$12
+ jr $at
+ nop
+# CHECK: jr $13 # encoding: [0x08,0x00,0xa0,0x01]
+ .set at=$13
+ jr $at
+ nop
+# CHECK: jr $14 # encoding: [0x08,0x00,0xc0,0x01]
+ .set at=$14
+ jr $at
+ nop
+# CHECK: jr $15 # encoding: [0x08,0x00,0xe0,0x01]
+ .set at=$15
+ jr $at
+ nop
+# CHECK: jr $16 # encoding: [0x08,0x00,0x00,0x02]
+ .set at=$s0
+ jr $at
+ nop
+# CHECK: jr $17 # encoding: [0x08,0x00,0x20,0x02]
+ .set at=$s1
+ jr $at
+ nop
+# CHECK: jr $18 # encoding: [0x08,0x00,0x40,0x02]
+ .set at=$s2
+ jr $at
+ nop
+# CHECK: jr $19 # encoding: [0x08,0x00,0x60,0x02]
+ .set at=$s3
+ jr $at
+ nop
+# CHECK: jr $20 # encoding: [0x08,0x00,0x80,0x02]
+ .set at=$s4
+ jr $at
+ nop
+# CHECK: jr $21 # encoding: [0x08,0x00,0xa0,0x02]
+ .set at=$s5
+ jr $at
+ nop
+# CHECK: jr $22 # encoding: [0x08,0x00,0xc0,0x02]
+ .set at=$s6
+ jr $at
+ nop
+# CHECK: jr $23 # encoding: [0x08,0x00,0xe0,0x02]
+ .set at=$s7
+ jr $at
+ nop
+# CHECK: jr $24 # encoding: [0x08,0x00,0x00,0x03]
+ .set at=$24
+ jr $at
+ nop
+# CHECK: jr $25 # encoding: [0x08,0x00,0x20,0x03]
+ .set at=$25
+ jr $at
+ nop
+# CHECK: jr $26 # encoding: [0x08,0x00,0x40,0x03]
+ .set at=$26
+ jr $at
+ nop
+# CHECK: jr $27 # encoding: [0x08,0x00,0x60,0x03]
+ .set at=$27
+ jr $at
+ nop
+# CHECK: jr $gp # encoding: [0x08,0x00,0x80,0x03]
+ .set at=$gp
+ jr $at
+ nop
+# CHECK: jr $fp # encoding: [0x08,0x00,0xc0,0x03]
+ .set at=$fp
+ jr $at
+ nop
+# CHECK: jr $sp # encoding: [0x08,0x00,0xa0,0x03]
+ .set at=$sp
+ jr $at
+ nop
+# CHECK: jr $ra # encoding: [0x08,0x00,0xe0,0x03]
+ .set at=$ra
+ jr $at
+ nop