From patchwork Mon May 17 16:10:06 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: 440148 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1233422jac; Mon, 17 May 2021 09:17:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV0OWKluIg5oa1U++NwJzlUWnrWc2ixjr3vURIDoFBIypxpSEhBQcaWv4vcF82NYf153Xr X-Received: by 2002:a05:6602:2cd5:: with SMTP id j21mr631634iow.83.1621268265051; Mon, 17 May 2021 09:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621268265; cv=none; d=google.com; s=arc-20160816; b=Fxb+YRxYKNXT0GnZ6FMtWZhlRpbrcXn/vAN2nUN0CpLo3VbAsfYBOo/Y9yuDA2T7Ey 4WmauiZynAQD6UbuujhX0qwwa8WzljI8+/oYfO34H2BkniBs+Ac3jv+1dExm7XtAVFH+ 5h7D4KrffztawiuQkNW1bo7CSCvbu13SomYdTDWvCAlnHfRWo8Zb6XUkHP4UAOfrTI04 grCUNFeea4I1gbEijVTKzW6lN3TtAQwu7LA+LXEfh1zWE8NdFQHOhbPsdZImN3gwRnCf uHOXYxlC6EDiFHRpAjSfRoCs/+bE0TkE/0eoPwDQSGzOALMkwiDS6WK1+flMctFPnsq4 z5mw== 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=zqqVEkVFFAX35vmalm2I3V2tABfps9c4RcLK3dBbjx4=; b=TWiOXKesbCBEde8hNGc4rVURqrA8onVvnAWgRVUTxQnhKWsPaBN0Qa+dCWAZCcXUnI jkWRQN9T9va5FoQFhO/zFIrQn8jQCt4kpT15cDS8jN1sATD2oB91w1cSHNB0dzrOQ6mB dRGzqTZyK2QgIZ/6nDP0hPxfguR7nscWMa04TGgY8xU0eqh7cwdxt7c1uZrPYPZ4he4f n0Ejdk4HZ4+2J+xartMVbybFvRQiuMVaDmE9j0gWt3qdSoNujx0xPrrLITzQzrT+oRG1 zQP/zw5NlAb9bwmRJSWQi+w2pLUQ6bfQ43USwmuAhCVMuRNEYMhEx8+RWplwF4al9hyN aVOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=R6l4Og+d; 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 t2si17131161ilq.112.2021.05.17.09.17.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 May 2021 09:17:45 -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=R6l4Og+d; 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]:52086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lifw8-0004Wc-G8 for patch@linaro.org; Mon, 17 May 2021 12:17:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lifpa-0007ZR-RT for qemu-devel@nongnu.org; Mon, 17 May 2021 12:10:58 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:45781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lifpJ-00064X-88 for qemu-devel@nongnu.org; Mon, 17 May 2021 12:10:58 -0400 Received: by mail-wr1-x434.google.com with SMTP id h4so6983154wrt.12 for ; Mon, 17 May 2021 09:10:40 -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=zqqVEkVFFAX35vmalm2I3V2tABfps9c4RcLK3dBbjx4=; b=R6l4Og+dx6cpayXEZk0Z2ri5kjCAy3UWqpK0TdkXjCnGANBHk+mFYQQNmXT1I7/WW8 p1h6V5Y2CrUSr8fJJyXYQu5GK3+wdtIoFSfyvcPPcxvbW61L5jaZH/lQnFLqyW2jnXjP Wkhjx2Ec2Ok+ExoX4QHRxuyarzGCAwGpMHPYmYYz64ej0TLVpbBMWtVgeNpGgkXfnJhh tpTtpHvFNb5manR6p/jTYJ90GoQOfjgvzfwTXalTREdw/Zwv0gLXNlf6scqvgc3CDbvj ZKKd0hnWQ43s6PqDcrd8NG0LP7PzMUnoUmy7m7lLVwBdT0rkD6PiIL/4zCBr10+d0ZQZ xJeA== 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=zqqVEkVFFAX35vmalm2I3V2tABfps9c4RcLK3dBbjx4=; b=Pjo6UOHPPTMwjk/kahtzuTaRGBL7izFHEmRL0oVPViP9mQzqyq8Xlh2huD0TL6YHoJ X+/l6L4jqmE+OPdbamjle60VQOADKVnQKSgGpriZLfOtnSWlojrX7tYdMSf6UJ2oQ2qm /Kloeug9BPllNzy8cWg3M0PvgwsZgMHNfp2fx2Hhf8e2fRbADdPQPtU6EOe3bWnz3qzG s70Sjy7BfTJrW/we4nzh+Fq+SjMxI1+PvybIFFIlRqiVg9LrjrVPYZaYBK4jSBj7MVwy p1xUwhi9AN62ZDp+rYgqOjbJ7niu49fiqWSEsUbnpyzKzc4WgvWOJ7i7daa4nbwqqls2 Vnuw== X-Gm-Message-State: AOAM530GKEQ3hUu/1dt2K62yFXmpVajzRGNIUjxZQy4DvO/4aWKQYtNo SwazaY1S2Mc4ooFjifuuHSZtaw== X-Received: by 2002:adf:f043:: with SMTP id t3mr519846wro.344.1621267839391; Mon, 17 May 2021 09:10:39 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f26sm13801807wmj.30.2021.05.17.09.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 09:10:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5DA251FF9C; Mon, 17 May 2021 17:10:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 13/29] tests/tcg/tricore: Add bmerge test Date: Mon, 17 May 2021 17:10:06 +0100 Message-Id: <20210517161022.13984-14-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::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.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: Bastian Koppelmann , =?utf-8?q?Alex_Be?= =?utf-8?b?bm7DqWU=?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Bastian Koppelmann Signed-off-by: Bastian Koppelmann Signed-off-by: Alex Bennée Tested-by: Alex Bennée Message-Id: <20210305170045.869437-8-kbastian@mail.uni-paderborn.de> Message-Id: <20210512102051.12134-18-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h index 76c133132a..52aa936c56 100644 --- a/tests/tcg/tricore/macros.h +++ b/tests/tcg/tricore/macros.h @@ -8,7 +8,10 @@ #define TESTDEV_ADDR 0xf0000000 /* Register definitions */ #define DREG_RS1 %d0 +#define DREG_RS2 %d1 #define DREG_CALC_RESULT %d1 +#define DREG_CALC_PSW %d2 +#define DREG_CORRECT_PSW %d3 #define DREG_TEMP_LI %d10 #define DREG_TEMP %d11 #define DREG_TEST_NUM %d14 @@ -24,6 +27,17 @@ test_ ## num: \ mov DREG_TEST_NUM, num; \ jne testreg, DREG_CORRECT_RESULT, fail \ +#define TEST_CASE_PSW(num, testreg, correct, correct_psw, code...) \ +test_ ## num: \ + code; \ + LI(DREG_CORRECT_RESULT, correct) \ + mov DREG_TEST_NUM, num; \ + jne testreg, DREG_CORRECT_RESULT, fail; \ + mfcr DREG_CALC_PSW, $psw; \ + LI(DREG_CORRECT_PSW, correct_psw) \ + mov DREG_TEST_NUM, num; \ + jne DREG_CALC_PSW, DREG_CORRECT_PSW, fail; + /* Actual test case type * e.g inst %dX, %dY -> TEST_D_D * inst %dX, %dY, %dZ -> TEST_D_DD @@ -35,6 +49,16 @@ test_ ## num: \ insn DREG_CALC_RESULT, DREG_RS1; \ ) +#define TEST_D_DD_PSW(insn, num, result, psw, rs1, rs2) \ + 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; \ + ) + + + /* Pass/Fail handling part */ #define TEST_PASSFAIL \ j pass; \ diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target index 3b048e49fa..de6a2cc88e 100644 --- a/tests/tcg/tricore/Makefile.softmmu-target +++ b/tests/tcg/tricore/Makefile.softmmu-target @@ -4,6 +4,7 @@ LDFLAGS = -T$(TESTS_PATH)/link.ld ASFLAGS = TESTS += test_abs.tst +TESTS += test_bmerge.tst QEMU_OPTS += -M tricore_testboard -nographic -kernel diff --git a/tests/tcg/tricore/test_bmerge.S b/tests/tcg/tricore/test_bmerge.S new file mode 100644 index 0000000000..8a0fa6d3f6 --- /dev/null +++ b/tests/tcg/tricore/test_bmerge.S @@ -0,0 +1,8 @@ +#include "macros.h" +.text +.global _start +_start: + TEST_D_DD_PSW(bmerge, 1, 0x555557f7, 0x00000b80, 0x0000001d, 0x0000ffff) + + TEST_PASSFAIL +