diff options
Diffstat (limited to 'rgo')
-rw-r--r-- | rgo/Makefile | 38 | ||||
-rw-r--r-- | rgo/include/rgo.h | 8 | ||||
-rw-r--r-- | rgo/src/memeq.S | 20 |
3 files changed, 14 insertions, 52 deletions
diff --git a/rgo/Makefile b/rgo/Makefile deleted file mode 100644 index 4118fe4..0000000 --- a/rgo/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -SRCS = \ - src/fndbyte.S \ - src/fndchr.S \ - src/memcpy.S \ - src/memdup.c \ - src/memeq.S \ - src/memfill.S \ - src/strdup.c \ - src/streq.S \ - src/strfill.c \ - src/strcpy.S \ - src/strlen.S - -OBJS := $(SRCS:.S=.o) -OBJS := $(OBJS:.c=.o) -LIB := librgo.a - -ASFLAGS = \ - -Iinclude \ - -g \ - -march=native - -CFLAGS = \ - -Iinclude \ - -O3 \ - -g \ - -march=native - -.PHONY: clean purge - -$(LIB): $(OBJS) - ar r $@ $^ - -clean: - rm -fr $(OBJS) - -purge: - rm -fr $(LIB) $(OBJS) diff --git a/rgo/include/rgo.h b/rgo/include/rgo.h index f575436..f0f8d87 100644 --- a/rgo/include/rgo.h +++ b/rgo/include/rgo.h @@ -11,14 +11,14 @@ */ #if !defined(__x86_64__) && !defined(__i386__) -#error Unsupported machine architecture! Supported: AMD64, IA-32; +#error Unsupported machine architecture! Supported: Aarch64, AMD64, IA-32; #endif #if !defined(rgo_ver) #if defined(__ASSEMBLER__) -#define rgo_ver $0x3 +#define rgo_ver $0x4 #else -#define rgo_ver (0x3) +#define rgo_ver (0x4) #endif #if defined(__ASSEMBLER__) @@ -60,4 +60,4 @@ template<typename T> [[gnu::alloc_size(0x2),gnu::hot,gnu::malloc]] auto rgo_memd #endif #endif -#endif
\ No newline at end of file +#endif diff --git a/rgo/src/memeq.S b/rgo/src/memeq.S index d106804..9175630 100644 --- a/rgo/src/memeq.S +++ b/rgo/src/memeq.S @@ -31,9 +31,9 @@ rgo_memeq: pushl %ebx /* ebx/esi: Current right element. */ pushl %esi -.wrdeq: +.wrdcmp: cmpl $0x4,%ecx - jl .byteeq + jl .bytecmp movl (%eax),%ebx movl (%edx),%esi cmpl %ebx,%esi @@ -41,8 +41,8 @@ rgo_memeq: addl $0x4,%eax addl $0x4,%edx subl $0x4,%ecx - jmp .wrdeq -.byteeq: + jmp .wrdcmp +.bytecmp: testl %ecx,%ecx jne .eq /* If we have reached the final element, all previous elements have compared equal, and the memory sequences are equal. */ movb (%eax),%bl @@ -52,7 +52,7 @@ rgo_memeq: incl %eax incl %edx decl %ecx - jmp .byteeq + jmp .bytecmp .eq: popl %ebx popl %esi @@ -69,9 +69,9 @@ rgo_memeq: /* rdx: Address of the current right element. */ /* rax: Current left element. */ /* rcx: Current right element. */ -.wrdeq: +.wrdcmp: cmpq $0x8,%rsi - jl .byteeq + jl .bytecmp movq (%rdi),%rax movq (%rdx),%rcx cmpq %rax,%rcx @@ -79,8 +79,8 @@ rgo_memeq: addq $0x8,%rdi addq $0x8,%rdx subq $0x8,%rsi - jmp .wrdeq -.byteeq: + jmp .wrdcmp +.bytecmp: testq %rsi,%rsi jne .eq /* If we have reached the final element, all previous elements have compared equal, and the memory sequences are equal. */ movb (%rdi),%al @@ -90,7 +90,7 @@ rgo_memeq: incq %rdi incq %rdx decq %rsi - jmp .byteeq + jmp .bytecmp .eq: movb $0x1,%al ret |