aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2015-05-28 17:00:08 +0200
committerDrahflow <drahflow@gmx.de>2015-05-28 17:00:08 +0200
commit30d0ce33136b06ba804790951c4a26194aac06fa (patch)
tree19c415ce6cf9dbbfcba55175c941955b3273330f
parent09656b0290c331a497b11cfd1a31976f1debd821 (diff)
Inlined logical or as well
-rw-r--r--compiler/standardClient.ey4
-rw-r--r--elymas/lib/sys/opt.ey46
2 files changed, 44 insertions, 6 deletions
diff --git a/compiler/standardClient.ey b/compiler/standardClient.ey
index dfcdfb6..dcbb0e8 100644
--- a/compiler/standardClient.ey
+++ b/compiler/standardClient.ey
@@ -414,7 +414,7 @@
"exit failed" die
} /exit sys .deff
- { < ==?mode ==?flags ==?fd <
+ { < ==mode ==flags ==fd <
{ flags RWMASK bnot band RDONLY bor =flags } /readonly deff
{ flags RWMASK bnot band WRONLY bor =flags } /writeonly deff
{ flags RWMASK bnot band RDWR bor =flags } /readwrite deff
@@ -433,7 +433,7 @@
} /close deff
{ ==count
fd 0 lt { "file not open" die } rep
- count str .alloc ==?buf
+ count str .alloc ==buf
fd buf count 0 0 0 READ sys .asm .syscall -- _
0 lt { "read failed" die } rep
buf str .inplacePrefix
diff --git a/elymas/lib/sys/opt.ey b/elymas/lib/sys/opt.ey
index 8316e27..ffdae28 100644
--- a/elymas/lib/sys/opt.ey
+++ b/elymas/lib/sys/opt.ey
@@ -200,6 +200,46 @@
@done
]] ] ==:INLINEBLOCKAND
+ [ NATIVENOSCOPE [[
+ /rcx :popqReg
+ /rdx :popqReg
+
+ /rcx /rax :movqRegReg
+ /rdx /rbp :movqRegReg
+
+ 63 /rax :btrqImm8Reg
+ /nonInlineCase :jncLbl8
+ 63 /rbp :btrqImm8Reg
+ /nonInlineCase :jncLbl8
+
+ /rax /rax :testqRegReg
+ /positive :jnzLbl8
+ /rbp /rbp :testqRegReg
+ /positive :jnzLbl8
+
+ /rax /rax :xorqRegReg
+ 63 /rax :btsqImm8Reg
+ /rax :pushqReg
+ /done :jmpLbl8
+
+ @positive
+ 1 /rax :movqImmReg
+ 63 /rax :btsqImm8Reg
+ /rax :pushqReg
+ /done :jmpLbl8
+
+ @nonInlineCase
+ /rdx :pushqReg
+ /rcx :pushqReg
+
+ |and ::rawAddress /rax :movqImmReg
+ /rax :pushqReg
+ "*" | ::rawCodeAddress /rax :movqImmReg
+ /rax :callqReg
+
+ @done
+ ]] ] ==:INLINEBLOCKOR
+
{ ==negatedOpcodeName ==functionName
[ NATIVENOSCOPE [[
/rcx :popqReg
@@ -644,10 +684,8 @@
{ 0 last * PUSH eq }' andif
{
[
- { 1 last * |and ::rawAddress eq }' {
- INLINEBLOCKAND i logic =[]
- [ NOP ] i 1 sub logic =[]
- }
+ { 1 last * |and ::rawAddress eq }' { INLINEBLOCKAND i logic =[] [ NOP ] i 1 sub logic =[] }
+ { 1 last * |or ::rawAddress eq }' { INLINEBLOCKOR i logic =[] [ NOP ] i 1 sub logic =[] }
{ 1 last * |eq ::rawAddress eq }' { INLINEBLOCKEQ i logic =[] [ NOP ] i 1 sub logic =[] }
{ 1 last * |neq ::rawAddress eq }' { INLINEBLOCKNEQ i logic =[] [ NOP ] i 1 sub logic =[] }