From patchwork Sun Mar 17 09:08:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160465 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp1407831jad; Sun, 17 Mar 2019 02:14:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/dott0XnqgRaUCY7ulP9GFzs3Q3TgRSJi2azDhrICejArVQZVt2I210/2/Yd1Dn8QBybA X-Received: by 2002:a1c:480a:: with SMTP id v10mr7058032wma.57.1552814087577; Sun, 17 Mar 2019 02:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552814087; cv=none; d=google.com; s=arc-20160816; b=aVkz3PJyI14FsbyfHmWW9/n3fOasxNuLIcFu67rq6VSic8Hu9NJ1kYgHZpH4TCGhTO Ma9dEnXeLJYzD1IuDPwncKwIIO1A2zhDv5F7Jddgbv4TqQGHPOkbzXrLrnbcSD6x15KG QxW9FPqOWhNx5519pCjaSEG/Rwduz000tBDgJUFYnL48DvKK0BhNzIbmTgrg9KzL1/aU TvVyIR7ZV6ULHHQiCgupOFop5Ggz/rxPgode9Zj7FA9GOA++L1At1MOnEeHXaXFEZGl9 U/D23XryER9UbPqbCC/33Knvbu6jkuOS1cnon5wvCP6Zk5/nWsTz1KVfltGO03W8UEeQ nO1Q== 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; bh=+1ZajJcyDX+UELwR6wwdOhI95L56RVVGuynDrcPGi6o=; b=dPgWlmfiaU+xa6p+2p0Fuyjli4Wi3dT0eDra9MixHdEnsNV+EFVS6ZSJF9nWgUPp4Y MUm1R8Nt/ZJ7gHAcMMBQwtIor2uXsoQH2BfIKV9NTBoYJZpyWBtnjR2XQ2Yfvm8SWKWi L6LsjSxJqQgLN29IBLesbvu3NemfAQfOv5mS7EqQQcPE7tzPjfI4fOEJ+7YaE6JjRh/E 3FldSp/t6VUmVOzwwNBjotaL7asbUJ7nmC++mvcH/v+ZfblTKfSxO09ExixGoPCLShiV MBZ+bTg7ToYFtwhCfU61KZCispTf1qWRhAygAnFZ+IDh7a78VrQc1FsGTCyvWngHvMBj F3Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oua6aqjv; 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 68si4250674wmb.8.2019.03.17.02.14.47 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 17 Mar 2019 02:14:47 -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=oua6aqjv; 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]:52147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5RsU-0002ED-Bk for patch@linaro.org; Sun, 17 Mar 2019 05:14:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5Rme-0005cE-15 for qemu-devel@nongnu.org; Sun, 17 Mar 2019 05:08:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5Rmc-00046u-Sy for qemu-devel@nongnu.org; Sun, 17 Mar 2019 05:08:43 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:43315) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h5Rmc-00046V-I7 for qemu-devel@nongnu.org; Sun, 17 Mar 2019 05:08:42 -0400 Received: by mail-pf1-x430.google.com with SMTP id c8so2575372pfd.10 for ; Sun, 17 Mar 2019 02:08:42 -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; bh=+1ZajJcyDX+UELwR6wwdOhI95L56RVVGuynDrcPGi6o=; b=oua6aqjv23rokNXdX59LeiVclUzvVCEYSBGWIyfW7uI8zhytVRbwsy7/Mhih59c1+N CaoZ1zQleljotf9mrPuuusMVEh5ZBmMf/LMUbbiHKot2FY7/cXXXDsxf1HisTQVoCEZF l7QNO1Kas0YLH8KU01AyYoymlZ2cuxEhEZNJyix0WS6Q86oK9fzqTWV9Bxy28cIhOEem GvEbDyjfPup/QKKN9Vtdr4PGKH/a4B6UaFyPdF8AW9GDXGou4+CgA+tYgaidXRFyYnW2 rw8RzwgBGz6jcurn+lRZPD0cC82F9Bo3+HIbQCUD7l3FJTXa+17pBbFWl2C9xFPf4D59 NWjg== 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=+1ZajJcyDX+UELwR6wwdOhI95L56RVVGuynDrcPGi6o=; b=sysaLffMiBZWJH5n7nLeMspZLpKJiah/77xNOLVy9Ip4R2Cew1IXCv/7hGDNsbl1xg wG+fRksfwwLUGsi2x8yENQVIs5fwJzg0LQW0rGOUwSydKlXt2PhKMVM2k+SNlDcqKP8a EFWI2JcORzWHAKP4XV4xYHjXQ4Nx4E6ntDotICGfPskHHuN4yieDf+ZddzczjziZV7qq +JizYnyfoDDaduagx/corm4miHH0br6ahSbBIGRJOOoWdXFtc4KwFX2vF4G2XcbGQXRX TGpljCLGaMEedh/skITrzO/yFon0IHGHzGk+Exr9/7AnYdVHRx1YLI9KaO+SjLSvuFA/ XXXg== X-Gm-Message-State: APjAAAWeFqUnkSL3p6Z74umUAcYNjuICLEwMHdh7jFO+Kpn0yAkM5akl f/N9H5aSxe54A0e5h+DB/+I/QS05HY4= X-Received: by 2002:a65:60c7:: with SMTP id r7mr12480411pgv.37.1552813721226; Sun, 17 Mar 2019 02:08:41 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id b85sm19378435pfj.56.2019.03.17.02.08.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Mar 2019 02:08:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 17 Mar 2019 02:08:24 -0700 Message-Id: <20190317090834.5552-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190317090834.5552-1-richard.henderson@linaro.org> References: <20190317090834.5552-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::430 Subject: [Qemu-devel] [PATCH for-4.1 v2 03/13] 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: , Cc: mark.cave-ayland@ilande.co.uk, david@gibson.dropbear.id.au 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. Signed-off-by: Richard Henderson --- tcg/tcg.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) -- 2.17.2 diff --git a/tcg/tcg.c b/tcg/tcg.c index 34ee06564f..b5389ea767 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -3369,7 +3369,18 @@ 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; @@ -3471,7 +3482,11 @@ 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; @@ -3630,7 +3645,11 @@ 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 {