annotate python/ppci/target/arm/arm.brg @ 354:5477e499b039

Added some sort of string functionality
author Windel Bouwman
date Thu, 13 Mar 2014 18:59:06 +0100
parents b8ad45b3a573
children 52492b304adf
rev   line source
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
1
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
2 from ppci.target.arm.instructions import Add1, Sub1, Mul1
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
3 from ppci.target.arm.instructions import Ldr1, Ldr3, Adr
346
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
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
7 %terminal ADDI32 SUBI32 MULI32 ADR
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
8 %terminal ORI32 SHLI32
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
9 %terminal CONSTI32 CONSTDATA MEMI32 REGI32 CALL
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
10 %terminal MOVI32
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
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
14 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
15 reg: SUBI32(reg, reg) 2 (. d = self.newTmp(); self.emit(Sub1, dst=[d], src=[$1, $2]); return d .)
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
16 reg: MULI32(reg, reg) 2 (. d = self.newTmp(); self.emit(Mul1, dst=[d], src=[$1, $2]); return d .)
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
17
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
18 reg: MEMI32(ADDI32(reg, cn)) 2 (. d = self.newTmp(); self.emit(Ldr1, dst=[d], src=[$1], others=[$2]); return d .)
352
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents: 346
diff changeset
19 reg: MEMI32(reg) 2 (. d = self.newTmp(); self.emit(Ldr1, dst=[d], src=[$1], others=[0]); return d .)
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
20
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
21
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
22 cn: CONSTI32 0 (. return $$.value .)
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
23
353
b8ad45b3a573 Started with strings
Windel Bouwman
parents: 352
diff changeset
24 reg: CONSTI32 3 (. d = self.newTmp(); ln = self.selector.frame.add_constant($$.value); self.emit(Ldr3, dst=[d], others=[ln]); return d .)
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
25
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
26 reg: ADR(CONSTDATA) 2 (. d = self.newTmp(); ln = self.selector.frame.add_constant($$.children[0].value); self.emit(Adr, dst=[d], others=[ln]); return d .)
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
27
346
3bb7dcfe5529 expanded arm target
Windel Bouwman
parents:
diff changeset
28 reg: REGI32 1 (. return $$.value .)
352
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents: 346
diff changeset
29
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents: 346
diff changeset
30 reg: CALL 1 (. return self.selector.munchCall($$.value) .)