From patchwork Wed Jan 17 16:09:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 124840 Delivered-To: patch@linaro.org Received: by 10.46.62.1 with SMTP id l1csp104982lja; Wed, 17 Jan 2018 08:34:08 -0800 (PST) X-Google-Smtp-Source: ACJfBovf3MFzD3/XjqHisX/k+RCo55zyC4rN2y+WOQXNeqxQoSICNU4z4ykucZiwOAvDoCTcESk4 X-Received: by 10.37.219.144 with SMTP id g138mr31309559ybf.195.1516206848337; Wed, 17 Jan 2018 08:34:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516206848; cv=none; d=google.com; s=arc-20160816; b=NOQGNgJsvhsCdQdNnx6seHUltPrITHgz/NLcrmE3lZU7nuC+By9pRuT6IqBKlMnmRR 2Q1bJNAL2Tlhe+X7URlXHtFOMeMDBuhtSWBfyDiPFl0MxrGJ4fJvOWEML71G8TawQLZJ u4h+6/qVlQlCAV/MJIz4r5pNdrw7BIl/+ozvtSGz98sTerh6XB2Y65dDTMByDLJjMprP SSolZ7E+LdO/Oy+hx4zX9DiI66JUfppIoSbPSyfYDkx4J6VsyrXvZS257Kt4NOencZsx Ru4fOelhvu6kPnTG/V9QKjJWXd3cWYfJ5Ol+em+yw8kQO9W4I+0mDdlPQLPyDW4xhBxi IlIg== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=vwUcioa4aIYbkW7yILTXEtQO1bjKmCKAcVFBi0AQ/ws=; b=YRUpz6tuUMSBNpbLDVl4ho7L4bRoOmd93ipAUQwcsiXDxvyIEyuBNekXov8Wd1eo0p Lg5iO8tQ7RF3RQX4EYzIQ8TPLjqFJLsXOCt4e9WqVlRzai7U7a6zN3NVAwUuM+U8WMOW OQEMa1OsSaEJnVUmFi0ujjGWf47TsbA8v7Yx7jeEXekvmkW8RhCiYjrhv5ngpqriwkQI vJRJ6ZzhhLp4T483+FkaxZU21v+91Yxx1lQpEEp93sk3uLZjtmiRuOXIqAeJMv7K66YX n1DDpFY3iuXOzjVn0H1XwX1WfVWLpTBVj9KprFOf4qd8a5A9Vshr/3rzNgr/JgxJ/wHD QObw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZKPHTblU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w134si1326866ybb.114.2018.01.17.08.34.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 17 Jan 2018 08:34:08 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZKPHTblU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:45876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebqf9-0006MF-ME for patch@linaro.org; Wed, 17 Jan 2018 11:34:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebqHf-0001mx-Rl for qemu-devel@nongnu.org; Wed, 17 Jan 2018 11:09:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebqHc-0001GR-Lc for qemu-devel@nongnu.org; Wed, 17 Jan 2018 11:09:51 -0500 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:44586) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebqHc-0001Fo-G0 for qemu-devel@nongnu.org; Wed, 17 Jan 2018 11:09:48 -0500 Received: by mail-pl0-x243.google.com with SMTP id f8so7200420plk.11 for ; Wed, 17 Jan 2018 08:09:48 -0800 (PST) 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; bh=vwUcioa4aIYbkW7yILTXEtQO1bjKmCKAcVFBi0AQ/ws=; b=ZKPHTblUJMdv5SAnJ7C0/SOCLmFTGYcujt8nAG7CGoh+88zGMwfUraiIVQILo2X4cR YGK2VyV/qa/zCE/zaxfDaOIsESGUK0fYkuAJxvYUB7OW9YcncC4OqeqTwY4/vVO7Mmc8 UlH4xe04TqLgq0vsJptyHhFdKh0Ug0GkT3Py8= 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; bh=vwUcioa4aIYbkW7yILTXEtQO1bjKmCKAcVFBi0AQ/ws=; b=mqnKLQT0TX3V4blxGz4FzLY9SiWQ8wx62nIKyCOU1mjvIHon7TGZ7Rwe2CBIKriLWn eqqj+P7X4kB0NIj8lKy+5Sd3fKqhuaa+zpIyTyA1cYAML4VSgqV3VRGa8Z23szZ/JZ0+ S85L90ywzi8pkoRWfA0IFoBH8kzzqQf0ZqZjvfwvCGH3WHK242hAQ2xIKjQdKKEmG/4w WCZZaD61idPG0TuL+fKup5pzVdBSEK6Z4lBCNptpHzXZSpbAp2dVNjH0hh+qnYGIWs8/ Y5x4TGcevaI+zUsP4R6CQ4jXEdPrNjccxFbtO3x2XSwrA4LStHM+3O5Pp/unUbJPzND7 3u+Q== X-Gm-Message-State: AKwxytesXP7U9sWa/M/mdOEpEt/5kUVPxz9O14cawLM9yU4rPVB44h8L 9g85pAn3wBSkQB9v6b2ticidIpoEQC0= X-Received: by 10.159.251.136 with SMTP id m8mr21746752pls.432.1516205387328; Wed, 17 Jan 2018 08:09:47 -0800 (PST) Received: from cloudburst.twiddle.net.com (24-181-135-63.dhcp.knwc.wa.charter.com. [24.181.135.63]) by smtp.gmail.com with ESMTPSA id t25sm6368905pfk.162.2018.01.17.08.09.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jan 2018 08:09:46 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 17 Jan 2018 08:09:17 -0800 Message-Id: <20180117160933.28086-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180117160933.28086-1-richard.henderson@linaro.org> References: <20180117160933.28086-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::243 Subject: [Qemu-devel] [PATCH v10 05/21] tcg: Loosen vec_gen_op* typecheck rules X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" For ARM SVE with VQ=3, we want to be able to dup a scalar into a v256, use that, and then perform a second operation with the v256 punned to a v128. Allow operands to a vector operation be wider than necessary for the output. Signed-off-by: Richard Henderson --- tcg/tcg-op-vec.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 2.14.3 diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c index 5cfe4af6bd..97b437e41a 100644 --- a/tcg/tcg-op-vec.c +++ b/tcg/tcg-op-vec.c @@ -78,7 +78,8 @@ static void vec_gen_op2(TCGOpcode opc, unsigned vece, TCGv_vec r, TCGv_vec a) TCGTemp *at = tcgv_vec_temp(a); TCGType type = rt->base_type; - tcg_debug_assert(at->base_type == type); + /* Must enough inputs for the output. */ + tcg_debug_assert(at->base_type >= type); vec_gen_2(opc, type, vece, temp_arg(rt), temp_arg(at)); } @@ -90,8 +91,9 @@ static void vec_gen_op3(TCGOpcode opc, unsigned vece, TCGTemp *bt = tcgv_vec_temp(b); TCGType type = rt->base_type; - tcg_debug_assert(at->base_type == type); - tcg_debug_assert(bt->base_type == type); + /* Must enough inputs for the output. */ + tcg_debug_assert(at->base_type >= type); + tcg_debug_assert(bt->base_type >= type); vec_gen_3(opc, type, vece, temp_arg(rt), temp_arg(at), temp_arg(bt)); } @@ -257,14 +259,14 @@ void tcg_gen_dup_i64_vec(unsigned vece, TCGv_vec r, TCGv_i64 a) if (TCG_TARGET_REG_BITS == 64) { TCGArg ai = tcgv_i64_arg(a); - vec_gen_2(INDEX_op_dup_vec, type, MO_64, ri, ai); + vec_gen_2(INDEX_op_dup_vec, type, vece, ri, ai); } else if (vece == MO_64) { TCGArg al = tcgv_i32_arg(TCGV_LOW(a)); TCGArg ah = tcgv_i32_arg(TCGV_HIGH(a)); vec_gen_3(INDEX_op_dup2_vec, type, MO_64, ri, al, ah); } else { TCGArg ai = tcgv_i32_arg(TCGV_LOW(a)); - vec_gen_2(INDEX_op_dup_vec, type, MO_64, ri, ai); + vec_gen_2(INDEX_op_dup_vec, type, vece, ri, ai); } }