From patchwork Wed May 12 10:20:43 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: 435504 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4705158jao; Wed, 12 May 2021 03:48:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyef1v4laLoI8SdBpiifsmUWQLf8JBKHdpQHldgPfERqNgeeHPpg/wZo5cvvQ9SyuPR/5pE X-Received: by 2002:ac8:5981:: with SMTP id e1mr19441285qte.310.1620816534909; Wed, 12 May 2021 03:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620816534; cv=none; d=google.com; s=arc-20160816; b=btfr5ju+5UTbTpvMtXQ+btUKqzhbAmKdHw5i7vO/SoOVapYUYA8Aw6KPElTiBjnkrf o1PZSxjOpOIrHAo9wMqogOPr7tZqha8SLbr85bunzuTzYLakJMidgTWwbng7W4Wf9FM9 1+OYMVJYCwdxs9e9OPqd04neCX0SPu3gjxUMOM0164nUFq3cLgQyKdbSv0EAEEKyeKiO VtRu5NSL7RmYt2M82xKKsgcMeWDG1EhgFRk+3d6ULEU5SvAG/9EJ7jc5pN+gH8OlHTUQ Gvjd10bWmTq9Zz+T8Fq+G/OLb4dvkjbJyDxcB3l8jC9oE14X+F79CDv/o/HWeyu2ji6/ FnVQ== 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=rPMh6kmt7DZA6FRYiUkJHikUFQXem/GBwsoB4cM/qp0=; b=tnQNGUPFg1c7RMlsPPzQ93HoiZ7xrcVjVmWSjq4lXRL2J9FcqWDsuLjWwBJeCZw3Kv nK2OKfpm3xyIiX27u9Jo1QOjXkktwCKneqZhax8qA+VXGjsYO6mheuJYH0pBNNwt2xCQ Q6LV4Z2vZr5PNtSkx2IGoy8xFbuLpEqcLZtH6DbavgaiOtwGZRcFf3GBravEKws7Zdqc nImmgSA+6yG7q308coyzBPxelmTmjD00XmxtmuxGnwL/W4wARHYRkpg++0iUaQqOyrti TcBkxX7ZsNHbeqWQXTcfALHUVMjc0aCbhBdfmTY30zmstatCR3y9WU7DyQnazqNmSsrs YYNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TxAt6bM3; 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 o8si3258743qkg.269.2021.05.12.03.48.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 May 2021 03:48:54 -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=TxAt6bM3; 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]:54046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgmQA-0002JG-Au for patch@linaro.org; Wed, 12 May 2021 06:48:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgmI2-0004Ir-An for qemu-devel@nongnu.org; Wed, 12 May 2021 06:40:30 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:46666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgmI0-0006P4-Ft for qemu-devel@nongnu.org; Wed, 12 May 2021 06:40:30 -0400 Received: by mail-wm1-x32c.google.com with SMTP id p14-20020a05600c358eb029015c01f207d7so2777291wmq.5 for ; Wed, 12 May 2021 03:40:28 -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=rPMh6kmt7DZA6FRYiUkJHikUFQXem/GBwsoB4cM/qp0=; b=TxAt6bM3DG/yw34WLeg5x5h+6dpqihOK3CXfPxo+eWRMrK2yE2YhWfcBcD6n+7vZYe L5spwSuo9vsZ4Wv5IZSVwb5BHnrBzv33GdRakivzqnRtjAz2NNQ7ZiuOrsApjWSrYo9z 5xhRcYlEpzGExq+1gKejSJ1c9IJALo7CSc7iH5WGnkKDw/cqOV8bEuIYiwfBEHZ7Qntn 1ew6bGsytsLHKxLqB+BlcxxEbgath+AK5pCyw673ysgoPyG93y8KF6M83OMURZEDNaLA 4hlvRe96omJgKeG+CeOXkTeLJLOnshZ82e7o/9Gg+9G49hIk9Fxgi76lhTz40eb3Ax+V bKsA== 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=rPMh6kmt7DZA6FRYiUkJHikUFQXem/GBwsoB4cM/qp0=; b=Y1Ehfu01z3uTF9m+Owj1k2UOY+YbUxwIO1c/czqPZWXgr0aHQ1o94mEGAdIVVk9AAs wsWS5lQ2slyByh+0dqu/Rd5zqtSsBzuN9ebJeG0HNF0nIkZUYZehb/mzCQ+2lWsIuW1G 8aGXgOV6h4m3MEryxNWioudDhlE7RIV51pbm4AfEzpVYVQFQIFtJkS1uPm/KH6B2amx1 UvBQzreI6mZlF0FtwnsKCBtUMjlbYGFxT5Lhwe0f3v0kq+9R1iyKZUPO7HI73T6TuFsf ZS47lBn1yIvXn6AhrYu/m3fy56L1ecJk8g8oTAePnRmCFmWxiDHIhtlIQW0ldhAttpm2 ON6g== X-Gm-Message-State: AOAM531Xd6Aisie8hbIPznImOwt1x6NIhr6OBdsCUl4vQxJ3QC27TkHH HbB4HtZy3vYYq5/0LEVE9T+oGw== X-Received: by 2002:a1c:b7c4:: with SMTP id h187mr37759056wmf.178.1620816027180; Wed, 12 May 2021 03:40:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g19sm25088411wme.48.2021.05.12.03.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 03:40:23 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7BB761FFAE; Wed, 12 May 2021 11:20:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 23/31] tests/tcg/tricore: Add madd test Date: Wed, 12 May 2021 11:20:43 +0100 Message-Id: <20210512102051.12134-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210512102051.12134-1-alex.bennee@linaro.org> References: <20210512102051.12134-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: fam@euphon.net, berrange@redhat.com, Bastian Koppelmann , f4bug@amsat.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Bastian Koppelmann Tested-by: Alex Bennée Signed-off-by: Bastian Koppelmann Signed-off-by: Alex Bennée Message-Id: <20210305170045.869437-14-kbastian@mail.uni-paderborn.de> --- tests/tcg/tricore/macros.h | 18 ++++++++++++++++++ tests/tcg/tricore/Makefile.softmmu-target | 1 + tests/tcg/tricore/test_madd.S | 11 +++++++++++ 3 files changed, 30 insertions(+) create mode 100644 tests/tcg/tricore/test_madd.S -- 2.20.1 diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h index e6a41cd1a2..0d76fc403a 100644 --- a/tests/tcg/tricore/macros.h +++ b/tests/tcg/tricore/macros.h @@ -9,6 +9,7 @@ /* Register definitions */ #define DREG_RS1 %d0 #define DREG_RS2 %d1 +#define DREG_RS3 %d4 #define DREG_CALC_RESULT %d1 #define DREG_CALC_PSW %d2 #define DREG_CORRECT_PSW %d3 @@ -85,6 +86,23 @@ test_ ## num: \ insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2; \ ) +#define TEST_D_DDD_PSW(insn, num, result, psw, rs1, rs2, rs3) \ + TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw, \ + LI(DREG_RS1, rs1); \ + LI(DREG_RS2, rs2); \ + LI(DREG_RS3, rs3); \ + rstv; \ + insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, DREG_RS3; \ + ) + +#define TEST_D_DDI_PSW(insn, num, result, psw, rs1, rs2, imm) \ + TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw, \ + LI(DREG_RS1, rs1); \ + LI(DREG_RS2, rs2); \ + rstv; \ + insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, imm; \ + ) + #define TEST_E_ED(insn, num, res_hi, res_lo, rs1_hi, rs1_lo, rs2) \ TEST_CASE_E(num, res_lo, res_hi, \ LI(EREG_RS1_LO, rs1_lo); \ diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target index fcc7b6c1c9..8de005523e 100644 --- a/tests/tcg/tricore/Makefile.softmmu-target +++ b/tests/tcg/tricore/Makefile.softmmu-target @@ -10,6 +10,7 @@ TESTS += test_dvstep.tst TESTS += test_fadd.tst TESTS += test_fmul.tst TESTS += test_ftoi.tst +TESTS += test_madd.tst QEMU_OPTS += -M tricore_testboard -nographic -kernel diff --git a/tests/tcg/tricore/test_madd.S b/tests/tcg/tricore/test_madd.S new file mode 100644 index 0000000000..5d839772bb --- /dev/null +++ b/tests/tcg/tricore/test_madd.S @@ -0,0 +1,11 @@ +#include "macros.h" +.text +.global _start +_start: + TEST_D_DDI_PSW(madd, 1, 0x0000fffd, 0x60000b80, 0x0000ffff, 0x7fffffff,2) + TEST_D_DDI_PSW(madd, 2, 0xffff7fff, 0x60000b80, 0xffff8001, 0x7fffffff,2) + TEST_D_DDD_PSW(madds.u, 3, 0xffffffff, 0x60000b80, 0x00000000, 0x80000000, \ + 0x80000000) + + TEST_PASSFAIL +