diff options
author | Matheus Almeida <matheus.almeida@imgtec.com> | 2013-10-22 09:43:32 +0000 |
---|---|---|
committer | Matheus Almeida <matheus.almeida@imgtec.com> | 2013-10-22 09:43:32 +0000 |
commit | 5cb5ff8b1478ed413a9e9fae43b1496f5a97a2dc (patch) | |
tree | b52c0565889f8cea6b52ab38afb685f895bdcd18 /test/MC/Mips | |
parent | ea79feb1a87af1e0e9c0fd3bf8831c4593b56d4d (diff) | |
download | external_llvm-5cb5ff8b1478ed413a9e9fae43b1496f5a97a2dc.zip external_llvm-5cb5ff8b1478ed413a9e9fae43b1496f5a97a2dc.tar.gz external_llvm-5cb5ff8b1478ed413a9e9fae43b1496f5a97a2dc.tar.bz2 |
[mips][msa] Direct Object Emission support for conditional branches.
These branches have a 16-bit offset (R_MIPS_PC16).
List of conditional branch instructions:
bnz.{b,h,w,d}
bnz.v
bz.{b,h,w,d}
bz.v
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193157 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/Mips')
-rw-r--r-- | test/MC/Mips/msa/test_cbranch.s | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/test/MC/Mips/msa/test_cbranch.s b/test/MC/Mips/msa/test_cbranch.s new file mode 100644 index 0000000..84e732e --- /dev/null +++ b/test/MC/Mips/msa/test_cbranch.s @@ -0,0 +1,78 @@ +# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 -mattr=+msa -arch=mips | FileCheck %s +# +#CHECK: bnz.b $w0, 4 # encoding: [0x47,0x80,0x00,0x01] +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bnz.h $w1, 16 # encoding: [0x47,0xa1,0x00,0x04] +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bnz.w $w2, 128 # encoding: [0x47,0xc2,0x00,0x20] +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bnz.d $w3, -128 # encoding: [0x47,0xe3,0xff,0xe0] +#CHECK: bnz.b $w0, SYMBOL0 # encoding: [0x47'A',0x80'A',0x00,0x00] + # fixup A - offset: 0, value: SYMBOL0, kind: fixup_Mips_PC16 +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bnz.h $w1, SYMBOL1 # encoding: [0x47'A',0xa1'A',0x00,0x00] + # fixup A - offset: 0, value: SYMBOL1, kind: fixup_Mips_PC16 +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bnz.w $w2, SYMBOL2 # encoding: [0x47'A',0xc2'A',0x00,0x00] + # fixup A - offset: 0, value: SYMBOL2, kind: fixup_Mips_PC16 +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bnz.d $w3, SYMBOL3 # encoding: [0x47'A',0xe3'A',0x00,0x00] + # fixup A - offset: 0, value: SYMBOL3, kind: fixup_Mips_PC16 +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] + +#CHECK: bnz.v $w0, 4 # encoding: [0x45,0x00,0x00,0x01] +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bnz.v $w0, SYMBOL0 # encoding: [0x45'A',A,0x00,0x00] + # fixup A - offset: 0, value: SYMBOL0, kind: fixup_Mips_PC16 +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] + +#CHECK: bz.b $w0, 128 # encoding: [0x47,0x00,0x00,0x20] +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bz.h $w1, 256 # encoding: [0x47,0x21,0x00,0x40] +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bz.w $w2, 512 # encoding: [0x47,0x42,0x00,0x80] +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bz.d $w3, -1024 # encoding: [0x47,0x63,0xff,0x00] +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bz.b $w0, SYMBOL0 # encoding: [0x47'A',A,0x00,0x00] + # fixup A - offset: 0, value: SYMBOL0, kind: fixup_Mips_PC16 +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bz.h $w1, SYMBOL1 # encoding: [0x47'A',0x21'A',0x00,0x00] + # fixup A - offset: 0, value: SYMBOL1, kind: fixup_Mips_PC16 +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bz.w $w2, SYMBOL2 # encoding: [0x47'A',0x42'A',0x00,0x00] + # fixup A - offset: 0, value: SYMBOL2, kind: fixup_Mips_PC16 +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bz.d $w3, SYMBOL3 # encoding: [0x47'A',0x63'A',0x00,0x00] + # fixup A - offset: 0, value: SYMBOL3, kind: fixup_Mips_PC16 +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] + +#CHECK: bz.v $w0, 4 # encoding: [0x45,0x60,0x00,0x01] +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] +#CHECK: bz.v $w0, SYMBOL0 # encoding: [0x45'A',0x60'A',0x00,0x00] + # fixup A - offset: 0, value: SYMBOL0, kind: fixup_Mips_PC16 +#CHECK: nop # encoding: [0x00,0x00,0x00,0x00] + +bnz.b $w0, 4 +bnz.h $w1, 16 +bnz.w $w2, 128 +bnz.d $w3, -128 +bnz.b $w0, SYMBOL0 +bnz.h $w1, SYMBOL1 +bnz.w $w2, SYMBOL2 +bnz.d $w3, SYMBOL3 + +bnz.v $w0, 4 +bnz.v $w0, SYMBOL0 + +bz.b $w0, 128 +bz.h $w1, 256 +bz.w $w2, 512 +bz.d $w3, -1024 +bz.b $w0, SYMBOL0 +bz.h $w1, SYMBOL1 +bz.w $w2, SYMBOL2 +bz.d $w3, SYMBOL3 + +bz.v $w0, 4 +bz.v $w0, SYMBOL0 |