From patchwork Tue Oct 3 17:30:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 728777 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp2264089wrt; Tue, 3 Oct 2023 10:42:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEP/0lENtnI9sJCZG0FYPZcCVDW3XV7nOT2zjmxv8CEgU242wveKQH7VcvT+O/oBJfnR5kj X-Received: by 2002:ac8:5b02:0:b0:406:9531:f894 with SMTP id m2-20020ac85b02000000b004069531f894mr152603qtw.54.1696354920156; Tue, 03 Oct 2023 10:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696354920; cv=none; d=google.com; s=arc-20160816; b=CuDeqOGCQbDpn/MvK1cDsLcePCpLzQ93YzfbyzK2D2aTP4KFMwlgHdZhTUntl06KRJ I2GQeBG23yix/o0DcDqqQbhlyRJCkA7qqnbENT+ydxlQ0D+ENkCpd5ofZ0Rwl2oaq+QB 6H8QHIQa6di2Shx/E2ysnMZiucbNoEf8ERy+xS7R2xdxypw4ZJKHLwfI0S0sMKQ4Ctew BGZhR7k+SzgGRaRnZVbHXAlr6snyMxAf7k1f5R8OpdQSSJZk0T8Ubtts+RnQehWE63W6 hsf7T1Gg8DFykaLyF0sy27c3jKJ8hj+m5iyQ1wR17EZsccTGpkGuIn1HawjJ2QFb6LsP S5UQ== 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=iHAgjLxRSILFNC2pEep3xi2eIcOstWehORC+CAofXOs=; fh=ebn4iEHkJLazwl1W/B1Pd+g/vF+piIF9CBdMj7/8Rww=; b=HGamo+mcQjF4cyLCFFp1Ax5RNtq1ftTWD9qaGIxqmb0vcN+QWCN9lKuoL5OQWk+Fv3 qUI7wdgGmgKs17WRsaHFoZIglRZTHpFrBJddQTAzZ7M7YP+q4oez8Q6a/8v50OsAP4QB 3ZMvzCBJt3dyYnDDYSVOD7c7+9jFKQKy9D03XvmuPFR9/uIhVU1Nsbb64O2OLWAKYT2H pZSP2t9P2x94k/guZ6Ha28a32ynjKTgCwFuvgocjLeRjQLCpN6XlietF9Ri7mgvo7fFF PdYNgehjqlp9dHUfhinTy7fRZA131TePEW0UPT8uT2oNQwg4Phul2pqmL6iaudxT5AvH Q/Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lDtrZZjv; 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 l9-20020a05622a050900b00417d075d66esi734830qtx.5.2023.10.03.10.41.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2023 10:42:00 -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=lDtrZZjv; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnjIZ-0000Kz-QM; Tue, 03 Oct 2023 13:35:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnjIL-0000Cq-3H for qemu-devel@nongnu.org; Tue, 03 Oct 2023 13:34:54 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qnjIE-0007td-Hq for qemu-devel@nongnu.org; Tue, 03 Oct 2023 13:34:52 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1bf55a81eeaso9455355ad.0 for ; Tue, 03 Oct 2023 10:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696354485; x=1696959285; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iHAgjLxRSILFNC2pEep3xi2eIcOstWehORC+CAofXOs=; b=lDtrZZjvk1BxEG2jwnCMDq3KAwCbAqTrW/sNIHaqpfFiQu8Q0jIz51zWWMwDbngiLl 3kTdYCU60ioXv5cwkN0W5cgF75cI52ieVb7jmOuc/B/g26+1//W2NZ2yj2jUwbMEHgpS Gd2N9vV/wsoo6xfZja1L2BJdtssVyyXsQw6ryzAxb35NQeuabxJVMBBHxYIpHdNcFJoy 40p1gzguxRnaciJgwkuhUbXa3fe3O866zLkXYZszQc+9Xd59aCll9iyBznsh98Sy/JAe 1k5+vDEZrediIwfxzAAGQ7nbg+sf6v2fOqawsOdg4TcA6Y360rDR7JGwfN6aecLzJ29m YIJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696354485; x=1696959285; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iHAgjLxRSILFNC2pEep3xi2eIcOstWehORC+CAofXOs=; b=wv4Svqc5bQkOYyKNiVVVtcd+u6hNuxKJ5GuC5/meNgDrcvsnExq24RmUk4A0Li3JCb b3oPx4xFwzJ+OIhVSchGbys5wOjTZLh9M1pp7XZAIVdCA8bKPo0zMDFpJGZjQJpd4sk0 X/TMRAJRJKmBaG9kelRzvNXXBA8omw2KpVqpSJflJiKkb8zvOVNWZMnFOzcUnQvTOOro vhbK3lO3ZiThYDqlKvBNHNozSsnlajNpzTNgliebEdedX5os5uWg2rNuE5OQ/sf5vhEa RoiRv1JO80w21o2QAWr2FL40vY6TiQqLDYvGIq06o+U9YibXLRaJUzbJh+Zp56BJTlTd /17w== X-Gm-Message-State: AOJu0Yzj3gZWqiPSqMgK+BjtQEmEpGDTRbmafT2CSwiI9SvtkB9zoRBd +TlVsoGjbq1C9izladXEPzPyn8XSaFBQU8CmHUc= X-Received: by 2002:a17:902:ec85:b0:1c4:749e:e725 with SMTP id x5-20020a170902ec8500b001c4749ee725mr334519plg.0.1696354485132; Tue, 03 Oct 2023 10:34:45 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id y9-20020a17090322c900b001bc676df6a9sm1855118plg.132.2023.10.03.10.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 10:34:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: gaosong Subject: [PULL 47/47] tcg/loongarch64: Fix buid error Date: Tue, 3 Oct 2023 10:30:52 -0700 Message-Id: <20231003173052.1601813-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231003173052.1601813-1-richard.henderson@linaro.org> References: <20231003173052.1601813-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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, T_SPF_TEMPERROR=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-bounces+patch=linaro.org@nongnu.org From: gaosong Fix: In file included from ../tcg/tcg.c:735: /home1/gaosong/bugfix/qemu/tcg/loongarch64/tcg-target.c.inc: In function ‘tcg_out_vec_op’: /home1/gaosong/bugfix/qemu/tcg/loongarch64/tcg-target.c.inc:1855:9: error: a label can only be part of a statement and a declaration is not a statement TCGCond cond = args[3]; ^~~~~~~ Signed-off-by: gaosong Message-Id: <20230926075819.3602537-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 68 ++++++++++++++++---------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index b701df50db..8f7091002b 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -1852,43 +1852,45 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, tcg_out_opc_vnor_v(s, a0, a1, a1); break; case INDEX_op_cmp_vec: - TCGCond cond = args[3]; - if (const_args[2]) { - /* - * cmp_vec dest, src, value - * Try vseqi/vslei/vslti - */ - int64_t value = sextract64(a2, 0, 8 << vece); - if ((cond == TCG_COND_EQ || cond == TCG_COND_LE || \ - cond == TCG_COND_LT) && (-0x10 <= value && value <= 0x0f)) { - tcg_out32(s, encode_vdvjsk5_insn(cmp_vec_imm_insn[cond][vece], \ - a0, a1, value)); - break; - } else if ((cond == TCG_COND_LEU || cond == TCG_COND_LTU) && - (0x00 <= value && value <= 0x1f)) { - tcg_out32(s, encode_vdvjuk5_insn(cmp_vec_imm_insn[cond][vece], \ - a0, a1, value)); - break; + { + TCGCond cond = args[3]; + if (const_args[2]) { + /* + * cmp_vec dest, src, value + * Try vseqi/vslei/vslti + */ + int64_t value = sextract64(a2, 0, 8 << vece); + if ((cond == TCG_COND_EQ || cond == TCG_COND_LE || \ + cond == TCG_COND_LT) && (-0x10 <= value && value <= 0x0f)) { + tcg_out32(s, encode_vdvjsk5_insn(cmp_vec_imm_insn[cond][vece], \ + a0, a1, value)); + break; + } else if ((cond == TCG_COND_LEU || cond == TCG_COND_LTU) && + (0x00 <= value && value <= 0x1f)) { + tcg_out32(s, encode_vdvjuk5_insn(cmp_vec_imm_insn[cond][vece], \ + a0, a1, value)); + break; + } + + /* + * Fallback to: + * dupi_vec temp, a2 + * cmp_vec a0, a1, temp, cond + */ + tcg_out_dupi_vec(s, type, vece, temp_vec, a2); + a2 = temp_vec; } - /* - * Fallback to: - * dupi_vec temp, a2 - * cmp_vec a0, a1, temp, cond - */ - tcg_out_dupi_vec(s, type, vece, temp_vec, a2); - a2 = temp_vec; - } - - insn = cmp_vec_insn[cond][vece]; - if (insn == 0) { - TCGArg t; - t = a1, a1 = a2, a2 = t; - cond = tcg_swap_cond(cond); insn = cmp_vec_insn[cond][vece]; - tcg_debug_assert(insn != 0); + if (insn == 0) { + TCGArg t; + t = a1, a1 = a2, a2 = t; + cond = tcg_swap_cond(cond); + insn = cmp_vec_insn[cond][vece]; + tcg_debug_assert(insn != 0); + } + tcg_out32(s, encode_vdvjvk_insn(insn, a0, a1, a2)); } - tcg_out32(s, encode_vdvjvk_insn(insn, a0, a1, a2)); break; case INDEX_op_add_vec: tcg_out_addsub_vec(s, vece, a0, a1, a2, const_args[2], true);