On 13.10.2017 01:54, Anatol Pomozov wrote:
> * clang 3.8 enables SSE even for 32bit code. Generate code for pentium
> CPU to make sure no new instructions are used.
> * add memset() implementation. Clang implements array zeroing in
> print_num() via memset() function call.
> ---
> tests/multiboot/Makefile | 2 +-
> tests/multiboot/libc.c | 9 +++++++++
> tests/multiboot/libc.h | 2 ++
> tests/multiboot/run_test.sh | 1 +
> 4 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/tests/multiboot/Makefile b/tests/multiboot/Makefile
> index b6a5056347..79dfe85afc 100644
> --- a/tests/multiboot/Makefile
> +++ b/tests/multiboot/Makefile
> @@ -1,5 +1,5 @@
> CC=gcc
> -CCFLAGS=-m32 -Wall -Wextra -Werror -fno-stack-protector -nostdinc
> -fno-builtin
> +CCFLAGS=-m32 -Wall -Wextra -Werror -fno-stack-protector -nostdinc
> -fno-builtin -march=pentium
> ASFLAGS=-m32
>
> LD=ld
> diff --git a/tests/multiboot/libc.c b/tests/multiboot/libc.c
> index 6df9bda96d..512fccd7fa 100644
> --- a/tests/multiboot/libc.c
> +++ b/tests/multiboot/libc.c
> @@ -33,6 +33,15 @@ void* memcpy(void *dest, const void *src, int n)
>
> return dest;
> }
> +void *memset(void *s, int c, size_t n)
Add an empty line before the new function?
> +{
> + size_t i;
> + char *d = s;
> + for (i = 0; i < n; i++) {
while (n-- > 0) ?
... that way you don't need the i variable.
> + *d++ = c;
> + }
> + return s;
> +}
Thomas