diff options
| author | Drahflow <drahflow@gmx.de> | 2015-06-08 00:43:19 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2015-06-08 00:43:19 +0200 |
| commit | c95046ee356f08c80a8ffa05346b55dae8f109cc (patch) | |
| tree | 3d721b28a7c98f3858c1b9126d913cfaf0664839 | |
| parent | 4f22194ed7f14d30a6ceafba6049d689b2d305c7 (diff) | |
Faster memory allocs
| -rw-r--r-- | TODO | 4 | ||||
| -rw-r--r-- | compiler/elymasAsmLib.ey | 18 | ||||
| -rw-r--r-- | compiler/elymasAsmOps.ey | 18 |
3 files changed, 39 insertions, 1 deletions
@@ -1,3 +1,6 @@ +* optimize the free-block scanning loop +* why is vp3view crashing? +* apply the trace extractor to non-tail situations * utf8 * regex substitution * asm-based regex engine @@ -14,6 +17,7 @@ * consider polymorphic call-site caches instead of deffs_t_ / deffs? * eliminate all FIXMEs +** unite the /EQ-LT-OR-GE... things in lib/sys/opt.ey * stack underflow protection * input prompt * better interactive error handling when interpreting from stdin diff --git a/compiler/elymasAsmLib.ey b/compiler/elymasAsmLib.ey index 19513c7..8a0d139 100644 --- a/compiler/elymasAsmLib.ey +++ b/compiler/elymasAsmLib.ey @@ -525,6 +525,20 @@ # rsi > 0 => currently counting block extent of free block @searchFreeBlockStart + /rbx /rax :movqRegReg + 6 /rax :shrqImm8Reg + 3 /rax :shlqImm8Reg + /rax /r8 /rdx :movqMemIndexReg + /rax /r9 /rax :movqMemIndexReg + /rdx :notqReg + /rdx /rax :andqRegReg + /rbx /rcx :movqRegReg + 63 /rcx :andqImm8Reg + /rax :shrqClReg + /rax :shlqClReg + /rax /rax :bsfqRegReg # rax == lowest bit which denotes free block start + /immediateHit :jnzLbl8 + /rbx /r8 :btqRegMem # test block bitmap /nonFreeBlockStartFound :jcLbl8 # block not free /rbx /r9 :btqRegMem # test mark bitmap @@ -539,6 +553,10 @@ /searchFreeBlockStart :jaLbl8 /noFreeBlockAvailable :jmpLbl32 + @immediateHit + %C0 /rbx :andqImm8Reg + /rax /rbx :addqRegReg + @freeBlockStartFound /rbx /rdx :movqRegReg @freeBlockContinues diff --git a/compiler/elymasAsmOps.ey b/compiler/elymasAsmOps.ey index 8a3c2a2..d397f73 100644 --- a/compiler/elymasAsmOps.ey +++ b/compiler/elymasAsmOps.ey @@ -65,7 +65,7 @@ } /modrm00 deff { ==mem ==reg - mem [ /spl /sp /esp /rsp ] eq any { + mem [ /spl /sp /esp /rsp /r12b /r12w /r12d /r12 ] eq any { # actually encode sib with rsp index register (to get it ignored) %40 /sib regno %07 band add @@ -1222,6 +1222,14 @@ memoryAddressingVariants keys { ==variant memoryAddressingVariants variant . =*p } /nop deff { ==reg + reg bit8assert + + reg regno %07 gt reg rexreqbyte or { 0 /none /none reg rex } rep + %F6 + /two reg modrm11 +} /notbReg deff + +{ ==reg reg bit64assert 1 /none /none reg rex @@ -1370,6 +1378,14 @@ memoryAddressingVariants keys { ==variant memoryAddressingVariants variant . =*p reg bit64assert 1 /none /none reg rex + %D1 + /four reg modrm11 +} /shlq1Reg deff + +{ ==reg + reg bit64assert + + 1 /none /none reg rex %D3 /four reg modrm11 } /shlqClReg deff |
