annotate python/ppci/target/arm/arm.brg @ 346:3bb7dcfe5529

expanded arm target
author Windel Bouwman
date Fri, 07 Mar 2014 17:05:32 +0100
parents
children 899ae3aea803
rev   line source
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
1
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
2 from ppci.target.arm.instructions import Add1, Sub1, Ldr1, Ldr3
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
3
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
4 %%
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
5
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
6 %terminal ADDI32 SUBI32 MULI32
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
7 %terminal ORI32 SHLI32
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
8 %terminal CONSTI32 MEMI32 REGI32 CALL
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
9 %terminal MOVI32
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
10
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
11 %%
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
12
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
13 reg: ADDI32(reg, reg) 2 (. d = self.newTmp(); self.emit(Add1, dst=[d], src=[$1, $2]); return d .)
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
14 reg: SUBI32(reg, reg) 2 (. d = self.newTmp(); self.emit(Sub1, dst=[d], src=[$1, $2]); return d .)
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
15 reg: SUBI32(reg, reg) 2 (. d = self.newTmp(); self.emit(Sub1, dst=[d], src=[$1, $2]); return d .)
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
16 reg: MEMI32(ADDI32(reg, cn)) 2 (. d = self.newTmp(); self.emit(Ldr1, dst=[d], src=[$1], others=[$2]); return d .)
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
17
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
18
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
19 cn: CONSTI32 0 (. return $$.value .)
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
20
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
21 reg: CONSTI32 3 (. d = self.newTmp(); ln = self.selector.frame.addConstant($$.value); self.emit(Ldr3, dst=[d], others=[ln]); return d .)
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
22 reg: REGI32 1 (. return $$.value .)