diff options
| author | Drahflow <drahflow@gmx.de> | 2013-09-29 11:52:35 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2013-09-29 11:52:35 +0200 |
| commit | 718e518bce9d32327a3ce0c52d38214986df4646 (patch) | |
| tree | 6b2c2ca8d5ee27ec355ff3bf5928be765f2877d8 | |
| parent | be69490cb101c8cc8093bd0562eca3197269a2cf (diff) | |
Source of boxed zeros eliminated
| -rw-r--r-- | compiler/elymasLexer.ey | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/compiler/elymasLexer.ey b/compiler/elymasLexer.ey index 1ca264b..2929285 100644 --- a/compiler/elymasLexer.ey +++ b/compiler/elymasLexer.ey @@ -5,21 +5,30 @@ "%" _ : -01 deff { .value elymas .base10decode ==v - [ - # allocate int - ::internalAllocateInteger /rax :movqImmReg - /rax :callqReg - - # push int address on program stack - /rax :pushqReg - - # type zero does not need to be changed - - # load value - 8 /rax :addqImm8Reg - v /rdx :movqImmReg - /rdx /rax :movqRegMem - ] :execute + v 4294967296 lt { + [ + # load value + v /rdx :movqImmReg + 63 /rdx :btsqImm8Reg + /rdx :pushqReg + ] :execute + } { + [ + # allocate int + ::internalAllocateInteger /rax :movqImmReg + /rax :callqReg + + # push int address on program stack + /rax :pushqReg + + # type zero does not need to be changed + + # load value + 8 /rax :addqImm8Reg + v /rdx :movqImmReg + /rdx /rax :movqRegMem + ] :execute + } ? * } /TOKINT { .value ::constStringCode :execute } /TOKSTR |
