qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@linux.ibm.com>
To: matheus.ferst@eldorado.org.br, qemu-devel@nongnu.org
Cc: Matheus Ferst <matheus.ferst@eldorado.org.br>,
	gustavo.romero@protonmail.com, f4bug@amsat.org,
	qemu-ppc@nongnu.org, bruno.larsen@eldorado.org.br,
	alex.bennee@linaro.org, david@gibson.dropbear.id.au
Subject: Re: [PATCH v2 2/2] tests/tcg/ppc64le: tests for brh/brw/brd
Date: Fri, 23 Apr 2021 09:56:35 -0300	[thread overview]
Message-ID: <877dktf9bw.fsf@linux.ibm.com> (raw)
In-Reply-To: <20210422112754.1099177-3-matheus.ferst@eldorado.org.br>

matheus.ferst@eldorado.org.br writes:

> From: Matheus Ferst <matheus.ferst@eldorado.org.br>
>
> Tests for Byte-Reverse Halfword, Word and Doubleword
>
> Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>

Tested in x86_64 with the new container image.

Tested-by: Fabiano Rosas <farosas@linux.ibm.com>

> ---
>  tests/tcg/ppc64/Makefile.target   |  7 +++++++
>  tests/tcg/ppc64le/Makefile.target |  7 +++++++
>  tests/tcg/ppc64le/byte_reverse.c  | 21 +++++++++++++++++++++
>  3 files changed, 35 insertions(+)
>  create mode 100644 tests/tcg/ppc64le/byte_reverse.c
>
> diff --git a/tests/tcg/ppc64/Makefile.target b/tests/tcg/ppc64/Makefile.target
> index 0c6a4585fc..55c690c8ad 100644
> --- a/tests/tcg/ppc64/Makefile.target
> +++ b/tests/tcg/ppc64/Makefile.target
> @@ -10,4 +10,11 @@ PPC64_TESTS=bcdsub
>  endif
>  bcdsub: CFLAGS += -mpower8-vector
>  
> +ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),)
> +POWER10_TESTS=byte_reverse
> +RUN_POWER10_TESTS=$(patsubst %, run-%, $(POWER10_TESTS))
> +$(RUN_POWER10_TESTS): QEMU_OPTS+=-cpu POWER10
> +PPC64_TESTS += $(POWER10_TESTS)
> +endif
> +
>  TESTS += $(PPC64_TESTS)
> diff --git a/tests/tcg/ppc64le/Makefile.target b/tests/tcg/ppc64le/Makefile.target
> index 1acfcff94a..517d290b1a 100644
> --- a/tests/tcg/ppc64le/Makefile.target
> +++ b/tests/tcg/ppc64le/Makefile.target
> @@ -9,4 +9,11 @@ PPC64LE_TESTS=bcdsub
>  endif
>  bcdsub: CFLAGS += -mpower8-vector
>  
> +ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),)
> +POWER10_TESTS=byte_reverse
> +RUN_POWER10_TESTS=$(patsubst %, run-%, $(POWER10_TESTS))
> +$(RUN_POWER10_TESTS): QEMU_OPTS+=-cpu POWER10
> +PPC64LE_TESTS += $(POWER10_TESTS)
> +endif
> +
>  TESTS += $(PPC64LE_TESTS)
> diff --git a/tests/tcg/ppc64le/byte_reverse.c b/tests/tcg/ppc64le/byte_reverse.c
> new file mode 100644
> index 0000000000..53b76fc2e2
> --- /dev/null
> +++ b/tests/tcg/ppc64le/byte_reverse.c
> @@ -0,0 +1,21 @@
> +#include <assert.h>
> +
> +int main(void)
> +{
> +    unsigned long var;
> +
> +    var = 0xFEDCBA9876543210;
> +    asm("brh %0, %0" : "+r"(var));
> +    assert(var == 0xDCFE98BA54761032);
> +
> +    var = 0xFEDCBA9876543210;
> +    asm("brw %0, %0" : "+r"(var));
> +    assert(var == 0x98BADCFE10325476);
> +
> +    var = 0xFEDCBA9876543210;
> +    asm("brd %0, %0" : "+r"(var));
> +    assert(var == 0x1032547698BADCFE);
> +
> +    return 0;
> +}
> +


      reply	other threads:[~2021-04-23 12:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 11:27 [PATCH 0/2] tests/docker: tests/tcg/ppc64le: Newer toolchain to build tests for PowerISA v3.1 instructions matheus.ferst
2021-04-22 11:27 ` [PATCH v2 1/2] tests/docker: gcc-10 based images for ppc64{, le} tests matheus.ferst
2021-04-23 12:54   ` Fabiano Rosas
2021-04-23 13:16     ` Matheus K. Ferst
2021-04-22 11:27 ` [PATCH v2 2/2] tests/tcg/ppc64le: tests for brh/brw/brd matheus.ferst
2021-04-23 12:56   ` Fabiano Rosas [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=877dktf9bw.fsf@linux.ibm.com \
    --to=farosas@linux.ibm.com \
    --cc=alex.bennee@linaro.org \
    --cc=bruno.larsen@eldorado.org.br \
    --cc=david@gibson.dropbear.id.au \
    --cc=f4bug@amsat.org \
    --cc=gustavo.romero@protonmail.com \
    --cc=matheus.ferst@eldorado.org.br \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /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).