annotate python/ppci/target/thumb/arm.brg @ 385:d056b552d3f4

Made better use of layout
author Windel Bouwman
date Thu, 01 May 2014 14:03:12 +0200
parents 577ed7fb3fe4
children
rev   line source
322
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents:
diff changeset
1
342
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
2 from ppci.target.thumb.instructions import Orr, Lsl, Str2, Ldr2, Ldr3
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
3 from ppci.target.thumb.instructions import B, Bl, Bgt, Blt, Beq, Bne
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
4 from ppci.target.thumb.instructions import Mov2, Mov3, Sub3
86b02c98a717 Moved target directory
Windel Bouwman
parents: 341
diff changeset
5 from ppci.target.thumb.instructions import Add3, Sub, Cmp, Sub2, Add2, Mul
322
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents:
diff changeset
6
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents:
diff changeset
7 %%
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents:
diff changeset
8
323
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 322
diff changeset
9 %terminal ADDI32 SUBI32 MULI32
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 322
diff changeset
10 %terminal ORI32 SHLI32
322
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents:
diff changeset
11 %terminal CONSTI32 MEMI32 REGI32 CALL
323
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 322
diff changeset
12 %terminal MOVI32
367
577ed7fb3fe4 Try to make thumb work again
Windel Bouwman
parents: 357
diff changeset
13 %terminal GLOBALADDRESS CONSTDATA
322
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents:
diff changeset
14
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents:
diff changeset
15 %%
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents:
diff changeset
16
323
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 322
diff changeset
17
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 342
diff changeset
18 reg: ADDI32(reg, reg) 2 'd = self.newTmp(); self.emit(Add3, dst=[d], src=[c0, c1]); return d'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 342
diff changeset
19 reg: SUBI32(reg, reg) 2 'd = self.newTmp(); self.emit(Sub3, dst=[d], src=[c0, c1]); return d'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 342
diff changeset
20 reg: ORI32(reg, reg) 2 'd = self.newTmp(); self.selector.move(d, c0); self.emit(Orr, dst=[], src=[d, c1]); return d'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 342
diff changeset
21 reg: SHLI32(reg, reg) 2 'd = self.newTmp(); self.selector.move(d, c0); self.emit(Lsl, dst=[], src=[d, c1]); return d'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 342
diff changeset
22 reg: MULI32(reg, reg) 2 'd = self.newTmp(); self.selector.move(d, c0); self.emit(Mul, dst=[d], src=[c1, d]); return d'
322
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents:
diff changeset
23
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 342
diff changeset
24 reg: CONSTI32 3 'd = self.newTmp(); ln = self.selector.frame.addConstant(tree.value); self.emit(Ldr3, dst=[d], others=[ln]); return d'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 342
diff changeset
25 reg: MEMI32(reg) 4 'd = self.newTmp(); self.emit(Ldr2, dst=[d], src=[c0], others=[0]); return d'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 342
diff changeset
26 reg: REGI32 1 'return tree.value'
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 342
diff changeset
27 reg: CALL 1 'return self.selector.munchCall(tree.value)'
322
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents:
diff changeset
28
44f336460c2a Half of use of burg spec for arm
Windel Bouwman
parents:
diff changeset
29
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 342
diff changeset
30 stmt: MOVI32(MEMI32(addr), reg) 3 'self.emit(Str2, src=[c0, c1])'
323
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 322
diff changeset
31
357
818be710e13d Added acceptance function to burg
Windel Bouwman
parents: 342
diff changeset
32 addr: reg 0 ''