diff options
| author | Drahflow <drahflow@gmx.de> | 2013-09-26 15:05:46 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2013-09-26 15:05:46 +0200 |
| commit | fdc87623e8e0394e5b9ffe6019489b60f5c98561 (patch) | |
| tree | aad0b8d2ca76e1218bf889b9638431a6e49c59bc /compiler/elymasAsmLib.ey | |
| parent | f56f0db5a95ee732925ab380c4fca0c0297116ae (diff) | |
Further performance improvements
Diffstat (limited to 'compiler/elymasAsmLib.ey')
| -rw-r--r-- | compiler/elymasAsmLib.ey | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/compiler/elymasAsmLib.ey b/compiler/elymasAsmLib.ey index 1fac364..8d940bb 100644 --- a/compiler/elymasAsmLib.ey +++ b/compiler/elymasAsmLib.ey @@ -123,24 +123,6 @@ # internal functions, ABI follows SysV standards - # compare two strings - # rdi -> address of first string - # rsi -> address of second string - # rax <- 1 if both strings are equal, 0 otherwise - [ - /rax /rax :xorqRegReg - :cmpsq # ignore memory length header - :cmpsq # ignore hash - /rsi /rdx :movqMemReg # load exact length - :cmpsq # same exact length - /fail :jnzLbl8 - /rdx /rcx :movqRegReg - :repz :cmpsb - /fail :jnzLbl8 - /rax :incqReg - @fail - ] :labelResolve /internalStringEqualsCode defv - < # dump string to stderr for internal error reporting # rdi -> address of string on heap @@ -158,7 +140,17 @@ # rsi -> address of second string # rax <- 1 if both strings are equal, 0 otherwise [ - internalStringEqualsCode _ len dearray + /rax /rax :xorqRegReg + :cmpsq # ignore memory length header + :cmpsq # ignore hash + /rsi /rdx :movqMemReg # load exact length + :cmpsq # same exact length + /fail :jnzLbl8 + /rdx /rcx :movqRegReg + :repz :cmpsb + /fail :jnzLbl8 + /rax :incqReg + @fail :retn ] /internalStringEquals defv > { defv }' allocateOffsetStruct |
