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:
1.4 KB
|
Line | |
---|
1 | /******************************************** |
---|
2 | * files : asm_014_cmov.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.jal |
---|
15 | * l.jr |
---|
16 | * l.lwz |
---|
17 | * l.or |
---|
18 | * l.ori |
---|
19 | * l.sfeq |
---|
20 | * l.sw |
---|
21 | ******************************************** |
---|
22 | */ |
---|
23 | .file "asm_014_cmov.s" |
---|
24 | .section .text |
---|
25 | .align 4 |
---|
26 | |
---|
27 | .global _asm_014_cmov |
---|
28 | _asm_014_cmov : |
---|
29 | /* save context */ |
---|
30 | l.addi r1,r1,-16 |
---|
31 | l.sw 0 (r1),r20 |
---|
32 | l.sw 4 (r1),r21 |
---|
33 | l.sw 8 (r1),r22 |
---|
34 | l.sw 12(r1),r23 |
---|
35 | /* Return is KO (default)*/ |
---|
36 | l.and r11,r0,r0 |
---|
37 | |
---|
38 | l.and r20,r0,r0 |
---|
39 | l.movhi r21,0x5555 |
---|
40 | l.ori r21,r21,0x5555 |
---|
41 | l.movhi r22,0xaaaa |
---|
42 | l.ori r22,r22,0xaaaa |
---|
43 | |
---|
44 | /* set flag 1 */ |
---|
45 | l.sfeq r0,r0 |
---|
46 | l.cmov r20,r21,r0 |
---|
47 | |
---|
48 | /* set flag 0 */ |
---|
49 | l.sfne r0,r0 |
---|
50 | l.cmov r23,r0,r22 |
---|
51 | |
---|
52 | l.or r20,r20,r23 |
---|
53 | |
---|
54 | l.sfeqi r20,-1 |
---|
55 | l.bnf _asm_014_cmov_ko |
---|
56 | l.nop 0 |
---|
57 | |
---|
58 | _asm_014_cmov_ok : |
---|
59 | l.addi r11,r0,1 |
---|
60 | _asm_014_cmov_ko : |
---|
61 | |
---|
62 | /* load context */ |
---|
63 | l.lwz r23,12(r1) |
---|
64 | l.lwz r22,8 (r1) |
---|
65 | l.lwz r21,4 (r1) |
---|
66 | l.lwz r20,0 (r1) |
---|
67 | l.jr r9 |
---|
68 | l.addi r1,r1,16 |
---|
69 | |
---|
Note: See
TracBrowser
for help on using the repository browser.