From patchwork Fri Jun 4 18:35:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454152 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp661995jae; Fri, 4 Jun 2021 11:35:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj3/z+ZKnOybi3sSU7kLIlv1w/lqOnadO3hHfDu+vGdm1klotDQ64tPRX/6w9QWV8Lr3sw X-Received: by 2002:a05:6638:12c1:: with SMTP id v1mr2207669jas.97.1622831753503; Fri, 04 Jun 2021 11:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622831753; cv=none; d=google.com; s=arc-20160816; b=QVUEZ5eShRnPyp87PKliKhSt543YzUW1+6amcrqhT1HTHNWT7NL/BBynZokobuW2Rz 2k0M15IbNYor1BcqNE9Kua5JNe6Mp+QclD+F0+HCDG95cAtqPF0x4pYZLRb+LVtz7aBk 4nxms2ZMtHKmVeQrAebSj6FCrY2TNnNWtdMY013fd/mirfKGSLHbSVze/Hct8myiv7gS ImSO+9IdYPIaLZi9CkDNcarkyX5V07kqY27tzi5QyGW6+Wpxsq+pZYU1gTxLqp6Nw1VP 7y/+VMWSOCErOt934zUJPgIKcQfC21t77Go2Ahbt4ZB2bv5SD9H3gdSIGRHJlS1/V5ON vdRQ== 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=X+8qtmFFIjwvz+51Kl21uuhzPS5UApPgPi1mRnqjng8=; b=srnvphoymhEkRdXmSDX4Brn8ZfZxNCjp3ZXutUlatTyEKhbi/iHjaQp7Ztdoe7frDv oPqGZbAetxjM/WFpUCbqECuvQRmIWmLpvKA6U+g5DyXOQTpqCrFM8Xrx9MWtnuXbXJO8 NKBm2Km2RWPw2EJ8gG66iNib1Ea2ybVeKKdxgWWy/6xCYxU6LyCb5L5d/p6BIqb6fCk8 ZLu//ppReFXROTtlzPqUAksMRu44DRHarPWFUGuP1Bsqb7jab9IpQ96t6aq8QD4m1shg mClIVNRXCuP7KekHayEFdesuRUV6Jo94NXjHvUNZo7jbfDH3iHpFlFZfTxApTfYq/YHl Yj2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EkngAqwx; 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 f5si7358246ils.127.2021.06.04.11.35.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 11:35:53 -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=EkngAqwx; 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]:38658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpEfg-00078s-Uy for patch@linaro.org; Fri, 04 Jun 2021 14:35:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpEf6-000767-Ot for qemu-devel@nongnu.org; Fri, 04 Jun 2021 14:35:16 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:38554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpEf1-0000x8-I3 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 14:35:16 -0400 Received: by mail-pj1-x102b.google.com with SMTP id m13-20020a17090b068db02901656cc93a75so7934827pjz.3 for ; Fri, 04 Jun 2021 11:35:10 -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=X+8qtmFFIjwvz+51Kl21uuhzPS5UApPgPi1mRnqjng8=; b=EkngAqwxM2dkXK7YmApe7jOejznmjD4x/4QlJpa5mQ2YR98flPGgGxs+elH/WFRAm3 bZkDaanxJ+0Kbm90jTor9/PNEZ+s9pwLFn7Z2UZX6WafJ3Y4IhtfYu52rPFOaLLGRNhV 5v4WqFYIOXHXdyp2vJsE9CoppBE4fOEgy9z0QpdUX/PxS59lGgjRmwVK/08vHlkT5izz HHGbCIBReLNtZMYxVKFr+im2PZH1a5yo20qTzIs9q0LWduwlrBJYscikosIEsmk3HOp5 Cjwb7UVJ07LJy3aQ+bddkPBv+pOawZ1mq7SBFXQzdluN9p7jfHKqNNTWY50QitdzP99s Aq8Q== 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=X+8qtmFFIjwvz+51Kl21uuhzPS5UApPgPi1mRnqjng8=; b=IbcbMQ+EfrZmhxOCLs7nHuByoVxekpPc9bvwcCu4MW4BhQv8+xTtQA0ZZtjTfaKgwl ml9B5hgTiRXaiPmI+9ET6ULtDf1RXWSknc7AB68IGoYSyPoNTM2aOH9ou0qvavwZ/qFd mZLEfTXW3e+ShO6GjpqExI4yODc0eISk/5lEGQ14mSbUSKnuGGwDjGf6gk6e1FlRlhXu 2uq78aKgRk1xCW8mgH/FTd7ur2g5K7C8r1CW7MAsRlQzMEGbI0mB5d5qq6ncY1UlouzM vboxXrJhK0TPUizPNM1DeLX6M/Iju6Ynz09n6xhVSFi8PaSjx/rLTtNBxFGGC4FNv/Be Ycfw== X-Gm-Message-State: AOAM5322FAfOITVSNAFBua8z+PaEMU4dT9SpKhQwjwJxUfdCZs460A8+ R1bUxBtwZNiUL4vBqY6bmt5cq3KlHR4RnQ== X-Received: by 2002:a17:90b:4d11:: with SMTP id mw17mr18263244pjb.229.1622831709010; Fri, 04 Jun 2021 11:35:09 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id m2sm2620578pgu.85.2021.06.04.11.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 11:35:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/3] target/arm: Diagnose UNALLOCATED in disas_simd_three_reg_same_fp16 Date: Fri, 4 Jun 2021 11:35:06 -0700 Message-Id: <20210604183506.916654-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604183506.916654-1-richard.henderson@linaro.org> References: <20210604183506.916654-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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: qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This fprintf+assert has been in place since the beginning. It is after to the fp_access_check, so we need to move the check up. Fold that in to the pairwise filter. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 82 +++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 32 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 9bb15ca618..7f74d0e81a 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -11989,12 +11989,57 @@ static void disas_simd_three_reg_same(DisasContext *s, uint32_t insn) */ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn) { - int opcode, fpopcode; - int is_q, u, a, rm, rn, rd; - int datasize, elements; - int pass; + int opcode = extract32(insn, 11, 3); + int u = extract32(insn, 29, 1); + int a = extract32(insn, 23, 1); + int is_q = extract32(insn, 30, 1); + int rm = extract32(insn, 16, 5); + int rn = extract32(insn, 5, 5); + int rd = extract32(insn, 0, 5); + /* + * For these floating point ops, the U, a and opcode bits + * together indicate the operation. + */ + int fpopcode = opcode | (a << 3) | (u << 4); + int datasize = is_q ? 128 : 64; + int elements = datasize / 16; + bool pairwise; TCGv_ptr fpst; - bool pairwise = false; + int pass; + + switch (fpopcode) { + case 0x0: /* FMAXNM */ + case 0x1: /* FMLA */ + case 0x2: /* FADD */ + case 0x3: /* FMULX */ + case 0x4: /* FCMEQ */ + case 0x6: /* FMAX */ + case 0x7: /* FRECPS */ + case 0x8: /* FMINNM */ + case 0x9: /* FMLS */ + case 0xa: /* FSUB */ + case 0xe: /* FMIN */ + case 0xf: /* FRSQRTS */ + case 0x13: /* FMUL */ + case 0x14: /* FCMGE */ + case 0x15: /* FACGE */ + case 0x17: /* FDIV */ + case 0x1a: /* FABD */ + case 0x1c: /* FCMGT */ + case 0x1d: /* FACGT */ + pairwise = false; + break; + case 0x10: /* FMAXNMP */ + case 0x12: /* FADDP */ + case 0x16: /* FMAXP */ + case 0x18: /* FMINNMP */ + case 0x1e: /* FMINP */ + pairwise = true; + break; + default: + unallocated_encoding(s); + return; + } if (!dc_isar_feature(aa64_fp16, s)) { unallocated_encoding(s); @@ -12005,31 +12050,6 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn) return; } - /* For these floating point ops, the U, a and opcode bits - * together indicate the operation. - */ - opcode = extract32(insn, 11, 3); - u = extract32(insn, 29, 1); - a = extract32(insn, 23, 1); - is_q = extract32(insn, 30, 1); - rm = extract32(insn, 16, 5); - rn = extract32(insn, 5, 5); - rd = extract32(insn, 0, 5); - - fpopcode = opcode | (a << 3) | (u << 4); - datasize = is_q ? 128 : 64; - elements = datasize / 16; - - switch (fpopcode) { - case 0x10: /* FMAXNMP */ - case 0x12: /* FADDP */ - case 0x16: /* FMAXP */ - case 0x18: /* FMINNMP */ - case 0x1e: /* FMINP */ - pairwise = true; - break; - } - fpst = fpstatus_ptr(FPST_FPCR_F16); if (pairwise) { @@ -12152,8 +12172,6 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn) gen_helper_advsimd_acgt_f16(tcg_res, tcg_op1, tcg_op2, fpst); break; default: - fprintf(stderr, "%s: insn 0x%04x, fpop 0x%2x @ 0x%" PRIx64 "\n", - __func__, insn, fpopcode, s->pc_curr); g_assert_not_reached(); }