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: 1057485 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="oua6aqjv"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44MYW53yNFz9s7h for ; Sun, 17 Mar 2019 20:12:49 +1100 (AEDT) Received: from localhost ([127.0.0.1]:52127 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5RqZ-0008SP-Au for incoming@patchwork.ozlabs.org; Sun, 17 Mar 2019 05:12:47 -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-Google-Smtp-Source: APXvYqzhwUMQNQ50RcNbQvLqXAzMSQQed08ii9clPFjm6vDTPIljAUIO10iMA5tdGkTmdigz7ZWBPQ== 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+incoming=patchwork.ozlabs.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(-) 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 {