From patchwork Tue Mar 19 17:21:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1058559 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="PtRVa7zZ"; 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 44P0HJ2K5Xz9s5c for ; Wed, 20 Mar 2019 04:22:36 +1100 (AEDT) Received: from localhost ([127.0.0.1]:60663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6IRb-0004aj-RE for incoming@patchwork.ozlabs.org; Tue, 19 Mar 2019 13:22:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6IQj-0004Yn-O4 for qemu-devel@nongnu.org; Tue, 19 Mar 2019 13:21:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6IQi-0004Tt-JY for qemu-devel@nongnu.org; Tue, 19 Mar 2019 13:21:37 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:38414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h6IQi-0004SU-7H for qemu-devel@nongnu.org; Tue, 19 Mar 2019 13:21:36 -0400 Received: by mail-pg1-x531.google.com with SMTP id v1so9597713pgi.5 for ; Tue, 19 Mar 2019 10:21:36 -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=PtRVa7zZf5oJLar1xVe760fKgEL2nibWQXiJq5ATcx4JIY6y9L2AW0E8vbh4xETPv1 wVDnuXYqE7dGA14PnjFMi3DyimDdrRQx/OSALQH6mRlznpt/sRD3ScCXbZjIX3dS7UXl H5lJIpx6ycH7oj6es7o4rS1znwUdgjZ/Fmy7DNLAzwn/e7gChoeVIqqqoB7TJ4jEjKCp wZYwn/r21bBwL9gvN/4EHobBYibiKZUdrICrSGQrHELHpU0eMp0vNUNsfhoK6+d8w6g4 b5lhubBfV1C19X2f1EFb3WpF+HtzuN9PgCzv/NHus7vAHjMrF62u40BaFruRRa+D+gB3 f7gQ== 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=BNCjTwga8tcsdSkLZCDPHJFnnbU77ToiuLuvd0icIJGy38sdw2gy+M/J/jZU4gARVJ a0gJ/M7bYHmiBilkvmQ3hnEo029I7hdjtJUG6QR5LStTihrOuoANdkGHC35MiEBekX0s iH0Tj4B9sdcuPCw2UgBGrtKZUQFv5MCibJEAuTXjQ/N4pZL02JvhsRUpbb4a86jqhOHC jFk/M+uC5Ia/b1YrQ6xvhTh7lcSgEvXd13SUMpPBzr7S9VphmIBjOmWAgsr9WMgwqJYO tH9JtKpaSRZofRHpKhoU/mPJtumQQg2IJik91/RYJyKoEt1C7S/ST2S9pW4JJlN2LPaX uZwg== X-Gm-Message-State: APjAAAVLJHb8/XY0ETlXfUfDvzKsIQ5tjLuNN5OfCSXT51TDmhcW+dCW qsNhtNT4SnX+zgMv0G1IjFwqImF7s2M= X-Google-Smtp-Source: APXvYqymoJ6HeGzLs9wI/2X4nLGbPCenj+lvz0G/4lfwfoAOyXbzW4gZj0xP5J32O5iK1dyeVsP1Bg== X-Received: by 2002:a17:902:bf05:: with SMTP id bi5mr26058361plb.252.1553016094848; Tue, 19 Mar 2019 10:21:34 -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 w68sm5616666pfb.176.2019.03.19.10.21.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 10:21:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 19 Mar 2019 10:21:13 -0700 Message-Id: <20190319172126.7502-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190319172126.7502-1-richard.henderson@linaro.org> References: <20190319172126.7502-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::531 Subject: [Qemu-devel] [PATCH for-4.1 v3 04/17] 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 {