From nobody Tue Feb 10 06:44:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1569875197; cv=none; d=zoho.com; s=zohoarc; b=GBfsuTidUo53buC/nMU8Gkl9GgGev1fe1ehcJkVrs77JgW9YaEXOEjgBfM6zPdjFQauWFFu9DWWck0ggksc/DSTiAN5QxczaMZxPn2JtbjS5zfiYkKHNtXd1ecGTO9TPRkEVzYaRYVCHIfezNlEYamgmDfSYGoDFnjVDa/sNCfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569875197; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=TMW87VFE4aaAyrSbIdPCRdi4/pYOXWGaazKqSKeXpbw=; b=lYrSddfjOTriYGc/T+M9/bmHISz/oFI/v9Q5owbIvX7guj1OouXlMk/PhNpFcjLonvO+AU+XhYkl7u2tV21MJTT4LkgUCdlr+OLvjqK9kUbVaHnT7uZC2UTIU2pKQ/r5doGxI5xNS8tVGo6Elq9keM7DIor3jxX9tUpqFm8C8Nw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569875197221474.74507114323774; Mon, 30 Sep 2019 13:26:37 -0700 (PDT) Received: from localhost ([::1]:56864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iF2Ff-0001Ex-FH for importer@patchew.org; Mon, 30 Sep 2019 16:26:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45004) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iF2B8-0004v6-D5 for qemu-devel@nongnu.org; Mon, 30 Sep 2019 16:21:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iF2B7-0005lw-6A for qemu-devel@nongnu.org; Mon, 30 Sep 2019 16:21:54 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:38699) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iF2B6-0005l4-W9 for qemu-devel@nongnu.org; Mon, 30 Sep 2019 16:21:53 -0400 Received: by mail-pl1-x642.google.com with SMTP id w8so3870347plq.5 for ; Mon, 30 Sep 2019 13:21:52 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id r28sm15336802pfg.62.2019.09.30.13.21.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2019 13:21:50 -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=TMW87VFE4aaAyrSbIdPCRdi4/pYOXWGaazKqSKeXpbw=; b=J2nsgtmPn7O7GLLpoThqsZ/VHa3QUECjSVzu1gMkiASuSuQDUeXPHrPkBZTvFh41Fa hs9yuJH81IDxT8XgbyuwK4B1gziMu+Yq9/3+AUQ00xD/3HEqvQvFOuQE/LFAL144UfSk Db0SmRO3cQH29mUJVtZ/cyL3aFBT1bmXo90+rjo6IbOOfMpPNbI5GeiRXplcmN5dq3gU YOHTcWQAWsaW7/East5MPMZ3cbr7bEESYgxRKcj0j0tIZJdoDjMa0jRxGMF7+qIFzNtK yWD2dKq3p5Bm91TYMxeju81r3nCZ2YtrOjIMPWqi1BI94imk4uRkJ1laGNtPFN+6PqXP aoeg== 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=TMW87VFE4aaAyrSbIdPCRdi4/pYOXWGaazKqSKeXpbw=; b=r5oVmQR6r490GzxaDX1K4A6RtnX93s7IsbAVL/S2sAYKMepux2m/osirPh8mC9k3u3 ziJfFXLSJk3UyruvufLoGoChf74rgwChJEhths8zc0wyNnnCwlYyfyTxeP0fQBnuxT+Q 0SbId0PsNZW3qCcRPZSiZxmpzGllQ1kLglyx5rgcrXi6J1zOLoiYH+yFcLPwoEC+6HwG BSw7gU7++p9z8+B0ojWvVs8/8gKsBX0h+mFg/whD0EnaZ+69S7i7wkwG3Sak5aA58aFU 7+yq0rCtzNArHilBnIGJXlNgCeRTjzl585sMR1bwD0FAk+GYmJ0kqPfy+GNPgICB5gEc 6j9A== X-Gm-Message-State: APjAAAXuRjfjtPup9wCb+Q90IrJur7X9tDZe7I9Vw/9AoxSyq3ef47OL AhUAD8RqL6mYQvzWTGsi+N+CTQpGnyY= X-Google-Smtp-Source: APXvYqxBicyedOkSiIvbrK/WQWNOR16mrc7jSRHGVMGosn13GSd4OdsSWc1pDs1ooZvdm12nd2LV2w== X-Received: by 2002:a17:902:6b02:: with SMTP id o2mr22102443plk.302.1569874911637; Mon, 30 Sep 2019 13:21:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 19/22] tcg/ppc: Update vector support for v2.07 FP Date: Mon, 30 Sep 2019 13:21:22 -0700 Message-Id: <20190930202125.21064-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190930202125.21064-1-richard.henderson@linaro.org> References: <20190930202125.21064-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::642 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.cave-ayland@ilande.co.uk, amarkovic@wavecomp.com, hsp.cat7@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" These new instructions are conditional on MSR.FP when TX=3D0 and MSR.VEC when TX=3D1. Since we only care about the Altivec registers, and force TX=3D1, we can consider these to be Altivec instructions. Since Altivec is true for any use of vector types, we only need test have_isa_2_07. This includes moves to and from the integer registers. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.inc.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index 6321e0767f..840464aab5 100644 --- a/tcg/ppc/tcg-target.inc.c +++ b/tcg/ppc/tcg-target.inc.c @@ -586,6 +586,11 @@ static int tcg_target_const_match(tcg_target_long val,= TCGType type, #define XXPERMDI (OPCD(60) | (10 << 3) | 7) /* v2.06, force ax=3Dbx=3Dt= x=3D1 */ #define XXSEL (OPCD(60) | (3 << 4) | 0xf) /* v2.06, force ax=3Dbx=3Dc= x=3Dtx=3D1 */ =20 +#define MFVSRD (XO31(51) | 1) /* v2.07, force sx=3D1 */ +#define MFVSRWZ (XO31(115) | 1) /* v2.07, force sx=3D1 */ +#define MTVSRD (XO31(179) | 1) /* v2.07, force tx=3D1 */ +#define MTVSRWZ (XO31(243) | 1) /* v2.07, force tx=3D1 */ + #define RT(r) ((r)<<21) #define RS(r) ((r)<<21) #define RA(r) ((r)<<16) @@ -715,12 +720,27 @@ static bool tcg_out_mov(TCGContext *s, TCGType type, = TCGReg ret, TCGReg arg) tcg_debug_assert(TCG_TARGET_REG_BITS =3D=3D 64); /* fallthru */ case TCG_TYPE_I32: - if (ret < TCG_REG_V0 && arg < TCG_REG_V0) { - tcg_out32(s, OR | SAB(arg, ret, arg)); - break; - } else if (ret < TCG_REG_V0 || arg < TCG_REG_V0) { - /* Altivec does not support vector/integer moves. */ - return false; + if (ret < TCG_REG_V0) { + if (arg < TCG_REG_V0) { + tcg_out32(s, OR | SAB(arg, ret, arg)); + break; + } else if (have_isa_2_07) { + tcg_out32(s, (type =3D=3D TCG_TYPE_I32 ? MFVSRWZ : MFVSRD) + | VRT(arg) | RA(ret)); + break; + } else { + /* Altivec does not support vector->integer moves. */ + return false; + } + } else if (arg < TCG_REG_V0) { + if (have_isa_2_07) { + tcg_out32(s, (type =3D=3D TCG_TYPE_I32 ? MTVSRWZ : MTVSRD) + | VRT(ret) | RA(arg)); + break; + } else { + /* Altivec does not support integer->vector moves. */ + return false; + } } /* fallthru */ case TCG_TYPE_V64: --=20 2.17.1