From patchwork Sat Jun 26 05:03:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 467428 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2140118jao; Fri, 25 Jun 2021 22:11:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhBxrQTFUznaIlqohfWDA1V+KlwyiK7sU3JVV4dhJ0IpWtdTCaaBWTxAXbVsbxs9MkrE0Z X-Received: by 2002:a37:4197:: with SMTP id o145mr15063521qka.75.1624684303375; Fri, 25 Jun 2021 22:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624684303; cv=none; d=google.com; s=arc-20160816; b=SJce+RUPB3hub0WxASH9vLEBfSG+WVq4mmcO/tjGgLxj23sD05agO6R6ZsaO+5l0xa iZzEGS+BbVwdg8d09q48Hpl8FBX8LwIIc+ujmJsa1TCGhjC4RBxVn/0D7WvjQH7NGuZm EgHDkEGsrjf/QAlY7OkyyDGKZZKXovs8tFyGCiBa4Vxs2jJjR4EtFvFXhsEJEEq4wwdF qqkyggS9Sz+7lZEMSDtLQMvZ7Yi9axUpAJ3jYOjk1uqrsCg3g544lQxvbGgZgoPDxBV1 P1Oz26a+s4taWP2FUKHWlEQQOXsFC7oAVzhgIf2J1F9Bp9ENY5IvrGeIhyZgYpVfa+US nmkA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=z/5xxE2+UtklPcwCantXm0ZBLWNrDIZBlcYNO8A1mx8=; b=V8y6i2gLDoaOd6BBUHmRLTtXXA5owUXe11GXbdv3QP7l3BGk1yKw5057SVMWtaDGPf kT/iKOwJei62M1qRa/9rS9oIl8IA0pg9vAoZSXutb1WPSWZnsVmT9boSLVVNnJWOULRj ZlVKPBizxi3bmWhdY8TfjI4lcgZYjeEWBPQFd5+eY4UJtfperPSprc1KnghC9LN+OElZ GcxzUVji37GOzuYAFcAcTRE8FxMzPJe2juPMpalKSHhsYvL9oyY2OyXuk74dasMpIEfE aJSpmmSIAwoBZiYimQlFLLCJLMrq+v+2+WcyNJ0isr5Lz6bFWj84ykpsCws4CsWev2KW rLwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bt6glOgv; 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 o15si1235673qtm.372.2021.06.25.22.11.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jun 2021 22:11:43 -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=bt6glOgv; 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]:40056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lx0bW-0002xG-SG for patch@linaro.org; Sat, 26 Jun 2021 01:11:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lx0TR-0007AN-Pq for qemu-devel@nongnu.org; Sat, 26 Jun 2021 01:03:21 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:38630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lx0TO-0008K1-V4 for qemu-devel@nongnu.org; Sat, 26 Jun 2021 01:03:21 -0400 Received: by mail-pf1-x42c.google.com with SMTP id c8so9140262pfp.5 for ; Fri, 25 Jun 2021 22:03:18 -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 :mime-version:content-transfer-encoding; bh=z/5xxE2+UtklPcwCantXm0ZBLWNrDIZBlcYNO8A1mx8=; b=bt6glOgvIG2oJr223/IrGDHbnGd27N0+CEm98QCcjhgmKkqvdviTmZEf4QQIZXnQk3 EI9ECEgTF5umcJKH7fWWtuvDbe6Ew6Blw3JK6mrsjqhyy461++0zbV3T800RFp6l9Jcm RgAblrv4MDeoHqJxRVhC60kxLlE1PTdbY2Y+aK3p7BNv9r3pvXPAhF5k9QBVEeWXKUri awnRWgQ1hDDrF1YgbW2KFMx4eWId5N/wxMM9faJRIAWN6e/twJ5yBGLo4EAZUyBQY6UB mGOY/pWn96J1PD7B4raAt2RgrXBSqrGbanm4urhLv2GHZ1O8ANK+e74JLw7GOZUoQ8WG oE+g== 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:mime-version:content-transfer-encoding; bh=z/5xxE2+UtklPcwCantXm0ZBLWNrDIZBlcYNO8A1mx8=; b=qb3XIywpV9KDZEMKMXgMM2dMU4eZIwej5koBZaNCOMim6tLqtuys+f+31j6t3hSFow 4fXtxZkOsBIRSkfPKSLuzb9CFu9z2DFASWZUIGhMto/WIT6kx0svitj3UrziDAGvz4jT vXrcvuMKDk3xOF2o3bUcDi4TKUWkuP+aB3qRIU8Q8b5g7nNrh4mzWuz0wibK58x1MUQW PrVNKpVYzvEF3fitdzQZtkkQQracsBKhsc4juS4V8eG2VhNm++W7gpzEgCP7jDVEE2Ly laIYqrBpQTvXqSC+MMuapuO9MboYW7kP8ek1pha7QscXEzjNcHIe8gzE0gp90TImb6rL ruaQ== X-Gm-Message-State: AOAM533FMREOqEcXXTgvzg2Ap+eqYZI72+5Cyjn3vgpYFK23X+Oopt8M hdjljFalvxftBVKoRs709ng9876rHUKFQg== X-Received: by 2002:a63:a551:: with SMTP id r17mr12799059pgu.97.1624683797640; Fri, 25 Jun 2021 22:03:17 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id c62sm7389768pfa.12.2021.06.25.22.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 22:03:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 16/16] tcg/s390x: Implement TCG_TARGET_HAS_cmpsel_vec Date: Fri, 25 Jun 2021 22:03:07 -0700 Message-Id: <20210626050307.2408505-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210626050307.2408505-1-richard.henderson@linaro.org> References: <20210626050307.2408505-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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: , Cc: david@redhat.com 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 4a8d9f2f6a..2741d6f177 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -2837,6 +2837,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: @@ -2899,6 +2900,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) { @@ -2940,7 +2956,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)); @@ -2952,6 +2968,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);