From patchwork Mon May 17 16:10:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 440169 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1262177jac; Mon, 17 May 2021 09:53:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzA+cFLEzOZZV3sqUVdSm90ZTatVbFO5A9yctQuLEJEtWzxAnDSbtSJLllXWMp2EJqWMr1A X-Received: by 2002:a9d:247:: with SMTP id 65mr424826otb.330.1621270429924; Mon, 17 May 2021 09:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621270429; cv=none; d=google.com; s=arc-20160816; b=rF4w6/xYWyhIhKA1LuJpImpam8ryapm7YEwsnntDjKopIcCvpljwA9TAErImSQLtfM sh8UL33nbYfFBowOBW8uGjMbhYzv12+vqeOKSd90kROIgQoAKpPRoieNoMPEOw5lGti2 JBa1kJ1+CMw5t8KyOfONjbhdH3Q3zLoxxPmjclgst785RGkSx5/oGAJp0wMh7YFcoZzK NT2RILGBEqJ8ENg/VfH2ZwHdc7bqCNJVsa31P+m9xQ9VoNXwFhTNm8YVp/tfcdm9EyrB Tq07Wjo5dSu1j8csbV2yGAD/D6LxACee5Kyh/XwMqlGp5L9gWI1YfZsat0TjI0cH+Xv4 R2ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ecrJ8Yrx6ZRJ+fACPN+MlJLK85SE+W/xoTVC0N/qwc0=; b=lQOKj+yh4FQEu5hHaFjS39zEgIvKadfk9d3HHEztLFSRdBDzZFhWj/OvAsZSv8MsN5 VlVkUKD7ESqLRs5ja+1CODrZ0Zi0Ji5/ev2uZ8uxfaRHOf9hBLVJuQUsEwGeHurwoDxY tRD/nQ9b13wTT6PdTEzpgyGuC/VhmSVF6RAyuPhXnMGPO3d8uGh1wJRH2v84oJBmtrQr RTuT7dT6vnnZ9DfArVrwk8LAcuVXh/00NAD/ReY/lGqYB0anh2BjON5KT0mMiVuz6abq xwWmI3qxDgPVdRP+RqRMr6I3n9iiDogggsKXEDBN18UlqHGpUWGzP8NMcOjfmSQ1AU8E Z5jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Qt+U7dja; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h7si15355755ooj.42.2021.05.17.09.53.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 May 2021 09:53:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Qt+U7dja; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ligV3-00056p-76 for patch@linaro.org; Mon, 17 May 2021 12:53:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lifyq-0001ns-R9 for qemu-devel@nongnu.org; Mon, 17 May 2021 12:20:32 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:37457) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lifye-00028i-Pj for qemu-devel@nongnu.org; Mon, 17 May 2021 12:20:32 -0400 Received: by mail-wm1-x32c.google.com with SMTP id k5-20020a05600c4785b0290174b7945d7eso3512769wmo.2 for ; Mon, 17 May 2021 09:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ecrJ8Yrx6ZRJ+fACPN+MlJLK85SE+W/xoTVC0N/qwc0=; b=Qt+U7dja5K02eYNlzpW0xIuVoXvMerwBhJ/RDvx/U17ezrvlejAtRNjweya/bBgRfe i52IqbRU8EwoIWwIBeOKQDfp6rEukpqp5UVM4UXcCOjJrGjL7RHNifN6xCxCcW+1+Rwh aM9kcgEze8vDIySx3+HudzUrP+3IRYf3SP42RHf1+O5cFbnd/ettp+gYcv1DPOMPu/9Y o9w+gecw5kQCj8Fh1otp5P2/YZFZpRqt2E7XpSoRRC6yETHGevZU0Ovae5ayPc2CkKmH mynrv3twjsIJd3kieEXwiXV6+QvD4pLwscyeKTBQZXvzd/obqx6mj61cYn1I7isFoDFS Fkvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ecrJ8Yrx6ZRJ+fACPN+MlJLK85SE+W/xoTVC0N/qwc0=; b=SrFYBNnUxgmnyBSCPp0tHBjxt5Shjzd8FbW4uXy7X3UoLDTNzrngWG67ceQ1jmwVR3 xbzzhx1uqBi8GtK8fIrwUYdbUYZBo62umajYe7HRqH/qVG8Eqx/4auHPN0D6eqbvi2qJ npvpmaimT7FNeQtt5/QVls7DqXj54VIvo5Ls90+TgSdDr/3b8W0KyZcjodrkgpO6xqez gZsKBGCCzDctxgAGYUgvgQSFvJRo8Yj+9bFq4/yhXSNt58FpQ+evj5fIHOl20ElBLPrt 4C4/xMRCsX88wEkEKv6CIV8cympfgwdgwVKB48WqwLEjZvdOnkDLFeuF5W1H9RKWXyMY 9Seg== X-Gm-Message-State: AOAM532jIrDXWFNm1LOT6kG5tth6yp6eOXxgIr2kygYN00GEmAgVawWL k93gjxNQAB+Wtx7la3sWisA+ew== X-Received: by 2002:a7b:c444:: with SMTP id l4mr487457wmi.36.1621268417035; Mon, 17 May 2021 09:20:17 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c7sm8796478wrs.23.2021.05.17.09.20.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 09:20:14 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4A0F01FFAB; Mon, 17 May 2021 17:10:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 22/29] tests/tcg/ppc64le: tests for brh/brw/brd Date: Mon, 17 May 2021 17:10:15 +0100 Message-Id: <20210517161022.13984-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210517161022.13984-1-alex.bennee@linaro.org> References: <20210517161022.13984-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: =?utf-8?q?Alex_Benn=C3=A9e?= , Matheus Ferst , qemu-devel@nongnu.org, Fabiano Rosas Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Matheus Ferst Tests for Byte-Reverse Halfword, Word and Doubleword [AJB: tweak to make rules for skip/plugins] Signed-off-by: Matheus Ferst Signed-off-by: Alex Bennée Tested-by: Fabiano Rosas Message-Id: <20210423205757.1752480-3-matheus.ferst@eldorado.org.br> Message-Id: <20210512102051.12134-28-alex.bennee@linaro.org> -- 2.20.1 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 + +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; +} + diff --git a/tests/tcg/ppc64/Makefile.target b/tests/tcg/ppc64/Makefile.target index 0c6a4585fc..a6a4ddaeca 100644 --- a/tests/tcg/ppc64/Makefile.target +++ b/tests/tcg/ppc64/Makefile.target @@ -10,4 +10,17 @@ PPC64_TESTS=bcdsub endif bcdsub: CFLAGS += -mpower8-vector +PPC64_TESTS += byte_reverse +ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),) +run-byte_reverse: QEMU_OPTS+=-cpu POWER10 +run-plugin-byte_reverse-with-%: QEMU_OPTS+=-cpu POWER10 +else +byte_reverse: + $(call skip-test, "BUILD of $@", "missing compiler support") +run-byte_reverse: + $(call skip-test, "RUN of byte_reverse", "not built") +run-plugin-byte_reverse-with-%: + $(call skip-test, "RUN of byte_reverse ($*)", "not built") +endif + TESTS += $(PPC64_TESTS) diff --git a/tests/tcg/ppc64le/Makefile.target b/tests/tcg/ppc64le/Makefile.target index 1acfcff94a..c0c14ffbad 100644 --- a/tests/tcg/ppc64le/Makefile.target +++ b/tests/tcg/ppc64le/Makefile.target @@ -9,4 +9,17 @@ PPC64LE_TESTS=bcdsub endif bcdsub: CFLAGS += -mpower8-vector +PPC64LE_TESTS += byte_reverse +ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_POWER10),) +run-byte_reverse: QEMU_OPTS+=-cpu POWER10 +run-plugin-byte_reverse-with-%: QEMU_OPTS+=-cpu POWER10 +else +byte_reverse: + $(call skip-test, "BUILD of $@", "missing compiler support") +run-byte_reverse: + $(call skip-test, "RUN of byte_reverse", "not built") +run-plugin-byte_reverse-with-%: + $(call skip-test, "RUN of byte_reverse ($*)", "not built") +endif + TESTS += $(PPC64LE_TESTS)