diff options
| author | Eugen Wissner <belka@caraus.de> | 2018-10-02 08:55:29 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2018-10-02 08:55:29 +0200 |
| commit | 772e87739c848a10a014d3118ff14bd0ca48b2d0 (patch) | |
| tree | b567a3c6fb03d45fb7048632bdb66501e42e65d8 /arch/x64/linux/memory/cmp.S | |
| parent | 2a90a812db53728d29a3a821cb292c032437d806 (diff) | |
| download | tanya-772e87739c848a10a014d3118ff14bd0ca48b2d0.tar.gz | |
Replace memory.op.cmp with optimized equal version
Deprecate cmp.
Fix #68.
Diffstat (limited to 'arch/x64/linux/memory/cmp.S')
| -rw-r--r-- | arch/x64/linux/memory/cmp.S | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/arch/x64/linux/memory/cmp.S b/arch/x64/linux/memory/cmp.S deleted file mode 100644 index bd9f02e..0000000 --- a/arch/x64/linux/memory/cmp.S +++ /dev/null @@ -1,67 +0,0 @@ - .text - -/* - * cmpMemory. - * - * rdi - r1 length - * rsi - r1 data. - * rdx - r2 length. - * rcx - r2 data. - */ - .globl _D5tanya6memory2op9cmpMemoryFNaNbNixAvxQdZi - .type _D5tanya6memory2op9cmpMemoryFNaNbNixAvxQdZi, @function -_D5tanya6memory2op9cmpMemoryFNaNbNixAvxQdZi: - // Compare the lengths - cmp %rdx, %rdi - jl less - jg greater - - mov %rcx, %rdi - - // Check if we're aligned - cmp $0x08, %rdx - jc aligned_1 - test $0x07, %edi - jz aligned_8 - - naligned: - cmpsb - jl less - jg greater - - dec %rdx - test $0x07, %edi - jnz naligned - - aligned_8: - mov %rdx, %rcx - shr $0x03, %rcx - - repe cmpsq - jl less - jg greater - - and $0x07, %edx - jz equal - - aligned_1: // Compare the remaining bytes - mov %rdx, %rcx - cmp $0x0, %rcx - - repe cmpsb - jl less - jg greater - - equal: - xor %rax, %rax // Return 0 - jmp end - - greater: - mov $0x01, %rax - jmp end - - less: - mov $-0x01, %rax - - end: - ret |
