From nobody Mon Feb 9 13:13:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1618882644; cv=none; d=zohomail.com; s=zohoarc; b=b7l0qjeO7NEmn56kULe1OtUsqmY16BrM8tTavY7D4+2naHwx7IWefnODHPlD1nI9MAhSx42GEBiwmlhPI6LjYZZeAI3lC/TZhpuI99Gytep2y0JctMvOqHORfQ8EOZ3Q0Pq+MoswJet1ni3z4jwtJeMgp/6dn9VUJ27T6eK/USM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618882644; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ErgpH87R3sBNpOZzvyhfwNLk2aaYz/LY4kYOw6EZ+60=; b=EvidcaKfn02kgRAWRlF1cH9nyra5+W+kctTDbSTegj1egOhr2kJJlip4qUiqfuYbeAS4J7wMNwCVLlSK+9cV5OUSnAE9u1R1j9D3zLaim0mco8uMcZUpW1wGEMY/oewO13qAP6YZN3BhxnmsVIE3F6R8yYmbTDIZgx82q1pBXeU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1618882643992719.4725806104777; Mon, 19 Apr 2021 18:37:23 -0700 (PDT) Received: from localhost ([::1]:44160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYfKM-0006Je-Im for importer@patchew.org; Mon, 19 Apr 2021 21:37:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYfGV-0004Ui-C9; Mon, 19 Apr 2021 21:33:23 -0400 Received: from [201.28.113.2] (port=21420 helo=outlook.eldorado.org.br) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYfGP-0007Au-Lf; Mon, 19 Apr 2021 21:33:22 -0400 Received: from power9a ([10.10.71.235]) by outlook.eldorado.org.br with Microsoft SMTPSVC(8.5.9600.16384); Mon, 19 Apr 2021 22:33:12 -0300 Received: from eldorado.org.br (unknown [10.10.70.45]) by power9a (Postfix) with ESMTP id 12510801107; Mon, 19 Apr 2021 22:33:12 -0300 (-03) From: matheus.ferst@eldorado.org.br To: qemu-devel@nongnu.org Subject: [PATCH 1/2] tests/docker: gcc-10 based images for ppc64{,le} tests Date: Mon, 19 Apr 2021 22:33:07 -0300 Message-Id: <20210420013308.813323-2-matheus.ferst@eldorado.org.br> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420013308.813323-1-matheus.ferst@eldorado.org.br> References: <20210420013308.813323-1-matheus.ferst@eldorado.org.br> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 20 Apr 2021 01:33:12.0446 (UTC) FILETIME=[2097C9E0:01D73585] X-Host-Lookup-Failed: Reverse DNS lookup failed for 201.28.113.2 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=201.28.113.2; envelope-from=matheus.ferst@eldorado.org.br; helo=outlook.eldorado.org.br X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matheus Ferst , 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Matheus Ferst A newer compiler is needed to build tests for Power10 instructions. As done for arm64 on c729a99d2701, a new '-test-cross' image is created for ppc64 and ppc64le. As done on 936fda4d771f, a test for compiler support is added to verify that the toolchain in use has '-mpower10'. Signed-off-by: Matheus Ferst --- tests/docker/Makefile.include | 2 ++ .../debian-powerpc-test-cross.docker | 17 +++++++++++++++++ tests/tcg/configure.sh | 12 ++++++++---- 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 tests/docker/dockerfiles/debian-powerpc-test-cross.dock= er diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 9f464cb92c..f1dbcc639f 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -152,10 +152,12 @@ docker-image-debian-sparc64-cross: docker-image-debia= n10 docker-image-debian-tricore-cross: docker-image-debian10 docker-image-debian-all-test-cross: docker-image-debian10 docker-image-debian-arm64-test-cross: docker-image-debian11 +docker-image-debian-power-test-cross: docker-image-debian11 =20 # These images may be good enough for building tests but not for test buil= ds DOCKER_PARTIAL_IMAGES +=3D debian-alpha-cross DOCKER_PARTIAL_IMAGES +=3D debian-arm64-test-cross +DOCKER_PARTIAL_IMAGES +=3D debian-power-test-cross DOCKER_PARTIAL_IMAGES +=3D debian-hppa-cross DOCKER_PARTIAL_IMAGES +=3D debian-m68k-cross debian-mips64-cross DOCKER_PARTIAL_IMAGES +=3D debian-powerpc-cross debian-ppc64-cross diff --git a/tests/docker/dockerfiles/debian-powerpc-test-cross.docker b/te= sts/docker/dockerfiles/debian-powerpc-test-cross.docker new file mode 100644 index 0000000000..36b336f709 --- /dev/null +++ b/tests/docker/dockerfiles/debian-powerpc-test-cross.docker @@ -0,0 +1,17 @@ +# +# Docker powerpc/ppc64/ppc64le cross-compiler target +# +# This docker target builds on the debian Bullseye base image. +# +FROM qemu/debian11 + +RUN apt update && \ + DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ + apt install -y --no-install-recommends \ + gcc-powerpc-linux-gnu \ + libc6-dev-powerpc-cross \ + gcc-10-powerpc64-linux-gnu \ + libc6-dev-ppc64-cross \ + gcc-10-powerpc64le-linux-gnu \ + libc6-dev-ppc64el-cross + diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index fa1a4261a4..a0be066499 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -170,13 +170,13 @@ for target in $target_list; do ;; ppc64-*) container_hosts=3Dx86_64 - container_image=3Ddebian-ppc64-cross - container_cross_cc=3Dpowerpc64-linux-gnu-gcc + container_image=3Ddebian-powerpc-test-cross + container_cross_cc=3Dpowerpc64-linux-gnu-gcc-10 ;; ppc64le-*) container_hosts=3Dx86_64 - container_image=3Ddebian-ppc64el-cross - container_cross_cc=3Dpowerpc64le-linux-gnu-gcc + container_image=3Ddebian-powerpc-test-cross + container_cross_cc=3Dpowerpc64le-linux-gnu-gcc-10 ;; riscv64-*) container_hosts=3Dx86_64 @@ -280,6 +280,10 @@ for target in $target_list; do -mpower8-vector -o $TMPE $TMPC; then echo "CROSS_CC_HAS_POWER8_VECTOR=3Dy" >> $config_target_mak fi + if do_compiler "$target_compiler" $target_compiler_cflags \ + -mpower10 -o $TMPE $TMPC; then + echo "CROSS_CC_HAS_POWER10=3Dy" >> $config_target_mak + fi ;; i386-linux-user) if do_compiler "$target_compiler" $target_compiler_cflags \ --=20 2.25.1 From nobody Mon Feb 9 13:13:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1618882939; cv=none; d=zohomail.com; s=zohoarc; b=JyitEgRhKMYXoL/DgO3KwrwEx8EUI9cPLdS4Yur6Il40RYeeRf5bQcPiXM5i6ZboK78FntGvSBsJxzXxXgXnFqpnmYYV/xu/h6zvQDjj+q19g6/d18NJ4vDAAh1R8NCm74+m/YQ66oOY0ZjJR6JprYhQpM7wnDbOvKrubNiSxyQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618882939; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=T8Pgc4lLhPi6f9gtjrA+L3IreYWjMWaQ99mJ0aWkd0E=; b=VRg6dSAdcisk5HJPSBGbU3ed+n/Q1x67g1HnIYogqFATexCYgJEN9esf0n9rJPw2FqKMvPmHChgszM17iW7ozDrU4OKbaenlrmUIB72FmBWPAroh8vVc05nuOIa0TlBVUiVuj3yv2h3PXNc65ZXtDS+G7v71D6m+GbNRoVBsEGI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1618882939429745.8181148137127; Mon, 19 Apr 2021 18:42:19 -0700 (PDT) Received: from localhost ([::1]:48082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYfP8-0008Tk-5e for importer@patchew.org; Mon, 19 Apr 2021 21:42:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYfGY-0004X8-92; Mon, 19 Apr 2021 21:33:26 -0400 Received: from [201.28.113.2] (port=21420 helo=outlook.eldorado.org.br) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYfGW-0007Au-OR; Mon, 19 Apr 2021 21:33:26 -0400 Received: from power9a ([10.10.71.235]) by outlook.eldorado.org.br with Microsoft SMTPSVC(8.5.9600.16384); Mon, 19 Apr 2021 22:33:13 -0300 Received: from eldorado.org.br (unknown [10.10.70.45]) by power9a (Postfix) with ESMTP id 0DEAF801107; Mon, 19 Apr 2021 22:33:13 -0300 (-03) From: matheus.ferst@eldorado.org.br To: qemu-devel@nongnu.org Subject: [PATCH 2/2] tests/tcg/ppc64le: tests for brh/brw/brd Date: Mon, 19 Apr 2021 22:33:08 -0300 Message-Id: <20210420013308.813323-3-matheus.ferst@eldorado.org.br> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420013308.813323-1-matheus.ferst@eldorado.org.br> References: <20210420013308.813323-1-matheus.ferst@eldorado.org.br> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 20 Apr 2021 01:33:13.0399 (UTC) FILETIME=[21293470:01D73585] X-Host-Lookup-Failed: Reverse DNS lookup failed for 201.28.113.2 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=201.28.113.2; envelope-from=matheus.ferst@eldorado.org.br; helo=outlook.eldorado.org.br X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matheus Ferst , 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Matheus Ferst Tests for Byte-Reverse Halfword, Word and Doubleword Signed-off-by: Matheus Ferst --- tests/tcg/ppc64/Makefile.target | 7 +++++++ tests/tcg/ppc64le/Makefile.target | 7 +++++++ tests/tcg/ppc64le/byte_reverse.c | 22 ++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 tests/tcg/ppc64le/byte_reverse.c diff --git a/tests/tcg/ppc64/Makefile.target b/tests/tcg/ppc64/Makefile.tar= get index 0c6a4585fc..55c690c8ad 100644 --- a/tests/tcg/ppc64/Makefile.target +++ b/tests/tcg/ppc64/Makefile.target @@ -10,4 +10,11 @@ PPC64_TESTS=3Dbcdsub endif bcdsub: CFLAGS +=3D -mpower8-vector =20 +ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),) +POWER10_TESTS=3Dbyte_reverse +RUN_POWER10_TESTS=3D$(patsubst %, run-%, $(POWER10_TESTS)) +$(RUN_POWER10_TESTS): QEMU_OPTS+=3D-cpu POWER10 +PPC64_TESTS +=3D $(POWER10_TESTS) +endif + TESTS +=3D $(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=3Dbcdsub endif bcdsub: CFLAGS +=3D -mpower8-vector =20 +ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),) +POWER10_TESTS=3Dbyte_reverse +RUN_POWER10_TESTS=3D$(patsubst %, run-%, $(POWER10_TESTS)) +$(RUN_POWER10_TESTS): QEMU_OPTS+=3D-cpu POWER10 +PPC64LE_TESTS +=3D $(POWER10_TESTS) +endif + TESTS +=3D $(PPC64LE_TESTS) diff --git a/tests/tcg/ppc64le/byte_reverse.c b/tests/tcg/ppc64le/byte_reve= rse.c new file mode 100644 index 0000000000..553b9870ae --- /dev/null +++ b/tests/tcg/ppc64le/byte_reverse.c @@ -0,0 +1,22 @@ +#include +#include + +int main(void) +{ + unsigned long var; + + var =3D 0xFEDCBA9876543210; + asm("brh %0, %0" : "=3Dr"(var)); + assert(var =3D=3D 0xDCFE98BA54761032); + + var =3D 0xFEDCBA9876543210; + asm("brw %0, %0" : "=3Dr"(var)); + assert(var =3D=3D 0x98BADCFE10325476); + + var =3D 0xFEDCBA9876543210; + asm("brd %0, %0" : "=3Dr"(var)); + assert(var =3D=3D 0x1032547698BADCFE); + + return 0; +} + --=20 2.25.1