qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Anatol Pomozov <anatol.pomozov@gmail.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, ehabkost@redhat.com, agraf@suse.de,
	pbonzini@redhat.com, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH 4/4] multiboot: make tests work with clang
Date: Fri, 13 Oct 2017 10:01:26 +0200	[thread overview]
Message-ID: <d62aadd6-875e-b269-89f4-c40195d78e2f@redhat.com> (raw)
In-Reply-To: <20171012235439.19457-5-anatol.pomozov@gmail.com>

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

      reply	other threads:[~2017-10-13  8:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 23:54 [Qemu-devel] (no subject) Anatol Pomozov
2017-10-12 23:54 ` [Qemu-devel] [PATCH 1/4] multiboot: Change multiboot_info from array of bytes to a C struct Anatol Pomozov
2018-01-15 14:49   ` Kevin Wolf
2018-01-29 18:21     ` Anatol Pomozov
2018-01-29 20:02       ` Kevin Wolf
2018-02-09 21:48         ` Anatol Pomozov
2018-02-09 21:52           ` Anatol Pomozov
2018-02-12 13:33             ` Kevin Wolf
2018-02-12 13:37           ` Kevin Wolf
2017-10-12 23:54 ` [Qemu-devel] [PATCH 2/4] multiboot: load any machine type of ELF Anatol Pomozov
2017-10-13 19:25   ` Eduardo Habkost
2017-10-13 21:25     ` Anatol Pomozov
2017-10-13 23:21       ` Eduardo Habkost
2017-10-14 13:41         ` Peter Maydell
2017-10-16  8:27           ` Kevin Wolf
2017-10-16 18:38             ` Anatol Pomozov
2018-01-15 14:52               ` Kevin Wolf
2018-01-29 18:35                 ` Anatol Pomozov
2017-10-12 23:54 ` [Qemu-devel] [PATCH 3/4] multiboot: load elf sections and section headers Anatol Pomozov
2017-10-18 17:22   ` Anatol Pomozov
2017-10-19  9:36     ` Kevin Wolf
2017-10-31 18:38       ` Anatol Pomozov
2017-11-17 21:33         ` Anatol Pomozov
2017-11-20 16:45           ` Kevin Wolf
2018-01-15 15:41   ` Kevin Wolf
2018-01-29 19:16     ` Anatol Pomozov
2017-10-12 23:54 ` [Qemu-devel] [PATCH 4/4] multiboot: make tests work with clang Anatol Pomozov
2017-10-13  8:01   ` Thomas Huth [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d62aadd6-875e-b269-89f4-c40195d78e2f@redhat.com \
    --to=thuth@redhat.com \
    --cc=agraf@suse.de \
    --cc=anatol.pomozov@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).