annotate python/ppci/target/arm/arm.brg @ 361:614a7f6d4d4d

Fixed test
author Windel Bouwman
date Fri, 14 Mar 2014 16:18:54 +0100
parents b4ac28efcdf4
children c49459768aaa
rev   line source
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
1
359
b4ac28efcdf4 Reorganize files
Windel Bouwman
parents: 357
diff changeset
2 from ppci.target.arm.instructions import Add1, Add2, Sub1, Mul1
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
3 from ppci.target.arm.instructions import Ldr1, Ldr3, Adr
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
4 from ppci.target.arm.instructions import And1, Lsr1, Lsl1, Mov1
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
5
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
6 %%
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
7
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
8 %terminal ADDI32 SUBI32 MULI32 ADR
356
52492b304adf Added newline to print
Windel Bouwman
parents: 354
diff changeset
9 %terminal ORI32 SHLI32 SHRI32 ANDI32
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
10 %terminal CONSTI32 CONSTDATA MEMI32 REGI32 CALL
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
11 %terminal MOVI32
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
12
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
13 %%
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
14
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
15 reg: ADDI32(reg, reg) 2 'd = self.newTmp(); self.emit(Add1, dst=[d], src=[c0, c1]); return d'
359
b4ac28efcdf4 Reorganize files
Windel Bouwman
parents: 357
diff changeset
16 reg: ADDI32(reg, cn) 2 'return tree.children[1].value < 256' 'd = self.newTmp(); self.emit(Add2, dst=[d], src=[c0], others=[c1]); return d'
b4ac28efcdf4 Reorganize files
Windel Bouwman
parents: 357
diff changeset
17 reg: ADDI32(cn, reg) 2 'return tree.children[0].value < 256' 'd = self.newTmp(); self.emit(Add2, dst=[d], src=[c1], others=[c0]); return d'
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
18 reg: SUBI32(reg, reg) 2 'd = self.newTmp(); self.emit(Sub1, dst=[d], src=[c0, c1]); return d'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
19 reg: MULI32(reg, reg) 2 'd = self.newTmp(); self.emit(Mul1, dst=[d], src=[c0, c1]); return d'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
20 reg: ANDI32(reg, reg) 2 'd = self.newTmp(); self.emit(And1, dst=[d], src=[c0, c1]); return d'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
21 reg: SHRI32(reg, reg) 2 'd = self.newTmp(); self.emit(Lsr1, dst=[d], src=[c0, c1]); return d'
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
22
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
23 reg: MEMI32(ADDI32(reg, cn)) 2 'd = self.newTmp(); self.emit(Ldr1, dst=[d], src=[c0], others=[c1]); return d'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
24 reg: MEMI32(reg) 2 'd = self.newTmp(); self.emit(Ldr1, dst=[d], src=[c0], others=[0]); return d'
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
25
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
26
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
27 cn: CONSTI32 0 'return tree.value'
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
28
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
29 reg: CONSTI32 6 'd = self.newTmp(); ln = self.selector.frame.add_constant(tree.value); self.emit(Ldr3, dst=[d], others=[ln]); return d'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
30
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
31 reg: CONSTI32 2 'return (type(tree.value) is int) and (tree.value < 256)' 'd = self.newTmp(); self.emit(Mov1, dst=[d], others=[tree.value]); return d'
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
32
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
33 reg: ADR(CONSTDATA) 2 'd = self.newTmp(); ln = self.selector.frame.add_constant(tree.children[0].value); self.emit(Adr, dst=[d], others=[ln]); return d'
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
34
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
35 reg: REGI32 1 'return tree.value'
352
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents: 346
diff changeset
36
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
37 reg: CALL 1 'return self.selector.munchCall(tree.value)'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 356
diff changeset
38