Last change
on this file since 82 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.5 KB
|
Line | |
---|
1 | /******************************************** |
---|
2 | * files : asm_001_add.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 : Addition |
---|
11 | * warning : instruction ok |
---|
12 | * l.addi |
---|
13 | * l.and |
---|
14 | * l.bf |
---|
15 | * l.jal |
---|
16 | * l.jr |
---|
17 | * l.lwz |
---|
18 | * l.movhi |
---|
19 | * l.ori |
---|
20 | * l.sfne |
---|
21 | * l.sw |
---|
22 | ******************************************** |
---|
23 | */ |
---|
24 | .file "asm_001_add.s" |
---|
25 | .section .text |
---|
26 | .align 4 |
---|
27 | |
---|
28 | .global _asm_001_add |
---|
29 | _asm_001_add : |
---|
30 | /* save context */ |
---|
31 | l.addi r1,r1,-8 |
---|
32 | l.sw 0(r1),r20 |
---|
33 | l.sw 4(r1),r21 |
---|
34 | |
---|
35 | /* Return is KO (default)*/ |
---|
36 | l.and r11,r0,r0 |
---|
37 | |
---|
38 | l.add r20,r0,r0 /* e + e = e */ |
---|
39 | |
---|
40 | l.sfne r20,r0 |
---|
41 | l.bf _asm_001_add_ko |
---|
42 | l.addi r20,r0,1 |
---|
43 | |
---|
44 | l.addi r21,r0,-1 |
---|
45 | l.add r21,r21,r20 /* -1 + 1 */ |
---|
46 | |
---|
47 | l.sfne r21,r0 |
---|
48 | l.bf _asm_001_add_ko |
---|
49 | l.movhi r20,0xdead |
---|
50 | l.ori r20,r0,0xbeaf |
---|
51 | |
---|
52 | l.add r21,r20,r0 /* X + e = X */ |
---|
53 | l.sfne r21,r20 |
---|
54 | l.bf _asm_001_add_ko |
---|
55 | l.nop 0 |
---|
56 | |
---|
57 | l.add r21,r0,r20 /* e + X = X */ |
---|
58 | l.sfne r21,r20 |
---|
59 | l.bf _asm_001_add_ko |
---|
60 | l.nop 0 |
---|
61 | |
---|
62 | _asm_001_add_ok : |
---|
63 | l.addi r11,r0,1 |
---|
64 | _asm_001_add_ko : |
---|
65 | |
---|
66 | /* load context */ |
---|
67 | l.lwz r21, 4(r1) |
---|
68 | l.lwz r20, 0(r1) |
---|
69 | |
---|
70 | l.jr r9 |
---|
71 | l.addi r1,r1,8 |
---|
Note: See
TracBrowser
for help on using the repository browser.