aboutsummaryrefslogtreecommitdiff
path: root/elymas
diff options
context:
space:
mode:
Diffstat (limited to 'elymas')
-rw-r--r--elymas/lib/sys/opt.ey67
1 files changed, 67 insertions, 0 deletions
diff --git a/elymas/lib/sys/opt.ey b/elymas/lib/sys/opt.ey
index ca3f37a..01cf0ff 100644
--- a/elymas/lib/sys/opt.ey
+++ b/elymas/lib/sys/opt.ey
@@ -6,6 +6,7 @@
> /ops sys .asm .defv
1 ==ARRAYMARKER # FIXME unify with elymasGlobal.ey
+ 3 ==POSITIONMARKER # FIXME unify with elymasGlobal.ey
4 ==INITIALSCOPESIZE # FIXME take this from the compiler directory
sys .asm .ops ==:sysasmops
@@ -345,6 +346,7 @@
/quoted /range "''" ".?" ".?'" ".|" ";"
/keys /dom /add /and /band /bor /bxor /div /eq /ge /gt /le /lt
/mod /mul /neq /or /sub /udiv /umod /xor /bnot /neg /not
+ "," ",--" "--," "_," ",_" ",---"
] { | ::rawCodeAddress } [ 0 ] [ 0 ] '' * ==:SCOPEIGNORANTFUNCTIONS
[
"|" "=" /def
@@ -1981,6 +1983,71 @@
ARRAYMARKER :pushqImm32
] ] =entry
}
+ { action CALL eq { 1 entry * "," | ::rawCodeAddress eq }' andif }' {
+ [ NATIVENOSCOPE [
+ POSITIONMARKER :pushqImm32
+ ] ] =entry
+ }
+ { action CALL eq { 1 entry * ",--" | ::rawCodeAddress eq }' andif }' {
+ [ NATIVENOSCOPE [[
+ /rsp /rsi :movqRegReg
+ POSITIONMARKER /rax :movqImmReg
+ /rdx :popqReg
+ /rax /rdx :cmpqRegReg
+ /done :jzLbl8
+ @loop
+ 8 /rsi :addqImm8Reg
+ /rdx /rsi :xchgqRegMem
+ /rax /rdx :cmpqRegReg
+ /loop :jnzLbl8
+ @done
+ ]] ] =entry
+ }
+ { action CALL eq { 1 entry * "--," | ::rawCodeAddress eq }' andif }' {
+ [ NATIVENOSCOPE [[
+ /rsp /rsi :movqRegReg
+ POSITIONMARKER /rax :movqImmReg
+ /rdx :popqReg
+ /rax /rdx :cmpqRegReg
+ /done :jzLbl8
+ @loop
+ 8 /rsi :addqImm8Reg
+ /rdx /rsi :xchgqRegMem
+ /rax /rdx :cmpqRegReg
+ /loop :jnzLbl8
+ @done
+ /rdx 8 /rsi :movqRegMemDisp8
+ ]] ] =entry
+ }
+ { action CALL eq { 1 entry * "_," | ::rawCodeAddress eq }' andif }' {
+ [ NATIVENOSCOPE [[
+ /rsp /rdi :movqRegReg
+ POSITIONMARKER /rax :movqImmReg
+ /rcx /rcx :xorqRegReg
+ /rcx :decqReg
+ :repnz :scasq
+ /rdi :pushqMem
+ ]] ] =entry
+ }
+ { action CALL eq { 1 entry * ",_" | ::rawCodeAddress eq }' andif }' {
+ [ NATIVENOSCOPE [[
+ /rsp /rdi :movqRegReg
+ POSITIONMARKER /rax :movqImmReg
+ /rcx /rcx :xorqRegReg
+ /rcx :decqReg
+ :repnz :scasq
+ 16 neg /rdi :pushqMemDisp8
+ ]] ] =entry
+ }
+ { action CALL eq { 1 entry * ",---" | ::rawCodeAddress eq }' andif }' {
+ [ NATIVENOSCOPE [[
+ POSITIONMARKER /rax :movqImmReg
+ @loop
+ /rdx :popqReg
+ /rax /rdx :cmpqRegReg
+ /loop :jnzLbl8
+ ]] ] =entry
+ }
] conds
last