OLD | NEW |
(Empty) | |
| 1 # Copyright 2012 The Native Client Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can |
| 3 # be found in the LICENSE file. |
| 4 # Copyright 2012 MIPS Technologies / RT-RK. |
| 5 |
| 6 |
| 7 # test if all load instrs are recognized as such |
| 8 # test if load from sp is allowed |
| 9 # test if mask and instr are split w/ delay slot |
| 10 # test if mask and inst are in the same bundle |
| 11 |
| 12 # load from guard regions... |
| 13 |
| 14 |
| 15 .globl _start |
| 16 _start: |
| 17 .align 4 |
| 18 .set noreorder |
| 19 .set STORE_MASK,$t7 |
| 20 |
| 21 #check masked load |
| 22 and $a0, $a0, STORE_MASK |
| 23 lw $v0, 16($a0) |
| 24 nop |
| 25 nop |
| 26 |
| 27 #test if all load instrs are recognized as such |
| 28 |
| 29 bundle_load_instrs: |
| 30 lb $a0, 4($a1) #error, unsafe load, no mask |
| 31 lw $a0, 4($a1) #error, unsafe load, no mask |
| 32 lbu $a0, 4($a1) #error, unsafe load, no mask |
| 33 ldc1 $f0, 4($a1) #error, unsafe load, no mask |
| 34 |
| 35 ldc2 $10, -24($a1) #error, unsafe load, no mask |
| 36 lh $a0, 4($a1) #error, unsafe load, no mask |
| 37 lhu $a0, 4($a1) #error, unsafe load, no mask |
| 38 ll $a0, 4($a1) #error, unsafe load, no mask |
| 39 |
| 40 lw $a0, 4($a1) #error, unsafe load, no mask |
| 41 lwc1 $f0, 4($a1) #error, unsafe load, no mask |
| 42 lwc2 $10, 4($a1) #error, unsafe load, no mask |
| 43 lwl $a0, 4($a1) #error, unsafe load, no mask |
| 44 |
| 45 lwr $a0, 4($a1) #error, unsafe load, no mask |
| 46 ldxc1 $f0, $0($a1) #forbidden instruction, unsafe load |
| 47 luxc1 $f0, $a2($a1) #forbidden instruction, unsafe load |
| 48 lwxc1 $f6, $v0($a1) #forbidden instruction, unsafe load |
| 49 |
| 50 #test if load from sp is allowed |
| 51 |
| 52 bundle_load_from_sp: |
| 53 lw $v0, 16($sp) |
| 54 nop |
| 55 and $t2, $t2, STORE_MASK |
| 56 lw $t1, 16($t2) |
| 57 |
| 58 bundle_chk_delay_slot: |
| 59 b bundle_chk_bundle_cross_1 |
| 60 and $s0, $s0, STORE_MASK #ok |
| 61 lw $a0, 16($s0) |
| 62 nop |
| 63 |
| 64 bundle_chk_bundle_cross_1: |
| 65 nop |
| 66 nop |
| 67 nop |
| 68 and $a3, $a3, STORE_MASK |
| 69 |
| 70 |
| 71 bundle_chk_bundle_cross_2: |
| 72 lw $a3, 16($a3) #error, pattern crosses bundle |
| 73 nop |
| 74 nop |
| 75 nop |
| 76 |
| 77 lbux $a3, $t2($t3) |
| 78 lhx $a1, $a2($a3) |
| 79 lwx $t1, $t2($t3) |
| 80 nop |
| 81 |
| 82 end_of_code: |
OLD | NEW |