Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: src/trusted/validator_mips/testdata/test_jmp_reg.S

Issue 9979025: [MIPS] Adding validator for MIPS architecture. (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Update per initial code review. Nexes removed. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 for jr & jalr instructions.
8 #
9
10 .globl _start
11 _start:
12 .align 4
13 .set noreorder
14 .set JUMP_MASK,$t6
15
16 bundle_8mod16_jr:
17 nop
18 and $t1,$t1,JUMP_MASK
19 jr $t1 #OK
20 nop
21
22 bundle_4mod16_jr:
23 and $t1,$t1,JUMP_MASK
24 jr $t1 #OK
25 nop
26 nop
27
28 bundle_8mod16_jalr:
29 nop
30 and $t1,$t1,JUMP_MASK
31 jalr $t1 #OK
32 nop
33
34 bundle_4mod16_jalr:
35 and $t1,$t1,JUMP_MASK
36 jalr $t1 #kProblemMisalignedCall
37 nop
38 and $a1, $a1, $t7
39
40 cross_bundle:
41 jr $a1 #error, cross bundle
42 nop
43 nop
44 nop
45
46 bundle_bad_mask:
47 addiu $a0, $zero, 16
48 and $a1, $a1, $t7
49 jalr $a1 #kProblemJmpRegNoMask
50 nop
51
52 bundle_no_mask:
53 addiu $a0, $zero, 16
54 lw $a2, 16($sp)
55 jalr $a1 #kProblemJmpRegNoMask
56 nop
57
58 bundle_jalr_t0_t9:
59 addu $s0, $a0, $a1
60 and $v0, $v0, JUMP_MASK
61 jalr $t0, $v0 # ok
62 nop
63
64 bundle_jalr_t7_t9:
65 addu $s0, $a0, $a1
66 and $v0, $v0, JUMP_MASK
67 jalr $t7, $v0 #kProblemReadOnlyRegister
68 nop
69
70 bundle_jalr_t7_t92:
71 addu $s0, $a0, $a1
72 and $v0, $v0, JUMP_MASK
73 jalr $sp, $v0 #error, kProblemUnsafeDataWrite
74 nop
75
76 bundle_jal_delay_slot:
77 b bundle_jalr_t7_t92
78 and $v0, $v0, JUMP_MASK
79 jalr $t0, $v0 #ok
80 nop
81
82 end_of_code:
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698