From nobody Mon Feb 9 12:04:08 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=1618526183; cv=none; d=zohomail.com; s=zohoarc; b=gnJhbjjMBh71uSYc/yQuTtk7MYOz7TPz9BVLJc0qp9g27ID+1p4+jRuICt9RPAU9iMepiANphSVOhjImmqWu2gaG8wyrseW7/yV8aGouXe4dQMWnGUoRwHNY+L9YiZs61p0XeVZOiJeZy/QWy215bjGVb3+JV0V70XUWYKXNae0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618526183; 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=9Db5XTp7j49/KplNfHp7YW32/tmMcnv4K2Lafyief+Y=; b=D3taWKglT3cDFaJl2w0swDbjRV/yPSbcPF94HpUA7VF3tIZZdyxbVH/JRZXXZPyWaeHJFyxR/0ApUxVobSFbipScnJ/OWwp118BZR7J21MWQh+hOnloaVsIW/NLBaTaha025rIPA1m+DLk9dj0wmNfQepAxFy3p8IG/Wkd0X6UI= 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 1618526183519436.9242834134948; Thu, 15 Apr 2021 15:36:23 -0700 (PDT) Received: from localhost ([::1]:46284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXAaz-00054Y-A3 for importer@patchew.org; Thu, 15 Apr 2021 18:36:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXATw-0007bA-Cf; Thu, 15 Apr 2021 18:29:04 -0400 Received: from [201.28.113.2] (port=9244 helo=outlook.eldorado.org.br) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXATu-0007aM-SM; Thu, 15 Apr 2021 18:29:04 -0400 Received: from power9a ([10.10.71.235]) by outlook.eldorado.org.br with Microsoft SMTPSVC(8.5.9600.16384); Thu, 15 Apr 2021 18:41:49 -0300 Received: from eldorado.org.br (unknown [10.10.70.45]) by power9a (Postfix) with ESMTP id 96DA7801328; Thu, 15 Apr 2021 18:41:48 -0300 (-03) From: matheus.ferst@eldorado.org.br To: qemu-devel@nongnu.org Subject: [RFC PATCH 1/3] tests/docker: gcc-10 based images for ppc64{, le} tests Date: Thu, 15 Apr 2021 18:41:36 -0300 Message-Id: <20210415214138.563795-2-matheus.ferst@eldorado.org.br> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210415214138.563795-1-matheus.ferst@eldorado.org.br> References: <20210415214138.563795-1-matheus.ferst@eldorado.org.br> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 15 Apr 2021 21:41:49.0082 (UTC) FILETIME=[23CF8FA0:01D73240] 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: thuth@redhat.com, Matheus Ferst , gustavo.romero@protonmail.com, f4bug@amsat.org, wainersm@redhat.com, luis.pires@eldorado.org.br, qemu-ppc@nongnu.org, 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, new '-test-cross' images are 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 | 4 ++++ .../dockerfiles/debian-ppc64-test-cross.docker | 13 +++++++++++++ .../debian-ppc64el-test-cross.docker | 17 +++++++++++++++++ tests/tcg/configure.sh | 12 ++++++++---- 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 tests/docker/dockerfiles/debian-ppc64-test-cross.docker create mode 100644 tests/docker/dockerfiles/debian-ppc64el-test-cross.dock= er diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 9f464cb92c..1f8941d290 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -152,10 +152,14 @@ 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-ppc64-test-cross: docker-image-debian11 +docker-image-debian-ppc64el-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-ppc64-test-cross +DOCKER_PARTIAL_IMAGES +=3D debian-ppc64el-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-ppc64-test-cross.docker b/test= s/docker/dockerfiles/debian-ppc64-test-cross.docker new file mode 100644 index 0000000000..66abfdeb47 --- /dev/null +++ b/tests/docker/dockerfiles/debian-ppc64-test-cross.docker @@ -0,0 +1,13 @@ +# +# Docker ppc64 cross-compiler target (tests only) +# +# This docker target builds on the debian Bullseye base image. +# +FROM qemu/debian11 + +# Add the foreign architecture we want and install dependencies +RUN dpkg --add-architecture ppc64 +RUN apt update && \ + DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ + apt install -y --no-install-recommends \ + libc6-dev-ppc64-cross gcc-10-powerpc64-linux-gnu diff --git a/tests/docker/dockerfiles/debian-ppc64el-test-cross.docker b/te= sts/docker/dockerfiles/debian-ppc64el-test-cross.docker new file mode 100644 index 0000000000..7582508467 --- /dev/null +++ b/tests/docker/dockerfiles/debian-ppc64el-test-cross.docker @@ -0,0 +1,17 @@ +# +# Docker ppc64el cross-compiler target (tests only) +# +# This docker target builds on the debian Bullseye base image. +# +FROM qemu/debian11 + +# Add the foreign architecture we want and install dependencies +RUN dpkg --add-architecture ppc64el +RUN apt update && \ + DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ + apt install -y --no-install-recommends \ + crossbuild-essential-ppc64el gcc-10-powerpc64le-linux-gnu + +# Specify the cross prefix for this image (see tests/docker/common.rc) +#ENV QEMU_CONFIGURE_OPTS --cross-prefix=3Dpowerpc64le-linux-gnu- +#ENV DEF_TARGET_LIST ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index fa1a4261a4..5f5db91a01 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-ppc64-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-ppc64el-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 12:04:08 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=1618525931; cv=none; d=zohomail.com; s=zohoarc; b=hOp7Sdn9SlG6gb3QEmxpxEB0t2wEk1iD1GfTn8N5juQiwqzaCdOwT+iBKd5OOQQHL0csqPyrJr/c4vY0EK/8AlccuT1MNiSG9rBVzvIUxcnN5PCtVgjipUNQQJPGjjfGOZA6PRozojCw9sgbijdJGm2OujlKDWZh05xgZacxxc8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618525931; 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=bZRpVhFNBhJsumqb2gRsMbvz/v6nVzQPuezPyBXAkxo=; b=eFNqymSKBpkuzZjieh6A1auhqUKOR5o7mVNDJ+21ae8bv/7ZhT4kyZaCDwQmNz+Z2cdL4zL7oKdlPUE7Tl27g9mI2CsKqE21AapmiFSzsVqOSqywkxJH7sUEhQ3qNu0vdL/F76mgE6zwXo0aa1XEBDEBUuo+cd7FQUzsbwWjRqs= 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 1618525931116390.1393872712579; Thu, 15 Apr 2021 15:32:11 -0700 (PDT) Received: from localhost ([::1]:36668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXAWv-00012W-Ee for importer@patchew.org; Thu, 15 Apr 2021 18:32:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXATq-0007XA-Nn; Thu, 15 Apr 2021 18:28:58 -0400 Received: from [201.28.113.2] (port=9244 helo=outlook.eldorado.org.br) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXATp-0007aM-3P; Thu, 15 Apr 2021 18:28:58 -0400 Received: from power9a ([10.10.71.235]) by outlook.eldorado.org.br with Microsoft SMTPSVC(8.5.9600.16384); Thu, 15 Apr 2021 18:41:50 -0300 Received: from eldorado.org.br (unknown [10.10.70.45]) by power9a (Postfix) with ESMTP id E2D19801328; Thu, 15 Apr 2021 18:41:49 -0300 (-03) From: matheus.ferst@eldorado.org.br To: qemu-devel@nongnu.org Subject: [RFC PATCH 2/3] tests/tcg/ppc64le: load 33-bits constant with paddi Date: Thu, 15 Apr 2021 18:41:37 -0300 Message-Id: <20210415214138.563795-3-matheus.ferst@eldorado.org.br> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210415214138.563795-1-matheus.ferst@eldorado.org.br> References: <20210415214138.563795-1-matheus.ferst@eldorado.org.br> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 15 Apr 2021 21:41:50.0349 (UTC) FILETIME=[2490E3D0:01D73240] 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: thuth@redhat.com, Matheus Ferst , gustavo.romero@protonmail.com, f4bug@amsat.org, wainersm@redhat.com, luis.pires@eldorado.org.br, qemu-ppc@nongnu.org, 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 This test checks that we can correctly load a 33-bit constant and its two's complement. At least until version 1.1-0, POWER10 Functional Simulation fails this test, processing the immediate as if it were 32-bits instead of 34, so it's probably something to keep an eye on. Signed-off-by: Matheus Ferst --- tests/tcg/ppc64/Makefile.target | 5 +++++ tests/tcg/ppc64le/Makefile.target | 5 +++++ tests/tcg/ppc64le/pli_33bits.c | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 tests/tcg/ppc64le/pli_33bits.c diff --git a/tests/tcg/ppc64/Makefile.target b/tests/tcg/ppc64/Makefile.tar= get index 0c6a4585fc..6eccd2c06f 100644 --- a/tests/tcg/ppc64/Makefile.target +++ b/tests/tcg/ppc64/Makefile.target @@ -10,4 +10,9 @@ PPC64_TESTS=3Dbcdsub endif bcdsub: CFLAGS +=3D -mpower8-vector =20 +ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),) +PPC64LE_TESTS +=3D pli_33bits +endif +pli_33bits: CFLAGS +=3D -mpower10 + TESTS +=3D $(PPC64_TESTS) diff --git a/tests/tcg/ppc64le/Makefile.target b/tests/tcg/ppc64le/Makefile= .target index 1acfcff94a..2003eab2df 100644 --- a/tests/tcg/ppc64le/Makefile.target +++ b/tests/tcg/ppc64le/Makefile.target @@ -9,4 +9,9 @@ PPC64LE_TESTS=3Dbcdsub endif bcdsub: CFLAGS +=3D -mpower8-vector =20 +ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),) +PPC64LE_TESTS +=3D pli_33bits +endif +pli_33bits: CFLAGS +=3D -mpower10 + TESTS +=3D $(PPC64LE_TESTS) diff --git a/tests/tcg/ppc64le/pli_33bits.c b/tests/tcg/ppc64le/pli_33bits.c new file mode 100644 index 0000000000..848cbce165 --- /dev/null +++ b/tests/tcg/ppc64le/pli_33bits.c @@ -0,0 +1,22 @@ +#include +#include +#include + +int main(void) +{ + long int var; + struct sigaction action; + + action.sa_handler =3D _exit; + sigaction(SIGABRT, &action, NULL); + + asm(" pli %0,0x1FFFFFFFF\n" + : "=3Dr"(var)); + assert(var =3D=3D 0x1FFFFFFFF); + + asm(" pli %0,-0x1FFFFFFFF\n" + : "=3Dr"(var)); + assert(var =3D=3D -0x1FFFFFFFF); + + return 0; +} --=20 2.25.1 From nobody Mon Feb 9 12:04:08 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=1618525934; cv=none; d=zohomail.com; s=zohoarc; b=b5wWbm5n1dRXTztB0i6upj0qbjOzHDy4gWB4rdAXeDAMYuKeJo82my35kE1fG1Ku8L2TO2yGwRm2gHLV3uEVBoxXz0PkHsZ5BXbdLHPLmF3x9NON9i1GQCG/TVO9AT1+pRece4hJ9KJbaLQcXH5xcE9pAfCS3qRfhnRcVPMX47Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618525934; 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=K6KbkqLhxjWiJkwYpDXedcmBQ2UsNU5NEr5cCDGoQsk=; b=My4Etzw2XQs04UG4n5Y8o9rhwK8s3ueaaeBtlK/i4TETxuHLwURU1tuAT+DxVH2fuouZvOackzH8OJE9+pKQsEEBUg9+Iyn8lLf154KpulNwGi0pLB+eiZRZmYmxM+0+EKMxvmO84O1JRfSMuK3jATUvz2ScvEhe5+16/FSz2Q8= 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 1618525934886443.70323594715126; Thu, 15 Apr 2021 15:32:14 -0700 (PDT) Received: from localhost ([::1]:36808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXAWz-000162-Mt for importer@patchew.org; Thu, 15 Apr 2021 18:32:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXATt-0007XN-R9; Thu, 15 Apr 2021 18:29:01 -0400 Received: from [201.28.113.2] (port=9244 helo=outlook.eldorado.org.br) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXATs-0007aM-90; Thu, 15 Apr 2021 18:29:01 -0400 Received: from power9a ([10.10.71.235]) by outlook.eldorado.org.br with Microsoft SMTPSVC(8.5.9600.16384); Thu, 15 Apr 2021 18:41:51 -0300 Received: from eldorado.org.br (unknown [10.10.70.45]) by power9a (Postfix) with ESMTP id ECBC7801328; Thu, 15 Apr 2021 18:41:50 -0300 (-03) From: matheus.ferst@eldorado.org.br To: qemu-devel@nongnu.org Subject: [RFC PATCH 3/3] tests/tcg/ppc64le: R=1 test for paddi Date: Thu, 15 Apr 2021 18:41:38 -0300 Message-Id: <20210415214138.563795-4-matheus.ferst@eldorado.org.br> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210415214138.563795-1-matheus.ferst@eldorado.org.br> References: <20210415214138.563795-1-matheus.ferst@eldorado.org.br> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 15 Apr 2021 21:41:51.0397 (UTC) FILETIME=[2530CD50:01D73240] 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: thuth@redhat.com, Matheus Ferst , gustavo.romero@protonmail.com, f4bug@amsat.org, wainersm@redhat.com, luis.pires@eldorado.org.br, qemu-ppc@nongnu.org, 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 This test exercise the R=3D1 path of paddi implementation using the extended mnemonic "pla". Signed-off-by: Matheus Ferst --- tests/tcg/ppc64/Makefile.target | 3 ++- tests/tcg/ppc64le/Makefile.target | 3 ++- tests/tcg/ppc64le/pla.c | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 tests/tcg/ppc64le/pla.c diff --git a/tests/tcg/ppc64/Makefile.target b/tests/tcg/ppc64/Makefile.tar= get index 6eccd2c06f..a6cd7a21b2 100644 --- a/tests/tcg/ppc64/Makefile.target +++ b/tests/tcg/ppc64/Makefile.target @@ -11,8 +11,9 @@ endif bcdsub: CFLAGS +=3D -mpower8-vector =20 ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),) -PPC64LE_TESTS +=3D pli_33bits +PPC64LE_TESTS +=3D pli_33bits pla endif pli_33bits: CFLAGS +=3D -mpower10 +pla: CFLAGS +=3D -mpower10 =20 TESTS +=3D $(PPC64_TESTS) diff --git a/tests/tcg/ppc64le/Makefile.target b/tests/tcg/ppc64le/Makefile= .target index 2003eab2df..db92b2ec99 100644 --- a/tests/tcg/ppc64le/Makefile.target +++ b/tests/tcg/ppc64le/Makefile.target @@ -10,8 +10,9 @@ endif bcdsub: CFLAGS +=3D -mpower8-vector =20 ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),) -PPC64LE_TESTS +=3D pli_33bits +PPC64LE_TESTS +=3D pli_33bits pla endif pli_33bits: CFLAGS +=3D -mpower10 +pla: CFLAGS +=3D -mpower10 =20 TESTS +=3D $(PPC64LE_TESTS) diff --git a/tests/tcg/ppc64le/pla.c b/tests/tcg/ppc64le/pla.c new file mode 100644 index 0000000000..4826579216 --- /dev/null +++ b/tests/tcg/ppc64le/pla.c @@ -0,0 +1,26 @@ +#include +#include +#include + +int main(void) +{ + long unsigned int label, addr; + struct sigaction action; + + action.sa_handler =3D _exit; + sigaction(SIGABRT, &action, NULL); + + asm("insn:\n" + " lis %0, insn@highest\n" + " addi %0, %0, insn@higher\n" + " rldicr %0, %0, 32, 31\n" + " oris %0, %0, insn@h\n" + " ori %0, %0, insn@l\n" + " pla %1, %2\n" + : "=3Dr" (label), "=3Dr" (addr) + : "i" (-5 * 4)); /* number of instruction between label and pla */ + assert(addr =3D=3D label); + + return 0; +} + --=20 2.25.1