summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorJack Carter <jcarter@mips.com>2013-02-21 02:09:31 +0000
committerJack Carter <jcarter@mips.com>2013-02-21 02:09:31 +0000
commitdc46338e2d9c534a53369901fc8025fab9cbc9ba (patch)
tree716e910d2588714216fb6fb3720302f58331d31c /llvm/test
parentfd8eac66faf122105c4d2e52862cafdb6b05bce6 (diff)
downloadbcm5719-llvm-dc46338e2d9c534a53369901fc8025fab9cbc9ba.tar.gz
bcm5719-llvm-dc46338e2d9c534a53369901fc8025fab9cbc9ba.zip
Mips specific standalone assembler addressing mode %hi and %lo.
The constructs %hi() and %lo() represent the high and low 16 bits of the address. Because the 16 bit offset field of an LW instruction is interpreted as signed, if bit 15 of the low part is 1 then the low part will act as a negative and 1 needs to be added to the high part. Contributer: Vladimir Medic llvm-svn: 175707
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/MC/Mips/hilo-addressing.s11
-rw-r--r--llvm/test/MC/Mips/mips_directives.s5
2 files changed, 13 insertions, 3 deletions
diff --git a/llvm/test/MC/Mips/hilo-addressing.s b/llvm/test/MC/Mips/hilo-addressing.s
new file mode 100644
index 00000000000..28459c20672
--- /dev/null
+++ b/llvm/test/MC/Mips/hilo-addressing.s
@@ -0,0 +1,11 @@
+# RUN: llvm-mc -show-encoding -triple mips-unknown-unknown %s | FileCheck %s
+
+ .ent hilo_test
+ .equ addr, 0xdeadbeef
+# CHECK: # encoding: [0x3c,0x04,0xde,0xae]
+ lui $4,%hi(addr)
+# CHECK: # encoding: [0x03,0xe0,0x00,0x08]
+ jr $31
+# CHECK: # encoding: [0x80,0x82,0xbe,0xef]
+ lb $2,%lo(addr)($4)
+ .end hilo_test
diff --git a/llvm/test/MC/Mips/mips_directives.s b/llvm/test/MC/Mips/mips_directives.s
index d0a3beaeeaa..65d584dfa8a 100644
--- a/llvm/test/MC/Mips/mips_directives.s
+++ b/llvm/test/MC/Mips/mips_directives.s
@@ -1,5 +1,5 @@
-# RUN: llvm-mc -triple mips-unknown-unknown %s | FileCheck %s
-#this test produces no output so there isS no FileCheck call
+# RUN: llvm-mc -show-encoding -triple mips-unknown-unknown %s | FileCheck %s
+#
$BB0_2:
.ent directives_test
.frame $sp,0,$ra
@@ -17,4 +17,3 @@ $JTI0_0:
.set macro
.set reorder
.set at=$a0
- .end directives_test
OpenPOWER on IntegriCloud