From patchwork Wed Oct 6 15:20:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515337 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp542574ime; Wed, 6 Oct 2021 08:37:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMmXH6Lo5gzg3B0KdXrXV4dbwng2p2dfV5PMwNYELAS17+WmiTdOa4kkhrcLmCgk8XFiB4 X-Received: by 2002:ac8:7b48:: with SMTP id m8mr27377735qtu.133.1633534660575; Wed, 06 Oct 2021 08:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633534660; cv=none; d=google.com; s=arc-20160816; b=Y4kdSqp7PqYakkuGdyifVxs/5VFU+WATvAejkaxB0Unp45UAX6wQ6U+2R2AzPEoB2m SLb6B3dWz8mUZXYCehPHcFbWY4b6iQJFMh/w6OaKSJ0MP2cQnvXBPENGPWi258HCsaeL /TTDKVdkRR8Swg8whrgOU2W6wmbbShDBk5kFp8+FWUejjW7uHNK3ERZOoqfIjr77SAFa cBnwpnvnaBBGHjNTdivenFdw0RJEhmiQ8cZtgiDcCFTXnQ+sfIk1RGSth87yriE1a8D6 4E7FumTo6QutN6/j9VHSl/3WV/fQHeaqagmE3BAWdmjMgqHNhdEHP5/naAYaIIVgJmUF Qdvg== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=KmlN7FSjNCfwx0yApjt/9T2RDpf6AV9m+Nkn8IGsnKE=; b=W1IQJsBnPKPlcnu923JfGnlAieEuG2U5BnOA4yRUq54N8akoB5EvR8tPYDPB8QuK4/ 6/Xq0PIsyU9SPmYXYg6r8PAPRV8YkVEhiuBIBlOgg68kIafBJsg/xKfIMddwnZdeWgzV +kPSTsZk3qtbfBEHOJ4za9nKFU0xFM3kk+nbgieR6FX+TyJecCqeeGoUxxd3WHGVj4le QDriB93Tcc3Q+xMW+MHL6zRrd8kxsHsC0IKqlNZAL2GZT7TjXKX+a3C9oXX7AjwTefUX myuDwxqj14nbKZJB697rjWOZGSz8gTxtg1XNobuyFGDj3oAQ9Fd/ePn/PJ6Na7Nug2Ge BNtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fHMYZbWE; 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=pass (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 e12si15792306qvd.52.2021.10.06.08.37.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Oct 2021 08:37:40 -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=pass header.i=@linaro.org header.s=google header.b=fHMYZbWE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY8zE-0005IS-0k for patch@linaro.org; Wed, 06 Oct 2021 11:37:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY8j8-0002fk-Ub for qemu-devel@nongnu.org; Wed, 06 Oct 2021 11:21:04 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:36744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mY8ip-0007sz-3F for qemu-devel@nongnu.org; Wed, 06 Oct 2021 11:21:02 -0400 Received: by mail-pf1-x429.google.com with SMTP id m26so2664822pff.3 for ; Wed, 06 Oct 2021 08:20:41 -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:mime-version :content-transfer-encoding; bh=KmlN7FSjNCfwx0yApjt/9T2RDpf6AV9m+Nkn8IGsnKE=; b=fHMYZbWEQpV1eM6ajKIbOHEaRmg4jfsZ7hLu6BDGC8cvgiI2VPWbPhWosxI37TQrGw F0290qa77W9koClJQPCv0lELYFUbViCZUHIUsVWT4653zxlBR9qsdMmQ8DNTedABnDSo Ffnd4F6ApnyJUfMjuLH6A1iH9hW8L8kale+T3KvfdIiocvusIpZvfShXPovicI7ooPFu 55EjlhZhe1AOPlRrzvHi3jICKo/hbvi0fqLsr3Gi7NAUtJ+JFduACS3GBk4Z2APNFmkM 3okO9GG6e1chK6sqBJTxpqZZir+hp5FzuubBxWsfhSn8PG5LitQ8VORhBMMNBNxk+Ye+ 0EWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KmlN7FSjNCfwx0yApjt/9T2RDpf6AV9m+Nkn8IGsnKE=; b=Ap71OdTpAboFNbX+N8rtJnchyrqxTtOP8K4Xeu6L2R9f4Sm5cZyNOYoTyit/dDw4f5 MXTaO9Z0Nw2fEztr6md0TbgJqp2uyXjBxTvt8MWAKIoC3kmw1WB6zaLFWIrp4eVnkBqT 4BBlGob7zPy/VHJKYFdhdJ7eSiubN6dTkvnQkEM8ecHun3apaoIK1EckgyLU0VwWvmHH zVvnyDH9quqsPb+Eglzw/H1IDGW1eTY60LMTUw3pHQy5NI6/a5pC1iAGKY/AqprmEMdw p+h4Oua9bwHgdCszsw0Ual7BsWOagJn3Rgswh4n08ahJBhL0Mx761HvVeWuZyquT1x6y HiNQ== X-Gm-Message-State: AOAM531PfHR3mCUWu0XI4PrGyXJelxqxCd09iApQPhJjjQwOXQwwFZ8j bDcbNcnLtANsohjXpwhbktPbSe3Eka1Uzw== X-Received: by 2002:a62:8f8a:0:b0:44c:6e3c:4807 with SMTP id n132-20020a628f8a000000b0044c6e3c4807mr14220551pfd.68.1633533639931; Wed, 06 Oct 2021 08:20:39 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id 130sm22239256pfz.77.2021.10.06.08.20.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 08:20:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 28/28] tcg/s390x: Implement TCG_TARGET_HAS_cmpsel_vec Date: Wed, 6 Oct 2021 08:20:14 -0700 Message-Id: <20211006152014.741026-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211006152014.741026-1-richard.henderson@linaro.org> References: <20211006152014.741026-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is via expansion; don't actually set TCG_TARGET_HAS_cmpsel_vec. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index ae132e1b75..8938c446c8 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -2869,6 +2869,7 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_xor_vec: return 1; case INDEX_op_cmp_vec: + case INDEX_op_cmpsel_vec: case INDEX_op_rotrv_vec: return -1; case INDEX_op_mul_vec: @@ -2931,6 +2932,21 @@ static void expand_vec_cmp(TCGType type, unsigned vece, TCGv_vec v0, } } +static void expand_vec_cmpsel(TCGType type, unsigned vece, TCGv_vec v0, + TCGv_vec c1, TCGv_vec c2, + TCGv_vec v3, TCGv_vec v4, TCGCond cond) +{ + TCGv_vec t = tcg_temp_new_vec(type); + + if (expand_vec_cmp_noinv(type, vece, t, c1, c2, cond)) { + /* Invert the sense of the compare by swapping arguments. */ + tcg_gen_bitsel_vec(vece, v0, t, v4, v3); + } else { + tcg_gen_bitsel_vec(vece, v0, t, v3, v4); + } + tcg_temp_free_vec(t); +} + static void expand_vec_sat(TCGType type, unsigned vece, TCGv_vec v0, TCGv_vec v1, TCGv_vec v2, TCGOpcode add_sub_opc) { @@ -2972,7 +2988,7 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, TCGArg a0, ...) { va_list va; - TCGv_vec v0, v1, v2, t0; + TCGv_vec v0, v1, v2, v3, v4, t0; va_start(va, a0); v0 = temp_tcgv_vec(arg_temp(a0)); @@ -2984,6 +3000,12 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, expand_vec_cmp(type, vece, v0, v1, v2, va_arg(va, TCGArg)); break; + case INDEX_op_cmpsel_vec: + v3 = temp_tcgv_vec(arg_temp(va_arg(va, TCGArg))); + v4 = temp_tcgv_vec(arg_temp(va_arg(va, TCGArg))); + expand_vec_cmpsel(type, vece, v0, v1, v2, v3, v4, va_arg(va, TCGArg)); + break; + case INDEX_op_rotrv_vec: t0 = tcg_temp_new_vec(type); tcg_gen_neg_vec(vece, t0, v2);