1 # Source code used to test %hi/%lo operators with constants worked out 2 # as a difference of local symbols, both previously defined and forward 3 # references. 4 5 .text 6 foo: 7 li $4, %hi(2f - 0f) 8 sll $4, 16 9 addiu $4, %lo(2f - 0f) 10 li $5, %hi(0f - 3f) 11 sll $5, 16 12 addiu $5, %lo(0f - 3f) 13 0: 14 li $4, %hi(2f - 0b) 15 sll $4, 16 16 addiu $4, %lo(2f - 0b) 17 li $5, %hi(0b - 3f) 18 sll $5, 16 19 addiu $5, %lo(0b - 3f) 20 1: 21 .insn 22 .fill 0x7ffc - (1b - 0b) 23 2: 24 .insn 25 .fill 0x8000 - (2b - 0b) 26 3: 27 li $4, %hi(2b - 0b) 28 sll $4, 16 29 addiu $4, %lo(2b - 0b) 30 li $5, %hi(0b - 3b) 31 sll $5, 16 32 addiu $5, %lo(0b - 3b) 33 34 li $4, %hi(2f - 0f) 35 sll $4, 16 36 addiu $4, %lo(2f - 0f) 37 li $5, %hi(0f - 3f) 38 sll $5, 16 39 addiu $5, %lo(0f - 3f) 40 0: 41 li $4, %hi(2f - 0b) 42 sll $4, 16 43 addiu $4, %lo(2f - 0b) 44 li $5, %hi(0b - 3f) 45 sll $5, 16 46 addiu $5, %lo(0b - 3f) 47 1: 48 .insn 49 .fill 0x8000 - (1b - 0b) 50 2: 51 .insn 52 .fill 0x8004 - (2b - 0b) 53 3: 54 li $4, %hi(2b - 0b) 55 sll $4, 16 56 addiu $4, %lo(2b - 0b) 57 li $5, %hi(0b - 3b) 58 sll $5, 16 59 addiu $5, %lo(0b - 3b) 60 61 li $4, %hi(2f - 0f) 62 sll $4, 16 63 addiu $4, %lo(2f - 0f) 64 li $5, %hi(0f - 3f) 65 sll $5, 16 66 addiu $5, %lo(0f - 3f) 67 0: 68 li $4, %hi(2f - 0b) 69 sll $4, 16 70 addiu $4, %lo(2f - 0b) 71 li $5, %hi(0b - 3f) 72 sll $5, 16 73 addiu $5, %lo(0b - 3f) 74 1: 75 .insn 76 .fill 0x11ffdc - (1b - 0b) 77 2: 78 .insn 79 .fill 0 80 3: 81 li $4, %hi(2b - 0b) 82 sll $4, 16 83 addiu $4, %lo(2b - 0b) 84 li $5, %hi(0b - 3b) 85 sll $5, 16 86 addiu $5, %lo(0b - 3b) 87 88 # Force some (non-delay-slot) zero bytes, to make 'objdump' print ... 89 .align 4, 0 90 .space 16 91