From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc2f.google.com (mail-oo1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) by sourceware.org (Postfix) with ESMTPS id 63FFD3857838 for ; Mon, 14 Aug 2023 18:34:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 63FFD3857838 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-56d62a80727so3378892eaf.0 for ; Mon, 14 Aug 2023 11:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692038083; x=1692642883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7Tspv4eu7hZDDni7vmjMHRGznsVZXX8SHrpviRN+1MA=; b=Hz8AxFXZZLdORheQFMfdiqgErSdBbkvInBDtZtqxiJHupYb7jsnYWiHRzu0UYWuDGf dFD/X+g/Pk6Q4rDc4uIMPouQXD5eFxW8RFoymuU9yUBYgO0BlCL/nF7BPwPYog1+ULcA sSazu5lPzl2cP1mT8tBikLrVL8AqT2orNF3Yp93pbgPkUdkN6p5uwbpHYxmfic2numnE E+Pn3mE1MFm5NW8oANdkOZjsrEMUu8UFYcyrwq++fYV7r9LI+0LT9jz4PMM5FkF7Nz8R dJRm7g4v+sdkrA4Ai3IrI/AXsCaM6+ieGp+ViRKL6+/A+0GkszuTFbePvG0oT6WgMUIj xPZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692038083; x=1692642883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7Tspv4eu7hZDDni7vmjMHRGznsVZXX8SHrpviRN+1MA=; b=YBcmQYcPKAI7rMt/qh15xbJaQLKIqcYiQzcvohpPxh4ctw4BMHeYzmQf1Lh6cvpVJG HldqlgShw0M/zrbrbCoZztH3B1oTe2oLNbVjVkq8bd0hs6hWC+YafXF0HENIqckALLUt 9SSfXNlALJEsRaPlXgDSb/vy+wf0ZFBAr/kW6+qfU8/Bo39pJpz3RfJ4wTpEbFYzq65V nZWFVxymLaSA2nRGBEfnT7YqYAKi4Nzely+NbXJYS9N1DJZjD+xEEa+uF73ch5+uz892 yTtSenIHCe3W4BKH3JG+13B+mvpHQBUS5YXd3mLk24/8Ca2dP1eEU+VE3dKQPDlGZJbz Wm3Q== X-Gm-Message-State: AOJu0YyA2J/7pDis72UHLl0zFNiMB2Ixq2mAaQWNw5p8MLUwWtIwpTuo yjZ1FIrqVeSsMeXtDcFJmhv3JH9rQGU0nWTeMB3pTvW6 X-Google-Smtp-Source: AGHT+IEeZNhEdBSnAudy6CUIbryYH97/TSy10gh4CW6kQcGzdB5dU96TuypU271kjfi9mwMlyobQWw== X-Received: by 2002:a05:6870:b40b:b0:1b4:3cc6:c2b6 with SMTP id x11-20020a056870b40b00b001b43cc6c2b6mr8672029oap.23.1692038083216; Mon, 14 Aug 2023 11:34:43 -0700 (PDT) Received: from localhost.localdomain ([139.178.84.207]) by smtp.gmail.com with ESMTPSA id l22-20020a056870e91600b001bec2a8f4e3sm5451968oan.14.2023.08.14.11.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 11:34:42 -0700 (PDT) From: Christophe Lyon To: gcc-patches@gcc.gnu.org, Kyrylo.Tkachov@arm.com, richard.earnshaw@arm.com, richard.sandiford@arm.com Cc: Christophe Lyon Subject: [PATCH 3/9] arm: [MVE intrinsics] add binary_widen shape Date: Mon, 14 Aug 2023 18:34:16 +0000 Message-Id: <20230814183422.1905511-3-christophe.lyon@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230814183422.1905511-1-christophe.lyon@linaro.org> References: <20230814183422.1905511-1-christophe.lyon@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This patch adds the binary_widen shape description. 2023-08-14 Christophe Lyon gcc/: * config/arm/arm-mve-builtins-shapes.cc (binary_widen): New. * config/arm/arm-mve-builtins-shapes.h (binary_widen): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 42 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 5 +-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 1f22201ac95..c8eb3351ef2 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1129,6 +1129,48 @@ struct binary_rshift_narrow_unsigned_def : public overloaded_base<0> }; SHAPE (binary_rshift_narrow_unsigned) +/* _t vfoo[_t0](_t, _t) + + Example: vmullbq. + int32x4_t [__arm_]vmullbq_int[_s16](int16x8_t a, int16x8_t b) + int32x4_t [__arm_]vmullbq_int_m[_s16](int32x4_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p) + int32x4_t [__arm_]vmullbq_int_x[_s16](int16x8_t a, int16x8_t b, mve_pred16_t p) */ +struct binary_widen_def : public overloaded_base<0> +{ + void + build (function_builder &b, const function_group_info &group, + bool preserve_user_namespace) const override + { + b.add_overloaded_functions (group, MODE_none, preserve_user_namespace); + build_all (b, "vw0,v0,v0", group, MODE_none, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + type_suffix_index type; + if (!r.check_gp_argument (2, i, nargs) + || (type = r.infer_vector_type (i - 1)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + type_suffix_index wide_suffix + = find_type_suffix (type_suffixes[type].tclass, + type_suffixes[type].element_bits * 2); + + if (!r.require_matching_vector_type (i, type)) + return error_mark_node; + + /* Check the inactive argument has the wide type. */ + if ((r.pred == PRED_m) + && (r.infer_vector_type (0) != wide_suffix)) + return r.report_no_such_form (type); + + return r.resolve_to (r.mode_suffix_id, type); + } +}; +SHAPE (binary_widen) + /* _t vfoo[_n_t0](_t, const int) Check that 'imm' is in the [1..#bits] range. diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index a1842f5845c..fa6ec4fc002 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -35,13 +35,13 @@ namespace arm_mve { extern const function_shape *const binary; - extern const function_shape *const binary_lshift; - extern const function_shape *const binary_lshift_r; extern const function_shape *const binary_acc_int32; extern const function_shape *const binary_acc_int64; extern const function_shape *const binary_acca_int32; extern const function_shape *const binary_acca_int64; extern const function_shape *const binary_imm32; + extern const function_shape *const binary_lshift; + extern const function_shape *const binary_lshift_r; extern const function_shape *const binary_lshift_unsigned; extern const function_shape *const binary_maxamina; extern const function_shape *const binary_maxavminav; @@ -54,6 +54,7 @@ namespace arm_mve extern const function_shape *const binary_rshift; extern const function_shape *const binary_rshift_narrow; extern const function_shape *const binary_rshift_narrow_unsigned; + extern const function_shape *const binary_widen; extern const function_shape *const binary_widen_n; extern const function_shape *const binary_widen_opt_n; extern const function_shape *const cmp; -- 2.34.1