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

Side by Side Diff: src/trusted/validator_mips/testdata/test_stores.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 #test if all store instrs are recognized as such
8 #test if store 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
13 .globl _start
14 _start:
15 .align 4
16 .set noreorder
17 .set STORE_MASK,$t7
18
19 #check store mask
20 bundle_store_mask:
21 and $a3, $a3, STORE_MASK #good mask
22 sw $s1, 128($a3)
23 and $a3, $a3, $t8 #bad mask
24 sw $s1, 128($a3)
25
26 bundle_store_list:
27 sb $a0, 16($a1) #unsafe store, no mask
28 sc $a0, 16($a1) #unsafe store, no mask
29 sdc1 $0, 16($a1) #unsafe store, no mask
30 sdc2 $8, 16($a1) #unsafe store, no mask
31
32 sh $a0, 16($a1) #unsafe store, no mask
33 sw $a0, 16($a1) #unsafe store, no mask
34 swc1 $f2, 16($a1) #unsafe store, no mask
35 swc2 $22, 16($a1) #unsafe store, no mask
36
37 swl $a0, 16($a1) #unsafe store, no mask
38 swr $a0, 16($a1) #unsafe store, no mask
39 nop
40 nop
41
42 bundle_indexed_store:
43 sdxc1 $f6, $a2($a0) #forbidden instruction
44 suxc1 $f4, $t8($a1) #forbidden instruction
45 swxc1 $f4, $t8($a1) #forbidden instruction
46 nop
47
48 bundle_store_from_sp:
49 sw $a0, 16($sp) # ok - sw from sp doesn't need a mask
50 nop
51 nop
52 nop
53
54
55 bundle_chk_delay_slot:
56 b bundle_chk_bundle_cross_1
57 and $s0, $s0, STORE_MASK
58 sw $v0, 16($s0) #ok
59 nop
60
61 bundle_chk_bundle_cross_1:
62 nop
63 nop
64 nop
65 and $a3, $a3, STORE_MASK
66
67 bundle_chk_bundle_cross_2:
68 sw $a3, 16($a3) #ERROR, cross bundle
69 nop
70 nop
71 nop
72
73 bundle_indexed_store_index_not_zero:
74 and $a0, $a0, STORE_MASK
75 sdxc1 $f6, $a2($a0) #forbidden instruction
76 nop
77 nop
78
79 bundle_sp_1:
80 sw $sp,0($t1)
81 and $sp,$sp,STORE_MASK #ERROR, no mask for store for t1
82 nop
83 nop
84
85 end_of_code:
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698