From patchwork Wed May 1 05:05:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 163180 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp4122257ill; Tue, 30 Apr 2019 22:08:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqywsz7SNZZ+ffHB0qXvbqOMBZ10hOT1DwH+qqQQ9a8ip8l+N2b63/m1VdgpoShRXh5iiWgv X-Received: by 2002:a1c:b646:: with SMTP id g67mr5496064wmf.125.1556687334820; Tue, 30 Apr 2019 22:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556687334; cv=none; d=google.com; s=arc-20160816; b=gC2F6ZAsAfLQgh6vbBwq9wONy2l+VvwuhLFLhVh8Gpevh3mQMYO4RFXvx8C0gO8Y4K /+lsSW+eW+qDJJAPlcKnY50HlBNfTKfCQdzR/gAeuT1uSEYmjND3kxChO4/6aF5o/3Of y4Inhgj2v2FTwpT8Fs1D1gKq73CUCPijsYr0VNou/bntYU6tyzsN8dhRYVcVYC8/Id3U CP1JxzSwU9/+X0L8KpmqGwhSWCFg/T5u7Isd9izjmJ1NIwElDCOF128XfE19QFNH0oTN GR7Nlf2XP+K27AkPzYVu5ADhc274MRKd9438vb+Ya2SEWFRgRKSnBJCzfraGr7NBg0iz RKqQ== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=jMr4oVpt08WI1vYqrX0gvWFc/UY/0FSsdcwMQYw/C7U=; b=Ku+OpWh9dG4XeJWW5id7JH+UW3zyq0BJZd9XdeGEtkq3U8+cFlZvHttNFEM2UcUKEk eud/ldlEWbDBV0krPYr3LXSsGSfDYt+bQvEvL52XsC/5ynVGRdEByUbClQf2Tv8E4Pe/ nBv+9jpa4XGNH4SlsP3Gzum92z0F/tREB9FoFxV6uWTT8vdmuiXhrhL03F11LEfQ33H5 OQsu5HzgOghwnXjgiiWj16Mb4xvBc7pPKbJoyNWi4pF7Uy9oPEE3Rqgnh0000Mk//5id zNJkHAgpkOOX4VJOIdss1x+lews7Iuk/1Qk7VLEwrnnL9UPru7Lc7hgrdZZ2o8XoYrTg P8gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WyzpWnIk; 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 h14si4931287wrp.44.2019.04.30.22.08.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 30 Apr 2019 22:08:54 -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=WyzpWnIk; 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 ([127.0.0.1]:36237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLhUD-0000Og-Oe for patch@linaro.org; Wed, 01 May 2019 01:08:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLhRM-0006Mf-Hf for qemu-devel@nongnu.org; Wed, 01 May 2019 01:05:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLhRJ-0002qF-GM for qemu-devel@nongnu.org; Wed, 01 May 2019 01:05:56 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:45892) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hLhRJ-0002pw-Au for qemu-devel@nongnu.org; Wed, 01 May 2019 01:05:53 -0400 Received: by mail-pg1-x541.google.com with SMTP id i21so4414707pgi.12 for ; Tue, 30 Apr 2019 22:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=jMr4oVpt08WI1vYqrX0gvWFc/UY/0FSsdcwMQYw/C7U=; b=WyzpWnIkM6OoVIcEy9MNoYvfc4GGBMTeDDMHf8BmCxFcNXkJJMjcJNGvBjuWh5oCFT NlUyXMWNcWA9BFwbcS9Ls4wq1ceJk+gU8Cu5PzlaxzPoxsNrSJDVAlVFCPctq7ogusb5 71HXXHUyzGN3geHqn5gr32APhh28mIg+e15QsZWt1fuPm8GOMArjp28+EgjqvVeJ9erJ 40oANmDEWP7u25UzmNo2pu+SqO5zBG8RAifyTtZA9h+CzydmohSo5NKnfdDfr1aMz5PU x/aARQBhFU4C88ZAEZ7cux7CuSXhwL3ILFB2Y0ieFA/waDGA03Ztp3GsP+BQl1fld86d mnhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=jMr4oVpt08WI1vYqrX0gvWFc/UY/0FSsdcwMQYw/C7U=; b=Vh++sISGmZbO4OgsEX+7vj53zWMoDWfIrc+LOc2UBzoG9Ba8OCmoHx3RSOH1vN3zgH c/JIC2JSscHS6qpcx+UdNk1IQbORN3fwZ9EAJqJTn17caod6pBzGbPudNvaIuprgFE1B PGEnzpKFAfZWoaHme82sXv53S5LzEvrvLCZPw2QknbYJbwPX3/qC7rI3gixrYrxqD8np 0gGQbJvbAO2C530Vn24hP3Neru9nHjAtzWap9E992+4ii6RlgI4fbP3Uy1Jd/JRQwsAh dGGwAlBJYV8VlNlvY1Nh1g0fzhaGQqAbSQGdEP08w8/jzXijpXJ3E1YF/C6SSM9aPjwQ Grjg== X-Gm-Message-State: APjAAAU3xoTiCMtzTNcXuMYNY4m/N6slbPJtcaGqSKB63vFOqckQ22dW RZPIpCW7iCfvbkANaHUpv891TcvU5nY= X-Received: by 2002:a63:6ac1:: with SMTP id f184mr73578421pgc.25.1556687152067; Tue, 30 Apr 2019 22:05:52 -0700 (PDT) Received: from localhost.localdomain (97-113-189-189.tukw.qwest.net. [97.113.189.189]) by smtp.gmail.com with ESMTPSA id t127sm9687251pfb.106.2019.04.30.22.05.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 22:05:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 30 Apr 2019 22:05:14 -0700 Message-Id: <20190501050536.15580-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190501050536.15580-1-richard.henderson@linaro.org> References: <20190501050536.15580-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::541 Subject: [Qemu-devel] [PATCH v2 07/29] tcg: Support cross-class moves without instruction support 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" PowerPC Altivec does not support direct moves between vector registers and general registers. So when tcg_out_mov fails, we can use the backing memory for the temporary to perform the move. Acked-by: David Hildenbrand Signed-off-by: Richard Henderson --- tcg/tcg.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/tcg/tcg.c b/tcg/tcg.c index 8ed7cb8654..68d86361e2 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -3368,7 +3368,20 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOp *op) ots->indirect_base); } if (!tcg_out_mov(s, otype, ots->reg, ts->reg)) { - abort(); + /* + * Cross register class move not supported. + * Store the source register into the destination slot + * and leave the destination temp as TEMP_VAL_MEM. + */ + assert(!ots->fixed_reg); + if (!ts->mem_allocated) { + temp_allocate_frame(s, ots); + } + tcg_out_st(s, ts->type, ts->reg, + ots->mem_base->reg, ots->mem_offset); + ots->mem_coherent = 1; + temp_free_or_dead(s, ots, -1); + return; } } ots->val_type = TEMP_VAL_REG; @@ -3470,7 +3483,13 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) reg = tcg_reg_alloc(s, arg_ct->u.regs, i_allocated_regs, o_preferred_regs, ts->indirect_base); if (!tcg_out_mov(s, ts->type, reg, ts->reg)) { - abort(); + /* + * Cross register class move not supported. Sync the + * temp back to its slot and load from there. + */ + temp_sync(s, ts, i_allocated_regs, 0, 0); + tcg_out_ld(s, ts->type, reg, + ts->mem_base->reg, ts->mem_offset); } } new_args[i] = reg; @@ -3631,7 +3650,13 @@ static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op) if (ts->reg != reg) { tcg_reg_free(s, reg, allocated_regs); if (!tcg_out_mov(s, ts->type, reg, ts->reg)) { - abort(); + /* + * Cross register class move not supported. Sync the + * temp back to its slot and load from there. + */ + temp_sync(s, ts, allocated_regs, 0, 0); + tcg_out_ld(s, ts->type, reg, + ts->mem_base->reg, ts->mem_offset); } } } else {