From 3209baefd4ab8242563118c37d8357bd9de6b421 Mon Sep 17 00:00:00 2001 From: Jack Carter Date: Thu, 16 May 2013 19:40:19 +0000 Subject: Mips assembler: Add branch macro definitions This patch adds bnez and beqz instructions which represent alias definitions for bne and beq instructions as follows: bnez $rs,$imm => bne $rs,$zero,$imm beqz $rs,$imm => beq $rs,$zero,$imm The corresponding test cases are added. Patch by Vladimir Medic git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182040 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/MC/Mips/mips-jump-instructions.s | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/MC/Mips/mips-jump-instructions.s b/test/MC/Mips/mips-jump-instructions.s index 597f6872d6..bfc052c9ce 100644 --- a/test/MC/Mips/mips-jump-instructions.s +++ b/test/MC/Mips/mips-jump-instructions.s @@ -26,7 +26,11 @@ # CHECK32: nop # encoding: [0x00,0x00,0x00,0x00] # CHECK32: bne $9, $6, 1332 # encoding: [0x4d,0x01,0x26,0x15] # CHECK32: nop # encoding: [0x00,0x00,0x00,0x00] -# CHECK32: bal 1332 # encoding: [0x4d,0x01,0x11,0x04] +# CHECK32: bal 1332 # encoding: [0x4d,0x01,0x11,0x04] +# CHECK32: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK32: bne $11, $zero, 1332 # encoding: [0x4d,0x01,0x60,0x15] +# CHECK32: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK32: beq $11, $zero, 1332 # encoding: [0x4d,0x01,0x60,0x11] # CHECK32: nop # encoding: [0x00,0x00,0x00,0x00] # CHECK64: b 1332 # encoding: [0x4d,0x01,0x00,0x10] @@ -49,6 +53,10 @@ # CHECK64: nop # encoding: [0x00,0x00,0x00,0x00] # CHECK64: bal 1332 # encoding: [0x4d,0x01,0x11,0x04] # CHECK64: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK64: bne $11, $zero, 1332 # encoding: [0x4d,0x01,0x60,0x15] +# CHECK64: nop # encoding: [0x00,0x00,0x00,0x00] +# CHECK64: beq $11, $zero, 1332 # encoding: [0x4d,0x01,0x60,0x11] +# CHECK64: nop # encoding: [0x00,0x00,0x00,0x00] .set noreorder @@ -72,6 +80,10 @@ nop bal 1332 nop + bnez $11,1332 + nop + beqz $11,1332 + nop end_of_code: #------------------------------------------------------------------------------ -- cgit v1.2.3