From patchwork Tue Jul 19 17:59:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 591676 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5817:0:0:0:0 with SMTP id j23csp4224487max; Tue, 19 Jul 2022 11:23:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sDNaAThTlN6lPwKJSJMfGFNIOLsq9AcqG9B4x924tetlVuKK5VJtVbwxNhvPZ4gz25JqVl X-Received: by 2002:a05:6214:2428:b0:473:5e3a:c66b with SMTP id gy8-20020a056214242800b004735e3ac66bmr26368088qvb.57.1658254992664; Tue, 19 Jul 2022 11:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658254992; cv=none; d=google.com; s=arc-20160816; b=o3I52jSVqRCsJpkM95gAAcU08s/9V9iplHQ+hpoh2UF6xMrsqW4nEMz/h+GIGWtoRO OwSw/78JKeiBxtB4tc/biPyILXEIM1xq3+6IPSEfImzfKmk2IwS544wQ4wnUuJHhO7lU z2enNfmXSBDYEvD9ME9EkrwVitVo8BO+Jklsx1pY+8wTRMdVyvIj1GraLyy0o6tc5nu5 PWRKDUSfv/6sJk9P+r9lvF6oinAdnKfwDCX7EWv7j2jq6FbGVtiIeBg4VBrj18CeEzzf Wh2wfODTyft70PrwPg8yLZvcRw4GK5snLHRD33yNEykRYGnd412LrtJqQvemA38fV4h7 39fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=sGdHWNOdW2WrHLjWLIrMnoyjBp9QciCdh5JHta0OwMs=; b=AOwNS3TruspKpZw6OpAomb5wXcuyvKa/lFyUjr91GJVNGcxWM5G/at1AEQSSo6PGUE R807ATOgcYCh1+SoHPf9NjV8xXpM3bMbCigkY9tOgrtC6QieW2/H6mVFiO08GX+v/A3l KWaXesx4Q+5k4jwEAGxkLLIk1rWy4tnfWytNNO0eF3wh+m2rHXwYF38U1cSB0IL9Yjeg 3YtV+vOq8hxM+OsAVs9LcpCMHWbNOxiLJ6tBhosMcQOQzxSuNWTgqIaeObBlbfJNLxe/ yIsPGUEpZvbLSU4lhBL1y9oraJEdpprFHfh7BW0wsLHGX3xCMS8dTKs13k/wjrxJgr+B nSVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vuTIkwGI; 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=pass (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 ed9-20020ad44ea9000000b004732654062dsi1524424qvb.138.2022.07.19.11.23.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Jul 2022 11:23: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=pass header.i=@linaro.org header.s=google header.b=vuTIkwGI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDrsG-0002jk-Ak for patch@linaro.org; Tue, 19 Jul 2022 14:23:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDrWw-00077H-SX for qemu-devel@nongnu.org; Tue, 19 Jul 2022 14:01:10 -0400 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]:40625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDrWv-0006Gk-AK for qemu-devel@nongnu.org; Tue, 19 Jul 2022 14:01:10 -0400 Received: by mail-oi1-x231.google.com with SMTP id r191so7823862oie.7 for ; Tue, 19 Jul 2022 11:01:08 -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=sGdHWNOdW2WrHLjWLIrMnoyjBp9QciCdh5JHta0OwMs=; b=vuTIkwGIKJpRtxVLhFUBaTAOrNbWg3ZkSjAKJ1aFw0NaZTMKQWqXNBt3lkmJfccQpX 5sIenHu4i7ZY6W6fl036smFbnkcsOH07Y3heiFea5NYg7iJQ7TQyVjKw0Q+48PWKw5XT +fYxltmk9ZRNcQDwuVj+g0vApC9jrVMsWBsY5tt451xNTVhKAPvVCsbCETIDkm1v8Nbp MbgSA3lkf9Ly+0PCamc3yN779FJpcJjFojik1TXP/b8V4LZ2u3xU8jBJIzC/rlXUF7M6 nC8KpBnlCljtdUzFsuxESx+PryH+s6MogB5VqQeZFKK6qXUdlnAwsVkSjpOMxSF1BkXB XsRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sGdHWNOdW2WrHLjWLIrMnoyjBp9QciCdh5JHta0OwMs=; b=fgFWh1BsdzdcloIodKZuHKGh4/5zi8e1L03N36JVR2X7iUxn4ZzYjuSoXNGDktTJfI L9UnGfBMlWrq2IZMGu8eH86eQdJ3EbdNvnHJk5mbbySMG64RDjSzyiY7tUj/HOgMJlze VYQFQ2TdNktROdTdgmJYBptYWZYd1ziFeuFPPsdZDABGThYdqHOmAEb3bwICnkSZUAiG j03wTJ8bCsmNV7nOPqjDxRFR7BXgEmcq6whFYhlgne01TwD+KuCFbliKVx3kbN267Q3y uJrfVKhT2uTm3D7xAKV8sK3kB9jaZyR1jbWOQnB+2SfPG+AyWU6aDJoA384/oZubPWz8 tFvw== X-Gm-Message-State: AJIora+0czrNK3D1PySmvmxSinB7gcEXwLP0Zeo0zHgYpy25YvZE8V3C oGSuI278hdYXvQXK8pm7NZZXE7edy5aXm4ut X-Received: by 2002:a05:6808:169e:b0:331:522a:4521 with SMTP id bb30-20020a056808169e00b00331522a4521mr306761oib.293.1658253668146; Tue, 19 Jul 2022 11:01:08 -0700 (PDT) Received: from stoup.. ([172.58.110.182]) by smtp.gmail.com with ESMTPSA id c25-20020a4ae259000000b0035eb4e5a6cesm6286747oot.36.2022.07.19.11.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 11:01:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Song Gao Subject: [PULL 14/21] tests/tcg/loongarch64: Add fp comparison instructions test Date: Tue, 19 Jul 2022 23:29:53 +0530 Message-Id: <20220719180000.378186-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220719180000.378186-1-richard.henderson@linaro.org> References: <20220719180000.378186-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::231; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x231.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Song Gao Choose some instructions to test: - FCMP.cond.S - cond: ceq clt cle cne seq slt sle sne Signed-off-by: Song Gao Message-Id: <20220716085426.3098060-8-gaosong@loongson.cn> Signed-off-by: Richard Henderson --- tests/tcg/loongarch64/test_fpcom.c | 37 +++++++++++++++++++++++++++ tests/tcg/loongarch64/Makefile.target | 1 + 2 files changed, 38 insertions(+) create mode 100644 tests/tcg/loongarch64/test_fpcom.c diff --git a/tests/tcg/loongarch64/test_fpcom.c b/tests/tcg/loongarch64/test_fpcom.c new file mode 100644 index 0000000000..9e81f767f9 --- /dev/null +++ b/tests/tcg/loongarch64/test_fpcom.c @@ -0,0 +1,37 @@ +#include + +#define TEST_COMP(N) \ +void test_##N(float fj, float fk) \ +{ \ + int rd = 0; \ + \ + asm volatile("fcmp."#N".s $fcc6,%1,%2\n" \ + "movcf2gr %0, $fcc6\n" \ + : "=r"(rd) \ + : "f"(fj), "f"(fk) \ + : ); \ + assert(rd == 1); \ +} + +TEST_COMP(ceq) +TEST_COMP(clt) +TEST_COMP(cle) +TEST_COMP(cne) +TEST_COMP(seq) +TEST_COMP(slt) +TEST_COMP(sle) +TEST_COMP(sne) + +int main() +{ + test_ceq(0xff700102, 0xff700102); + test_clt(0x00730007, 0xff730007); + test_cle(0xff70130a, 0xff70130b); + test_cne(0x1238acde, 0xff71111f); + test_seq(0xff766618, 0xff766619); + test_slt(0xff78881c, 0xff78901d); + test_sle(0xff780b22, 0xff790b22); + test_sne(0xff7bcd25, 0xff7a26cf); + + return 0; +} diff --git a/tests/tcg/loongarch64/Makefile.target b/tests/tcg/loongarch64/Makefile.target index 59d564725a..b320d9fd9c 100644 --- a/tests/tcg/loongarch64/Makefile.target +++ b/tests/tcg/loongarch64/Makefile.target @@ -13,5 +13,6 @@ LDFLAGS+=-lm LOONGARCH64_TESTS = test_bit LOONGARCH64_TESTS += test_div LOONGARCH64_TESTS += test_fclass +LOONGARCH64_TESTS += test_fpcom TESTS += $(LOONGARCH64_TESTS)