1# Source file used to test the microMIPS instruction size overrides (#0). 2 3 .text 4foo: 5# Smoke-test a trivial case. 6 nop 7 nop16 8 nop32 9 10# Test ALU operations. 11 addu $2, $4 12 addu16 $2, $4 13 addu32 $2, $4 14 addu $12, $14 15 addu16 $12, $14 16 addu32 $12, $14 17 add.ps $f2, $f4 18 add16.ps $f2, $f4 19 add32.ps $f2, $f4 20 addiusp 256 21 addiusp16 256 22 addiusp32 256 23 24# Test jumps and branches. 25 jar $23 26 jar16 $23 27 jar32 $23 28 jalr $4 29 jalr16 $4 30 jalr32 $4 31 jalr $24 32 jalr16 $24 33 jalr32 $24 34 jalr $31,$5 35 jalr16 $31,$5 36 jalr32 $31,$5 37 jalr $31,$25 38 jalr16 $31,$25 39 jalr32 $31,$25 40 jalr $30,$26 41 jalr16 $30,$26 42 jalr32 $30,$26 43 b bar 44 b16 bar 45 b32 bar 46 beqz $7, bar 47 beqz16 $7, bar 48 beqz32 $7, bar 49 beqz $27, bar 50 beqz16 $27, bar 51 beqz32 $27, bar 52 53# Test branch delay slots. 54 .set noreorder 55 bltzal $2, bar 56 addu $16, $17 57 bltzal $2, bar 58 addu16 $16, $17 59 bltzal $2, bar 60 addu32 $16, $17 61 bltzals $2, bar 62 addu $16, $17 63 bltzals $2, bar 64 addu16 $16, $17 65 bltzals $2, bar 66 addu32 $16, $17 67 bltzal $2, bar 68 add.ps $f2, $f4 69 bltzal $2, bar 70 add16.ps $f2, $f4 71 bltzal $2, bar 72 add32.ps $f2, $f4 73 bltzals $2, bar 74 add.ps $f2, $f4 75 bltzals $2, bar 76 add16.ps $f2, $f4 77 bltzals $2, bar 78 add32.ps $f2, $f4 79 bltzal $2, bar 80 addiusp 256 81 bltzal $2, bar 82 addiusp16 256 83 bltzal $2, bar 84 addiusp32 256 85 bltzals $2, bar 86 addiusp 256 87 bltzals $2, bar 88 addiusp16 256 89 bltzals $2, bar 90 addiusp32 256 91 .set reorder 92 93# Test macro delay slots. 94 .set noreorder 95 bltzall $2, bar 96 addu $16, $17 97 bltzall $2, bar 98 addu16 $16, $17 99 bltzall $2, bar 100 addu32 $16, $17 101 bltzall $2, bar 102 add.ps $f2, $f4 103 bltzall $2, bar 104 add16.ps $f2, $f4 105 bltzall $2, bar 106 add32.ps $f2, $f4 107 bltzall $2, bar 108 addiusp 256 109 bltzall $2, bar 110 addiusp16 256 111 bltzall $2, bar 112 addiusp32 256 113 .set reorder 114 115# Test shift instructions to complement 64-bit tests. 116 sll $2, $3, 5 117 sll16 $2, $3, 5 118 sll32 $2, $3, 5 119 sll $2, $3, 13 120 sll16 $2, $3, 13 121 sll32 $2, $3, 13 122 sll $10, $11, 5 123 sll16 $10, $11, 5 124 sll32 $10, $11, 5 125 126# Test 64-bit instructions. 127 dsll $2, $3, 5 128 dsll16 $2, $3, 5 129 dsll32 $2, $3, 5 # No way to force 32-bit DSLL. 130 dsll3216 $2, $3, 5 131 dsll3232 $2, $3, 5 132 dsll $2, $3, 13 133 dsll16 $2, $3, 13 134 dsll32 $2, $3, 13 # No way to force 32-bit DSLL. 135 dsll3216 $2, $3, 13 136 dsll3232 $2, $3, 13 137 dsll $10, $11, 5 138 dsll16 $10, $11, 5 139 dsll32 $10, $11, 5 # No way to force 32-bit DSLL. 140 dsll3216 $10, $11, 5 141 dsll3232 $10, $11, 5 142 143# Test out-of-range mapped constants 144 addiu16 $2, $4, 4 # OK 145 addiu16 $2, $4, 5 # error 146 addiu16 $2, $4, 7 # error 147 addiu16 $2, $4, 8 # OK 148 andi16 $2, $4, 4 # OK 149 andi16 $2, $4, 5 # error 150 andi16 $2, $4, 7 # OK 151 andi16 $2, $4, 8 # OK 152 153# Test invalid ADDIUSP 154 addiusp16 4 # error 155 addiusp16 7 # error 156 addiusp16 8 # OK 157 addiusp16 10 # error 158 addiusp16 12 # OK 159 addiusp16 1028 # OK 160 addiusp16 1032 # error 161 addiusp16 -1032 # OK 162 addiusp16 -1036 # error 163 164# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ... 165 .align 2 166 .space 8 167