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 # Tests altering the value stored in read-only registers. |
| 8 # |
| 9 |
| 10 .globl _start |
| 11 _start: |
| 12 .align 4 |
| 13 .set noreorder |
| 14 .set STORE_MASK, $t7 |
| 15 .set JUMP_MASK, $t6 |
| 16 .set TLS_REG, $t8 |
| 17 |
| 18 # checking instructions that alter t6 |
| 19 bundle_altering_t6: |
| 20 addiu JUMP_MASK, JUMP_MASK, 64 # kProblemReadOnlyRegister |
| 21 and JUMP_MASK, JUMP_MASK, $a2 # kProblemReadOnlyRegister |
| 22 lui JUMP_MASK, $f0 # kProblemReadOnlyRegister |
| 23 clo JUMP_MASK, $a2 # kProblemReadOnlyRegister |
| 24 ins JUMP_MASK, $s3, 2, 10 # kProblemReadOnlyRegister |
| 25 lui JUMP_MASK, 0x1f # kProblemReadOnlyRegister |
| 26 mfc1 JUMP_MASK, $f12 # kProblemReadOnlyRegister |
| 27 mfhc1 JUMP_MASK, $f10 # kProblemReadOnlyRegister |
| 28 mflo JUMP_MASK # kProblemReadOnlyRegister |
| 29 movn JUMP_MASK, $v0, $v1 # kProblemReadOnlyRegister |
| 30 movt JUMP_MASK, $s4, $fcc4 # kProblemReadOnlyRegister |
| 31 mul JUMP_MASK, $s0, $s1 # kProblemReadOnlyRegister |
| 32 |
| 33 bundle_altering_t7: |
| 34 addiu STORE_MASK, STORE_MASK, 64 # kProblemReadOnlyRegister |
| 35 and STORE_MASK, STORE_MASK, $a2 # kProblemReadOnlyRegister |
| 36 cfc1 STORE_MASK, $f0 # kProblemReadOnlyRegister |
| 37 clo STORE_MASK, $a2 # kProblemReadOnlyRegister |
| 38 |
| 39 bundle_altering_t8: |
| 40 lui TLS_REG, 0x1f # kProblemReadOnlyRegister |
| 41 mfc1 TLS_REG, $f12 # kProblemReadOnlyRegister |
| 42 mfhc1 TLS_REG, $f10 # kProblemReadOnlyRegister |
| 43 mflo TLS_REG # kProblemReadOnlyRegister |
| 44 |
| 45 bundle_jalr_sp_t9: |
| 46 nop |
| 47 and $t9, $t9, JUMP_MASK |
| 48 jalr STORE_MASK, $t9 # kProblemReadOnlyRegister |
| 49 nop |
| 50 |
| 51 # make sure $14 is not interpreted |
| 52 # as $t6, when in fp instruction |
| 53 |
| 54 bundle_fp_instr: |
| 55 add.s $f14, $f4, $f2 |
| 56 mov.d $f14, $f0 |
| 57 neg.d $f14, $f4 |
| 58 lwc1 $f14,24($sp) |
| 59 |
| 60 # a few instructions where $t6/$t7 |
| 61 # is the 1st operand, but don't alter it |
| 62 |
| 63 bundle_t6_t7_not_altered: |
| 64 mthi JUMP_MASK #ok |
| 65 mult STORE_MASK, $t9 #ok |
| 66 nop |
| 67 nop |
| 68 |
| 69 end_of_code: |
OLD | NEW |