diff options
Diffstat (limited to 'test/MC/Mips/mips64-alu-instructions.s')
-rw-r--r-- | test/MC/Mips/mips64-alu-instructions.s | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/MC/Mips/mips64-alu-instructions.s b/test/MC/Mips/mips64-alu-instructions.s index 8262a46..19ed1ff 100644 --- a/test/MC/Mips/mips64-alu-instructions.s +++ b/test/MC/Mips/mips64-alu-instructions.s @@ -81,7 +81,9 @@ # CHECK: msubu $6, $7 # encoding: [0x05,0x00,0xc7,0x70] # CHECK: mult $3, $5 # encoding: [0x18,0x00,0x65,0x00] # CHECK: multu $3, $5 # encoding: [0x19,0x00,0x65,0x00] +# CHECK: dsub $9, $6, $7 # encoding: [0x2e,0x48,0xc7,0x00] # CHECK: dsubu $4, $3, $5 # encoding: [0x2f,0x20,0x65,0x00] +# CHECK: daddiu $9, $6, -17767 # encoding: [0x99,0xba,0xc9,0x64] # CHECK: move $7, $8 # encoding: [0x2d,0x38,0x00,0x01] # CHECK: .set push # CHECK: .set mips32r2 @@ -104,6 +106,47 @@ msubu $6,$7 mult $3,$5 multu $3,$5 + dsub $9,$6,$7 dsubu $4,$3,$5 + dsubu $9,$6,17767 move $7,$8 rdhwr $5, $29 + +#------------------------------------------------------------------------------ +# Shortcuts for arithmetic instructions +#------------------------------------------------------------------------------ + +# CHECK: and $9, $9, $3 # encoding: [0x24,0x48,0x23,0x01] +# CHECK: dadd $9, $9, $3 # encoding: [0x2c,0x48,0x23,0x01] +# CHECK: daddu $9, $9, $3 # encoding: [0x2d,0x48,0x23,0x01] +# CHECK: daddi $9, $9, 10 # encoding: [0x0a,0x00,0x29,0x61] +# CHECK: daddiu $9, $9, 10 # encoding: [0x0a,0x00,0x29,0x65] +# CHECK: dsub $9, $9, $3 # encoding: [0x2e,0x48,0x23,0x01] +# CHECK: dsubu $9, $9, $3 # encoding: [0x2f,0x48,0x23,0x01] +# CHECK: daddi $9, $9, -10 # encoding: [0xf6,0xff,0x29,0x61] +# CHECK: daddiu $9, $9, -10 # encoding: [0xf6,0xff,0x29,0x65] +# CHECK: or $9, $9, $3 # encoding: [0x25,0x48,0x23,0x01] +# CHECK: xor $9, $9, $3 # encoding: [0x26,0x48,0x23,0x01] + and $9, $3 + dadd $9, $3 + daddu $9, $3 + dadd $9, 10 + daddu $9, 10 + dsub $9, $3 + dsubu $9, $3 + dsub $9, 10 + dsubu $9, 10 + or $9, $3 + xor $9, $3 + +#------------------------------------------------------------------------------ +# Did you know that GAS supports complex arithmetic expressions in assembly? +#------------------------------------------------------------------------------ +# CHECK: daddiu $9, $3, 32 # encoding: [0x20,0x00,0x69,0x64] +# CHECK: daddiu $9, $3, 32 # encoding: [0x20,0x00,0x69,0x64] +# CHECK: daddiu $9, $3, -32 # encoding: [0xe0,0xff,0x69,0x64] +# CHECK: daddiu $9, $3, -32 # encoding: [0xe0,0xff,0x69,0x64] + daddiu $9, $3, 8 * 4 + daddiu $9, $3, (8 * 4) + dsubu $9, $3, 8 * 4 + dsubu $9, $3, (8 * 4) |