mips-memory-instructions.s revision 6b96c3f71fce6b0a7c380dfc3b7ebf22c40e804b
1# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | FileCheck %s 2# Check that the assembler can handle the documented syntax 3# for loads and stores. 4# CHECK: .section __TEXT,__text,regular,pure_instructions 5#------------------------------------------------------------------------------ 6# Memory store instructions 7#------------------------------------------------------------------------------ 8# CHECK: sb $4, 16($5) # encoding: [0x10,0x00,0xa4,0xa0] 9# CHECK: sc $4, 16($5) # encoding: [0x10,0x00,0xa4,0xe0] 10# CHECK: sh $4, 16($5) # encoding: [0x10,0x00,0xa4,0xa4] 11# CHECK: sw $4, 16($5) # encoding: [0x10,0x00,0xa4,0xac] 12# CHECK: sw $7, 0($5) # encoding: [0x00,0x00,0xa7,0xac] 13 sb $4, 16($5) 14 sc $4, 16($5) 15 sh $4, 16($5) 16 sw $4, 16($5) 17 sw $7, ($5) 18 19#------------------------------------------------------------------------------ 20# Memory load instructions 21#------------------------------------------------------------------------------ 22 23# CHECK: lb $4, 4($5) # encoding: [0x04,0x00,0xa4,0x80] 24# CHECK: lw $4, 4($5) # encoding: [0x04,0x00,0xa4,0x8c] 25# CHECK: lbu $4, 4($5) # encoding: [0x04,0x00,0xa4,0x90] 26# CHECK: lh $4, 4($5) # encoding: [0x04,0x00,0xa4,0x84] 27# CHECK: lhu $4, 4($5) # encoding: [0x04,0x00,0xa4,0x94] 28# CHECK: ll $4, 4($5) # encoding: [0x04,0x00,0xa4,0xc0] 29# CHECK: lw $4, 4($5) # encoding: [0x04,0x00,0xa4,0x8c] 30# CHECK: lw $7, 0($7) # encoding: [0x00,0x00,0xe7,0x8c] 31# CHECK: lw $2, 16($sp) # encoding: [0x10,0x00,0xa2,0x8f] 32 33 lb $4, 4($5) 34 lw $4, 4($5) 35 lbu $4, 4($5) 36 lh $4, 4($5) 37 lhu $4, 4($5) 38 ll $4, 4($5) 39 lw $4, 4($5) 40 lw $7, ($7) 41 lw $2, 16($sp) 42