diff options
author | Jakob Kaivo <jkk@ung.org> | 2024-01-31 11:42:22 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2024-01-31 11:42:22 -0500 |
commit | 9d61b058d856e8647848dd1122e4b9ea6c486d3b (patch) | |
tree | 680d10227043ba26f97f850331cd53cbbdeb38ef | |
parent | 335d6ba35bf689dd8e29e71d41b53bf54d22ab7b (diff) |
add GCC SSE hack to sprintf
-rw-r--r-- | src/stdio/_stdio.h | 2 | ||||
-rw-r--r-- | src/stdio/printf.c | 3 | ||||
-rw-r--r-- | src/stdio/sprintf.c | 1 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/stdio/_stdio.h b/src/stdio/_stdio.h index 3c8b7906..516ce659 100644 --- a/src/stdio/_stdio.h +++ b/src/stdio/_stdio.h @@ -20,6 +20,8 @@ #define f_is_open(s) (s && (s->bmode != 0)) +#define GCC_SSE_HACK __attribute__((noinline, target("no-sse"))) + struct __FILE { fpos_t pos; diff --git a/src/stdio/printf.c b/src/stdio/printf.c index 973e5068..03b6df2a 100644 --- a/src/stdio/printf.c +++ b/src/stdio/printf.c @@ -4,8 +4,7 @@ /** write formatted output **/ -/* TODO: FIXME! This is a terrible hack around GCC sucking. */ -__attribute__((noinline, target("no-sse"))) +GCC_SSE_HACK int printf(const char *format, ...) { struct io_options opt = {0}; diff --git a/src/stdio/sprintf.c b/src/stdio/sprintf.c index ab1729b2..5b1ad29f 100644 --- a/src/stdio/sprintf.c +++ b/src/stdio/sprintf.c @@ -4,6 +4,7 @@ /** write formatted output to a string **/ +GCC_SSE_HACK int sprintf(char * restrict s, const char * restrict format, ...) { int ret = 0; |