From patchwork Mon Apr 19 14:54:29 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: 424018 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp2806204jaf; Mon, 19 Apr 2021 08:12:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrUlpIKL9WsRLnzOShNKu5Z1uXRVho4COJQAEy9t3JfuJtd6DCeNr22Z/lU0dts41agUbR X-Received: by 2002:a92:c7a2:: with SMTP id f2mr18796145ilk.190.1618845146660; Mon, 19 Apr 2021 08:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618845146; cv=none; d=google.com; s=arc-20160816; b=jFR0WZ+GCeKZW6KTClr6SnPtRjr2EnNAgwrknx/Wie7lzWDrl0cXyfkE4yvhOIu7kD ySl0cM/ylfqd8A8qQvdaVq2xbvUWRSmhTNBpbw1kaXJKAJSZwffjX8mYk/PveO6t1VDr JcflsPnPMszO6KPCNNqVtezCdJQCryRanz0grCpQHgn5T4X3FAcGtGNYSPSDBKuTgDSY WslYCxWQ7LoPBLy/O4wkC8gXkwU4uIISTqyxWQmOCyNzXbRKoq3IPzpl6XEzB9Fo379s c0U6Y4X6DvcWRyfH/f/Riz15IMClszjYWwLWpk6Xb9lSaSzz5RotSyZAL/JkG8wOVAQZ MZmA== 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=msEx9ljlWhDf1/vW/dw/1Ljno8pnteuQokqwLzYCJNA=; b=ijQSPDpXUT9KTvb23ayiwLSHyhJDGDjIq9qAIjlV13j8kJTLIbv3YJi/SH6oDqdRQ1 CekfCWWOkCA3tobSHm6M2s6SGaf0aqkNzdZxsl4Vg1f1dSq+MF9tInOmdSiws6rM95OV zdbxHgDPKOtQh1GF+o8mNPqedErSE+lwNa0FANl2A7DqshkMOnctEzx1oGg+KMJjefdm Cu3Flo7WNuNq/Bm+qVr2fJjn684Xf6lRdm9A6vLFuHDegDcI4ulDGteTJ2LaYWH/ChiZ OWLy/XqjMdj8RljTn1LPkoROSwuzfDLBQgb3Ori77gz+8Q/bCrVkVR8RwsDFYoWx6iBY VS5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IpLd9meR; 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 j2si3424032ioj.71.2021.04.19.08.12.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Apr 2021 08:12:26 -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=IpLd9meR; 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]:44418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYVZa-0000Of-33 for patch@linaro.org; Mon, 19 Apr 2021 11:12:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYVQL-0004Kb-Sf for qemu-devel@nongnu.org; Mon, 19 Apr 2021 11:02:54 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:40894) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYVQG-0002vB-06 for qemu-devel@nongnu.org; Mon, 19 Apr 2021 11:02:53 -0400 Received: by mail-wr1-x429.google.com with SMTP id e5so5742790wrg.7 for ; Mon, 19 Apr 2021 08:02:47 -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=msEx9ljlWhDf1/vW/dw/1Ljno8pnteuQokqwLzYCJNA=; b=IpLd9meRf9w6v1P5LtqUJs9g/+u9/g55yG3QeivpTfD38R8eetqZCxmgtVbzKUgG2C ITAUvZiX2il3VJQ+3JJjIMaGiPyvGAwtSPnVRzyU5k+sjK/mFcYZlPx/0LU43yE8bzs5 lAkQz8nSkksn+ZAlDezNQYdWlojEGYO/N1LqR8C8q3FAEi9tHafi+i5URahj/blR1Oe8 pAQqMxX82MRvNSCbjtuAdvfarr4JGaJqoW/++nE8v2SZoB0uHXUyszJAzDbwf5YOXohR KUHXlcUMeq0z7Dr790JXhc0fAubH4pLHYNweA4Qk353fJowq02Nsn1WbDKihvW0JxKxB cNdg== 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=msEx9ljlWhDf1/vW/dw/1Ljno8pnteuQokqwLzYCJNA=; b=uQMUqnriKm1cs1KVz5gcWH6+Vyb4wjIwhxuKelZ+Z/Gu/8X3eUYm4PhPpBnZjC42dZ TEIRe+YuPbtLyx6phXWU3GLFqRk8U9w7omyuzj+/pgMw1Y8KPfZmht9cU6zumJy62do0 VJ3MMeMhAskRW5NlY64rvOYCW4sSDeTDkEw5TUCGjzrvU44Ofk6ULcops9y7pj5DGf4f NZvxgAdsrjFeh2djfh7f+NPIevWWVY/QkeJNvyjWI5WSon2mOqlRqVgmOyW++V+Zfv1O 2unuJSC/HCnUbZTSctNZgfMMMGp2ewTCQ/MvpI8cJUHjXemPGBS2emVZnvXPJ3EDxp3B djsw== X-Gm-Message-State: AOAM533HMVsbD7Z3qiDcnHTCHfTkuqo4CeGlSSifNUdm/MKM5sZDUa3C odGk2U1IuFbNlAZGLmoK2DbOOw== X-Received: by 2002:adf:9d88:: with SMTP id p8mr6827005wre.138.1618844566516; Mon, 19 Apr 2021 08:02:46 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 24sm22309029wmk.18.2021.04.19.08.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 08:02:44 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7D6ED1FFA6; Mon, 19 Apr 2021 15:54:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 19/25] tests/tcg/tricore: Add dvstep test Date: Mon, 19 Apr 2021 15:54:29 +0100 Message-Id: <20210419145435.14083-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210419145435.14083-1-alex.bennee@linaro.org> References: <20210419145435.14083-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.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 + .../tcg/tricore/Makefile.softmmu-target.orig | 1 + tests/tcg/tricore/test_dvstep.S | 15 ++++++++++ 4 files changed, 45 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/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig index de6a2cc88e..a9b81545e2 100644 --- a/tests/tcg/tricore/Makefile.softmmu-target.orig +++ b/tests/tcg/tricore/Makefile.softmmu-target.orig @@ -5,6 +5,7 @@ ASFLAGS = TESTS += test_abs.tst TESTS += test_bmerge.tst +TESTS += test_clz.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 +