From patchwork Tue May 4 10:02:20 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: 430859 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp3653975jao; Tue, 4 May 2021 03:21:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvCDYKoH0DCkv0CwpnxT7d7Jkj3/vzSw9l0QxAbbtUO+WY8VFKl/foXp3BWu4feJ4cUZ7K X-Received: by 2002:ab0:2441:: with SMTP id g1mr19168242uan.76.1620123672483; Tue, 04 May 2021 03:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620123672; cv=none; d=google.com; s=arc-20160816; b=I6UnU/UtgOrJasGjuw49EzCUYjmBbzIMGyaUsn1eQnDQhEXNKzdr2mttqaP5CwfY+m NW9DkQIFGt49e2P5itdHvEGsY3BCP8wvS/yL+H+h9JbbCeA7SVhw+gtECkOQguN0zLsJ j1Fn/n0M/LQc7YhlkFZ6hTOoLK9ozDLopBRhhCIs1mJsT9Rr+Yze/ndblqykspPYJAJk 5Jt/YHnZOV/vPByiZ/jNNRxiF+W+uZHqmA9M5wF5AQNF/PfyVLwXNucAayv5S0A0vEFZ a44Xcx2XDF9NivFipkBMUBIYkgZGrTBI/N8tfnmuWkxMAJQYzctnfVW2mmRLlSN9TBNO VNuw== 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=7Itxy1UuOFf0gEK0SQVLvvq83zvWvNXRtoyv+3j/ePs=; b=vFopOSqxmtI4vN456DjlA5ciraydNQIkgYoiec2LoVV6GoCrdc9t2hqd6V1O6xLozE YxxhB+xIUVECfi24+ZYnl/8Ze2s3t87UdZzJknWbvO6HbPWJK51VpWgJsdDB6TsxrcMB 3Yi5w783wsgwUIUFNjmQ9EojGL7T0B7Si1x3Qzr1h6P64m30WZdM9VMcHhkcET7in4iA Rv0W+IQ7vCp/BMu7uXh/16jZyeGG/FGTn3rNWSZVJeoek3l1dcGf5vCjfV5J/iNpa/v+ I0yT6vj2sHnG7ubjX/FgD/xGV3cTgCUShr7M9u8bEmtpvzaPeRUQUDbhnReHSrrRVVV5 5adw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AXd7kgK0; 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 r2si7185663vsj.320.2021.05.04.03.21.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 May 2021 03:21:12 -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=AXd7kgK0; 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]:60494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldsAx-0008Cx-T4 for patch@linaro.org; Tue, 04 May 2021 06:21:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldrzq-0002Wy-Rw for qemu-devel@nongnu.org; Tue, 04 May 2021 06:09:44 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:55075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldrzm-0006n2-KX for qemu-devel@nongnu.org; Tue, 04 May 2021 06:09:42 -0400 Received: by mail-wm1-x32d.google.com with SMTP id o127so894230wmo.4 for ; Tue, 04 May 2021 03:09:37 -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=7Itxy1UuOFf0gEK0SQVLvvq83zvWvNXRtoyv+3j/ePs=; b=AXd7kgK0YzZVDR7sz42FfynpiVDCoP/liwlnrHIUPFtKiuJ7EpQC7rfIVJF8eHr+Sb rq9L7WxnUHu6nBlZVhX/MZPOLb1aIYPZBgLdE2YhtB18BG38sVPrQd+M3HTofdXGgtJZ 2Np3pzeGDYN6EfoP7Wg7wHdqB3Q8JvQWye1n1bfkWm+m44Hs1RDDXbsU5byNT1gd4+uf huiYm9fu1VwRC/PKwV4So/+b0q0zXgixqZJl59Sue92Dg00IKjRIw8d/tHKuVydozvgJ rIDNMVyzMhJZknb2W9Aae9xARxfIusdPUaTPfFv6k6BONIbyMxqwJ7Z9fWfWZnWpMeFy avpg== 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=7Itxy1UuOFf0gEK0SQVLvvq83zvWvNXRtoyv+3j/ePs=; b=o5hBHzQvHPs2GFxuJh/IDkWa0NZy8sqdiVyT2jgTRn5dIbstVNd/5tXEb+yRzGSqnT L6ryo/Fyl69XZC3L43wggcc6t38XF+/x3zwVJtfKggg+LYRTW6sbgidMZPmi9KDHaMPe GKOmA6l1F8M5zBk7wwR+a0aegGuy8XH89wqymZgk+au9hNyAgH0fSipFpjeNY9azEd85 RI6GBTmLPM7fD+SyGhmtdN0WfUQbiNpktpzivLrvLjFzU/4JIdDu1JORSMqoi0IIAo5K HAQQOcS34rNHCLFl/Ik7MDSoPF68ujmEB0Ca7zAnEgy/jE4OYznRQpoZwr73borvMboi 7peg== X-Gm-Message-State: AOAM531+yqr/XViPBVwm2vFJgMdTXhRmeFjgpI49qvnZXGvvEiehvDCX JmSCTkIv7jkKWSBdt9Ff1ON2Sg== X-Received: by 2002:a05:600c:22c9:: with SMTP id 9mr26488061wmg.85.1620122976362; Tue, 04 May 2021 03:09:36 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z6sm2171882wmf.9.2021.05.04.03.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 May 2021 03:09:31 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7F1981FFB3; Tue, 4 May 2021 11:02:26 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 27/30] tests/tcg/ppc64le: tests for brh/brw/brd Date: Tue, 4 May 2021 11:02:20 +0100 Message-Id: <20210504100223.25427-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210504100223.25427-1-alex.bennee@linaro.org> References: <20210504100223.25427-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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: fam@euphon.net, berrange@redhat.com, Fabiano Rosas , =?utf-8?q?Alex_Benn=C3=A9e?= , f4bug@amsat.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, Matheus Ferst , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Matheus Ferst Tests for Byte-Reverse Halfword, Word and Doubleword Signed-off-by: Matheus Ferst Tested-by: Fabiano Rosas [AJB: tweak to make rules for skip/plugins] Signed-off-by: Alex Bennée Message-Id: <20210423205757.1752480-3-matheus.ferst@eldorado.org.br> --- tests/tcg/ppc64le/byte_reverse.c | 21 +++++++++++++++++++++ tests/tcg/ppc64/Makefile.target | 13 +++++++++++++ tests/tcg/ppc64le/Makefile.target | 13 +++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 tests/tcg/ppc64le/byte_reverse.c -- 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)