Last change
on this file since 99 was
81,
checked in by rosiere, 16 years ago
|
- Finish Environment (and test)
- Continue predictor_unit
- Add external tools
- svn keyword "Id" set
|
-
Property svn:keywords set to
Id
|
File size:
2.4 KB
|
Line | |
---|
1 | /******************************************** |
---|
2 | * files : asm_016_load.s |
---|
3 | * authors : Rosiere Mathieu |
---|
4 | * date : 2006/06/20 |
---|
5 | ******************************************** |
---|
6 | * input : - |
---|
7 | * output : 1 test OK |
---|
8 | * 0 test KO |
---|
9 | ******************************************** |
---|
10 | * test : |
---|
11 | * warning : instruction ok |
---|
12 | * l.addi |
---|
13 | * l.and |
---|
14 | * l.bf |
---|
15 | * l.jal |
---|
16 | * l.jr |
---|
17 | * l.sw |
---|
18 | ******************************************** |
---|
19 | */ |
---|
20 | .file "asm_016_load.s" |
---|
21 | .section .text |
---|
22 | .align 4 |
---|
23 | |
---|
24 | .global _asm_016_load |
---|
25 | _asm_016_load : |
---|
26 | /* save context */ |
---|
27 | l.addi r1,r1,-16 |
---|
28 | /* 0 (r1) is reserved */ |
---|
29 | l.sw 4 (r1),r20 |
---|
30 | l.sw 8 (r1),r21 |
---|
31 | l.sw 12(r1),r22 |
---|
32 | |
---|
33 | /* Return is KO (default)*/ |
---|
34 | l.and r11,r0,r0 |
---|
35 | |
---|
36 | /* Value Not Signed */ |
---|
37 | l.movhi r20,0x1234 |
---|
38 | l.ori r20,r20,0x5678 |
---|
39 | |
---|
40 | /* TEST BYTES */ |
---|
41 | l.sb 0 (r1), r20 |
---|
42 | l.lbz r21, 0 (r1) |
---|
43 | l.extbz r22,r20 |
---|
44 | |
---|
45 | l.sfeq r21,r22 |
---|
46 | l.bnf _asm_016_load_ko |
---|
47 | l.nop 1 |
---|
48 | |
---|
49 | l.lbs r21, 0 (r1) |
---|
50 | l.extbs r22,r20 |
---|
51 | |
---|
52 | l.sfeq r21,r22 |
---|
53 | l.bnf _asm_016_load_ko |
---|
54 | l.nop 1 |
---|
55 | |
---|
56 | /* TEST HALF WORD */ |
---|
57 | l.sh 0 (r1), r20 |
---|
58 | l.lhz r21, 0 (r1) |
---|
59 | l.exthz r22,r20 |
---|
60 | |
---|
61 | l.sfeq r21,r22 |
---|
62 | l.bnf _asm_016_load_ko |
---|
63 | l.nop 1 |
---|
64 | |
---|
65 | l.lhs r21, 0 (r1) |
---|
66 | l.exths r22,r20 |
---|
67 | |
---|
68 | l.sfeq r21,r22 |
---|
69 | l.bnf _asm_016_load_ko |
---|
70 | l.nop 1 |
---|
71 | |
---|
72 | /* TEST WORD */ |
---|
73 | l.sw 0 (r1), r20 |
---|
74 | l.lwz r21, 0 (r1) |
---|
75 | l.extwz r22,r20 |
---|
76 | |
---|
77 | l.sfeq r21,r22 |
---|
78 | l.bnf _asm_016_load_ko |
---|
79 | l.nop 1 |
---|
80 | |
---|
81 | l.lws r21, 0 (r1) |
---|
82 | l.extws r22,r20 |
---|
83 | |
---|
84 | l.sfeq r21,r22 |
---|
85 | l.bnf _asm_016_load_ko |
---|
86 | l.nop 1 |
---|
87 | |
---|
88 | /* Value Signed */ |
---|
89 | l.movhi r20,0xdead |
---|
90 | l.ori r20,r20,0xbeaf |
---|
91 | |
---|
92 | /* TEST BYTES */ |
---|
93 | l.sb 0 (r1), r20 |
---|
94 | l.lbz r21, 0 (r1) |
---|
95 | l.extbz r22,r20 |
---|
96 | |
---|
97 | l.sfeq r21,r22 |
---|
98 | l.bnf _asm_016_load_ko |
---|
99 | l.nop 1 |
---|
100 | |
---|
101 | l.lbs r21, 0 (r1) |
---|
102 | l.extbs r22,r20 |
---|
103 | |
---|
104 | l.sfeq r21,r22 |
---|
105 | l.bnf _asm_016_load_ko |
---|
106 | l.nop 1 |
---|
107 | |
---|
108 | /* TEST HALF WORD */ |
---|
109 | l.sh 0 (r1), r20 |
---|
110 | l.lhz r21, 0 (r1) |
---|
111 | l.exthz r22,r20 |
---|
112 | |
---|
113 | l.sfeq r21,r22 |
---|
114 | l.bnf _asm_016_load_ko |
---|
115 | l.nop 1 |
---|
116 | |
---|
117 | l.lhs r21, 0 (r1) |
---|
118 | l.exths r22,r20 |
---|
119 | |
---|
120 | l.sfeq r21,r22 |
---|
121 | l.bnf _asm_016_load_ko |
---|
122 | l.nop 1 |
---|
123 | |
---|
124 | /* TEST WORD */ |
---|
125 | l.sw 0 (r1), r20 |
---|
126 | l.lwz r21, 0 (r1) |
---|
127 | l.extwz r22,r20 |
---|
128 | |
---|
129 | l.sfeq r21,r22 |
---|
130 | l.bnf _asm_016_load_ko |
---|
131 | l.nop 1 |
---|
132 | |
---|
133 | l.lws r21, 0 (r1) |
---|
134 | l.extws r22,r20 |
---|
135 | |
---|
136 | l.sfeq r21,r22 |
---|
137 | l.bnf _asm_016_load_ko |
---|
138 | l.nop 1 |
---|
139 | |
---|
140 | _asm_016_load_ok : |
---|
141 | l.addi r11,r0,1 |
---|
142 | _asm_016_load_ko : |
---|
143 | |
---|
144 | /* load context */ |
---|
145 | l.lwz r22,12(r1) |
---|
146 | l.lwz r21,8 (r1) |
---|
147 | l.lwz r20,4 (r1) |
---|
148 | /* 0 (r1) is reserved */ |
---|
149 | l.jr r9 |
---|
150 | l.addi r1,r1,16 |
---|
Note: See
TracBrowser
for help on using the repository browser.