From patchwork Wed May 12 10:20:39 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: 435488 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4697067jao; Wed, 12 May 2021 03:36:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOUltH722JZoKGHhrjX/TIVzBhqf8FP/YK2aK0xC+xfBjy9CsAHSgBb8HBWz8sHyu3MCfm X-Received: by 2002:a67:7d12:: with SMTP id y18mr16977451vsc.6.1620815771969; Wed, 12 May 2021 03:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620815771; cv=none; d=google.com; s=arc-20160816; b=hmLhTeb/dYRiNf1/JAWPv4G9KHXz9YZSoGdIEr9RtRWVuzcEFLdahbVUvdLyBBeff3 xtoICLTizNMG4rEhtt+1JBEejh4TaCCQtF4hd3/c+harDstxs+0+qaku0Mkth2/xvDIr SCnrNyBMNcUjh6WXHGmrphE0wk6MZMBUgSEXEh7FEkorTLV82BLPe6TSZ5qsBxdI7lcu 6EvPuQOxhZC2ETD2qEzp8Co5Q/QWBZgBSM1eqt0oAWnZNHM1ff+8aOVAb1/1qTEt1C6R MtlaJLfD06BoZ9Kxw7985ugfEtvX6SMufLPj83zMhOY5rSf1O8PvjHsGvIfK4W/ZXWoF vz7Q== 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=oqpvL+FTeb8gxiE0Ls/4xrGbn7FVvV4JNtq3sVPSwPU=; b=KypdrURLBNPIbkHTnocOQvGh3fPT61GXoXMW5g56rUJDhGDEuyEcmtc6SFwImDY6SA /qUtwfmvz+X14FlL1U24hpY1m0lfjwvr+G9hFsvBZwCHlUQTRqylqsoPlyeMgxeQDLCZ gXQsHu37T9mCU1r20UCiIWwNyEoovf8ypMakd9b1UuQlE95sGR1qVS5K18YyJ6LBtwD4 JzaxJX4jW3VfO6760RTAyWkRxNur+q/0uVOuUoSU06c4mJ9qFNvGHNU5knT1DRyKj4I0 4Hoc3m92i2MWNq1QuUQp0nn9k9o97pfnlGTbtkIqc4z7dX8YbHG31rUfa2qQjDH4QJ1l GKzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NIv8WGs0; 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 k16si10065635uan.49.2021.05.12.03.36.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 May 2021 03:36:11 -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=NIv8WGs0; 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]:43598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgmDp-0001L3-JO for patch@linaro.org; Wed, 12 May 2021 06:36:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lglzT-00044z-OI for qemu-devel@nongnu.org; Wed, 12 May 2021 06:21:19 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:39518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lglzQ-0003ld-KM for qemu-devel@nongnu.org; Wed, 12 May 2021 06:21:19 -0400 Received: by mail-wm1-x332.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso375503wmh.4 for ; Wed, 12 May 2021 03:21:15 -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=oqpvL+FTeb8gxiE0Ls/4xrGbn7FVvV4JNtq3sVPSwPU=; b=NIv8WGs0OjIlKudLxK0c4PUuXI0ibwhPMff9Q9mc2Yu3tDPgyAg8gfsBPUWt/90rUb N6QxG+GyrQXA6yAbrtEpHh1+P72w/MKme1ndwb11xBWesg0xQh426CakmnRmc86flu+r 55Rs+HvEcXFxLjIxpruo+twVUDcc6fyqbMUPBxBOpbZj0uMjDUe/eDQKmZ+XhoWlNdx1 4ERWshDwkVNqoy45kxyE8usDyI59Z0R08/98Eg22I3VCOw5mwZg1rl/Ab8mIw7tGAF9i acocxMkos3hNcOyug8ELcWtYIejJpv6piwK+r69jLWDYgxiAW7D9NK2p1gDEkTg6YCqQ NcIw== 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=oqpvL+FTeb8gxiE0Ls/4xrGbn7FVvV4JNtq3sVPSwPU=; b=hET8NkPXLIAlhgCU9xma2xwNOnPRqGApkkM8ELZQhv7yBrrJpKcEVfr3hKOgcRMfuH NnXAQepQgJHb5VTWEspU3/G65UKZgH7PJwa9em6IpN7RiWwqCKklSCTPWasB5MpU3apP SDk48b7OoWyPfUxqe8iiFYTxaaNvA19QCEzG4cOEvqvvDt4v7Vks9GyloYPQFIPDYSu1 KLIomJ0+Sq0A18kju43xv+Mj+9kydb8JXiNRGEN3frf1n2fpDU8MukyHnKagIBFQ6xC7 C8ANHE0XZmGbZTzWx/LLysuLswIhefPM2aihJPNRT7ina5AT0n6N0n4Q+A8rXoRe+sZU l8Fw== X-Gm-Message-State: AOAM5333ZpF4BMoVhbCnMPRgutjG8SMGX2wUH8LoaI63N0E63jxsp88+ k9xUSN3/NS+zyGMoThrSTs7boA== X-Received: by 2002:a05:600c:3388:: with SMTP id o8mr10622050wmp.101.1620814874678; Wed, 12 May 2021 03:21:14 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c62sm15960791wme.5.2021.05.12.03.21.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 03:21:09 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1383A1FFA9; 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 19/31] tests/tcg/tricore: Add dvstep test Date: Wed, 12 May 2021 11:20:39 +0100 Message-Id: <20210512102051.12134-20-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::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.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-10-kbastian@mail.uni-paderborn.de> --- tests/tcg/tricore/macros.h | 29 ++++++++++++++++++++++- tests/tcg/tricore/Makefile.softmmu-target | 1 + tests/tcg/tricore/test_dvstep.S | 15 ++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/tricore/test_dvstep.S -- 2.20.1 diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h index 52aa936c56..59b4b9a352 100644 --- a/tests/tcg/tricore/macros.h +++ b/tests/tcg/tricore/macros.h @@ -19,6 +19,18 @@ #define DREG_DEV_ADDR %a15 +#define EREG_RS1 %e6 +#define EREG_RS1_LO %d6 +#define EREG_RS1_HI %d7 +#define EREG_RS2 %e8 +#define EREG_RS2_LO %d8 +#define EREG_RS2_HI %d9 +#define EREG_CALC_RESULT %e8 +#define EREG_CALC_RESULT_HI %d9 +#define EREG_CALC_RESULT_LO %d8 +#define EREG_CORRECT_RESULT_LO %d0 +#define EREG_CORRECT_RESULT_HI %d1 + /* Test case wrappers */ #define TEST_CASE(num, testreg, correct, code...) \ test_ ## num: \ @@ -27,6 +39,15 @@ test_ ## num: \ mov DREG_TEST_NUM, num; \ jne testreg, DREG_CORRECT_RESULT, fail \ +#define TEST_CASE_E(num, correct_lo, correct_hi, code...) \ +test_ ## num: \ + code; \ + mov DREG_TEST_NUM, num; \ + LI(EREG_CORRECT_RESULT_LO, correct_lo) \ + jne EREG_CALC_RESULT_LO, EREG_CORRECT_RESULT_LO, fail; \ + LI(EREG_CORRECT_RESULT_HI, correct_hi) \ + jne EREG_CALC_RESULT_HI, EREG_CORRECT_RESULT_HI, fail; + #define TEST_CASE_PSW(num, testreg, correct, correct_psw, code...) \ test_ ## num: \ code; \ @@ -57,7 +78,13 @@ test_ ## num: \ insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2; \ ) - +#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); \ + LI(EREG_RS1_HI, rs1_hi); \ + LI(DREG_RS2, rs2); \ + insn EREG_CALC_RESULT, EREG_RS1, DREG_RS2; \ + ) /* Pass/Fail handling part */ #define TEST_PASSFAIL \ diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target index a9b81545e2..799b51191e 100644 --- a/tests/tcg/tricore/Makefile.softmmu-target +++ b/tests/tcg/tricore/Makefile.softmmu-target @@ -6,6 +6,7 @@ ASFLAGS = TESTS += test_abs.tst TESTS += test_bmerge.tst TESTS += test_clz.tst +TESTS += test_dvstep.tst QEMU_OPTS += -M tricore_testboard -nographic -kernel diff --git a/tests/tcg/tricore/test_dvstep.S b/tests/tcg/tricore/test_dvstep.S new file mode 100644 index 0000000000..858dbc62dd --- /dev/null +++ b/tests/tcg/tricore/test_dvstep.S @@ -0,0 +1,15 @@ +#include "macros.h" +.text +.global _start +_start: + # Result RS1 RS2 + TEST_E_ED(dvstep, 1, 0x000001ff, 0xfffe5cff, 0x00000001, 0xfffffe5c, 0x0) + TEST_E_ED(dvstep, 2, 0x00000000, 0x000000ff, 0x00000000, 0x00000000, 0x0) + TEST_E_ED(dvstep, 3, 0x0000f000, 0x000000fd, 0x010000f0, 0x00000000, 0x0) + TEST_E_ED(dvstep, 4, 0xfffff000, 0x00000000, 0x7ffffff0, 0x00000000, 0x0) + TEST_E_ED(dvstep.u, 5, 0xffffff00, 0x100008ff, 0xffffffff, 0x00100008, 0x0) + TEST_E_ED(dvstep.u, 6, 0x00000100, 0x00000000, 0x08000001, 0x00000000, \ + 0xffffff2d) + + TEST_PASSFAIL +