From patchwork Thu Nov 16 15:26:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 165854 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp3286963vqg; Thu, 16 Nov 2023 07:27:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcv8UZMxu7Kg5CIsLEdS4QxMh7soidu5vhGVefyu+z2100q/Cb7ca5hlX34sHTznx258Rg X-Received: by 2002:a05:620a:4245:b0:77a:2837:a8cf with SMTP id w5-20020a05620a424500b0077a2837a8cfmr2721691qko.39.1700148444950; Thu, 16 Nov 2023 07:27:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700148444; cv=pass; d=google.com; s=arc-20160816; b=CXdeCkXt1WV9G7Ovve80rU1FKwRK281/kfVcJxG0LLGNpxjMga4d1DKGTdg6vVetjL c1754IdDT8QjTpaTiuvQQsL27XubpxSg4z7ZYEYSjlpWwgdV/6tNPZ8RSflEdqUs938k 6pHLjDyref1aWIKwWxUnwnlpEH1ZG/b4XcV4fko/5ajx+1U27AiyMc1sWO/VTd3+RyVQ iStC5Sy0jc2aat0BaTE9NkuyARp3mOg0jCLOls8HN2Q0bAmNLHdWSH2FOduBU2E589cl bT19kee9IDt7FVOPzhcI7NOGnZ568hC4YbtzRAT2ljcCZZAcjER6s91Q4OMEOH5ZJtrq zNhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=FhBV+77y93RfADrzKi4v6/SRJWhEMPQfkXYIdiQGG1o=; fh=FRNyphhuT2DfOrWLD6nTLzU8xRqveLticgMhz0p6TRc=; b=ahpcaqmFwBWoBth8kmmQGCv6pAry7R+XM1f6II6MsSEyRctNH8QvMAXtmWkfFWKcHL 0N5p0O5XJYPwrwprOT7eXbWcr3R3dkYFqzhWkXn8qcrAvbf4QGeekmd7Cb+XPuZoJh9t W5n0LqDtsTvHVkgvcO+QtaMOPbjqVvAykgkoz6/fPEbhaUsPcBzul6YJADwVlc0H7B7y kBZQhNSMHrj5lw0o0S1ovGX53PJYYCVtorK7L6nbWdqkvEpCbudamPjpEqwstT9+/NUw yNhS676yoRK+xwCY9VCqUnJiki3R1Y+oqmywtNQvzVzLqJT7yDOvOtVf5rX1fYHYLpmP S8wA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fcuCU4/e"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id h6-20020a05620a244600b0076f2c73cff6si11965292qkn.697.2023.11.16.07.27.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 07:27:24 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fcuCU4/e"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E959B385800E for ; Thu, 16 Nov 2023 15:27:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 12E563858C2A for ; Thu, 16 Nov 2023 15:26:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 12E563858C2A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 12E563858C2A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::22b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700148410; cv=none; b=sb7jmlt5YgNnGhgWob5enLQD0lz14VoqJ7dOmsQBznSokJWRCsJ4GmE9pEY6S84aD5HLfSGUgKY4JlE7aj5SOZ6KMeBi2bUd6AEEP8F6VtZRzare+8v3eiyeMIspvwx/YWMBNSlb3U2hb3Dg0qVgK8uuWqc3w81pZBpE8tZVZts= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700148410; c=relaxed/simple; bh=ZVZxCvMKEH7C5Il/3/bK/7pMOgF9DC2DGlpVM5WenZo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=RzQe/I+yIOCy4raXKIiiAYEsXOLyJntzR7tua1kYtJFSttHqoV9tuujEmQ9yx+SPzvEUPrzK4UrpteLQQhDewyIocED0BNUCp/9gNZWEu8tcXcCg5QiY2hoyBgEJJs4kvh88fhnZ7fajdh4aZ6vzbKa+yUanYuR5fuaBpWmuJ1w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3b587bd1a63so989938b6e.1 for ; Thu, 16 Nov 2023 07:26:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700148408; x=1700753208; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FhBV+77y93RfADrzKi4v6/SRJWhEMPQfkXYIdiQGG1o=; b=fcuCU4/eHXrzzJgEa/MqR8pmuC/fGC9VMFeClsN88f6r+eGIlf6aLkKWJpu0Teppga 5dtTwOTL39tpJz0h6jttmX72BfRrANIgn6ylmmq5Y/hlbbhcbhdZcQzI7heQ373boJ9G EPtFl7xe7p9RU+ES1p+uuHj17qdLcGS2MCS+KQblCLG+6e3YkQ/D+eMWb4y4RnxzTROP lgSRBdusooTVhepldaocjqNzMS0Auvx6lIrC6mx8d9sh7DSh7vbylBBZzEzLaZZnAQ0r Bjhvv34AdWTmk+DNcTaS9Cld6u7OjzZg87lWRQUYvhGZEc5zEftQBGKqykIoDQhwT199 APuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700148408; x=1700753208; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FhBV+77y93RfADrzKi4v6/SRJWhEMPQfkXYIdiQGG1o=; b=jYuBtUEAfcxUchdVpVzrGkP3+gZvTJKWsaEub+hggJET5CKtvBwco86Il0DYrnh0+v Qv1LXxCR54IcmUWQHV9MBI15+NzNHyUMZNF25eEJqkzaTv6/ZFztav+4jaY78RTHXoK1 Kj8paOkAuWYnvHLrFuMswNRK0uiUQIt5sBQAfHpMSbTofUniO4i2yCoD91HooeuRFHYd zYJ5ChQsLAlEkM1D3ai/Kofb80UvRQydYSv2MTNgTxWpeAb+0eZrgfCPnkDPwqzXWa07 wPA1R7zk6IgMlKhPk7kYLGI3v0ZDzpOq/ihHkS9c0/7Z1NOzEeI6oA7a2G0M9Dj2Ntgi GF9w== X-Gm-Message-State: AOJu0YxXgGF1yHjruKR7SMT8td790CJjcvTgs+uZMZ73nutsYQocFLKO Ce+/EomqnFNK2pm/dwj/GHX1b5zpmfDfR1fMwXqfig== X-Received: by 2002:a05:6808:15a3:b0:3a7:3791:706a with SMTP id t35-20020a05680815a300b003a73791706amr1041254oiw.5.1700148407863; Thu, 16 Nov 2023 07:26:47 -0800 (PST) Received: from localhost.localdomain ([139.178.84.207]) by smtp.gmail.com with ESMTPSA id a26-20020a056808099a00b003af5f6e40d7sm1817426oic.15.2023.11.16.07.26.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 07:26:47 -0800 (PST) From: Christophe Lyon To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com, richard.earnshaw@arm.com, kyrylo.tkachov@arm.com Cc: Christophe Lyon Subject: [PATCH 1/6] arm: Fix arm_simd_types and MVE scalar_types Date: Thu, 16 Nov 2023 15:26:12 +0000 Message-Id: <20231116152617.2193377-1-christophe.lyon@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782734855771537079 X-GMAIL-MSGID: 1782734855771537079 So far we define arm_simd_types and scalar_types using type definitions like intSI_type_node, etc... This is causing problems with later patches which re-implement load/store MVE intrinsics, leading to error messages such as: error: passing argument 1 of 'vst1q_s32' from incompatible pointer type note: expected 'int *' but argument is of type 'int32_t *' {aka 'long int *'} This patch uses get_typenode_from_name (INT32_TYPE) instead, which defines the types as appropriate for the target/C library. 2023-11-16 Christophe Lyon gcc/ * config/arm/arm-builtins.cc (arm_init_simd_builtin_types): Fix initialization of arm_simd_types[].eltype. * config/arm/arm-mve-builtins.def (DEF_MVE_TYPE): Fix scalar types. --- gcc/config/arm/arm-builtins.cc | 28 ++++++++++++++-------------- gcc/config/arm/arm-mve-builtins.def | 16 ++++++++-------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/gcc/config/arm/arm-builtins.cc b/gcc/config/arm/arm-builtins.cc index fca7dcaf565..dd9c5815c45 100644 --- a/gcc/config/arm/arm-builtins.cc +++ b/gcc/config/arm/arm-builtins.cc @@ -1580,20 +1580,20 @@ arm_init_simd_builtin_types (void) TYPE_STRING_FLAG (arm_simd_polyHI_type_node) = false; } /* Init all the element types built by the front-end. */ - arm_simd_types[Int8x8_t].eltype = intQI_type_node; - arm_simd_types[Int8x16_t].eltype = intQI_type_node; - arm_simd_types[Int16x4_t].eltype = intHI_type_node; - arm_simd_types[Int16x8_t].eltype = intHI_type_node; - arm_simd_types[Int32x2_t].eltype = intSI_type_node; - arm_simd_types[Int32x4_t].eltype = intSI_type_node; - arm_simd_types[Int64x2_t].eltype = intDI_type_node; - arm_simd_types[Uint8x8_t].eltype = unsigned_intQI_type_node; - arm_simd_types[Uint8x16_t].eltype = unsigned_intQI_type_node; - arm_simd_types[Uint16x4_t].eltype = unsigned_intHI_type_node; - arm_simd_types[Uint16x8_t].eltype = unsigned_intHI_type_node; - arm_simd_types[Uint32x2_t].eltype = unsigned_intSI_type_node; - arm_simd_types[Uint32x4_t].eltype = unsigned_intSI_type_node; - arm_simd_types[Uint64x2_t].eltype = unsigned_intDI_type_node; + arm_simd_types[Int8x8_t].eltype = get_typenode_from_name (INT8_TYPE); + arm_simd_types[Int8x16_t].eltype = get_typenode_from_name (INT8_TYPE); + arm_simd_types[Int16x4_t].eltype = get_typenode_from_name (INT16_TYPE); + arm_simd_types[Int16x8_t].eltype = get_typenode_from_name (INT16_TYPE); + arm_simd_types[Int32x2_t].eltype = get_typenode_from_name (INT32_TYPE); + arm_simd_types[Int32x4_t].eltype = get_typenode_from_name (INT32_TYPE); + arm_simd_types[Int64x2_t].eltype = get_typenode_from_name (INT64_TYPE); + arm_simd_types[Uint8x8_t].eltype = get_typenode_from_name (UINT8_TYPE); + arm_simd_types[Uint8x16_t].eltype = get_typenode_from_name (UINT8_TYPE); + arm_simd_types[Uint16x4_t].eltype = get_typenode_from_name (UINT16_TYPE); + arm_simd_types[Uint16x8_t].eltype = get_typenode_from_name (UINT16_TYPE); + arm_simd_types[Uint32x2_t].eltype = get_typenode_from_name (UINT32_TYPE); + arm_simd_types[Uint32x4_t].eltype = get_typenode_from_name (UINT32_TYPE); + arm_simd_types[Uint64x2_t].eltype = get_typenode_from_name (UINT64_TYPE); /* Note: poly64x2_t is defined in arm_neon.h, to ensure it gets default mangling. */ diff --git a/gcc/config/arm/arm-mve-builtins.def b/gcc/config/arm/arm-mve-builtins.def index e2cf1baf370..a901d8231e9 100644 --- a/gcc/config/arm/arm-mve-builtins.def +++ b/gcc/config/arm/arm-mve-builtins.def @@ -39,14 +39,14 @@ DEF_MVE_MODE (r, none, none, none) #define REQUIRES_FLOAT false DEF_MVE_TYPE (mve_pred16_t, boolean_type_node) -DEF_MVE_TYPE (uint8x16_t, unsigned_intQI_type_node) -DEF_MVE_TYPE (uint16x8_t, unsigned_intHI_type_node) -DEF_MVE_TYPE (uint32x4_t, unsigned_intSI_type_node) -DEF_MVE_TYPE (uint64x2_t, unsigned_intDI_type_node) -DEF_MVE_TYPE (int8x16_t, intQI_type_node) -DEF_MVE_TYPE (int16x8_t, intHI_type_node) -DEF_MVE_TYPE (int32x4_t, intSI_type_node) -DEF_MVE_TYPE (int64x2_t, intDI_type_node) +DEF_MVE_TYPE (uint8x16_t, get_typenode_from_name (UINT8_TYPE)) +DEF_MVE_TYPE (uint16x8_t, get_typenode_from_name (UINT16_TYPE)) +DEF_MVE_TYPE (uint32x4_t, get_typenode_from_name (UINT32_TYPE)) +DEF_MVE_TYPE (uint64x2_t, get_typenode_from_name (UINT64_TYPE)) +DEF_MVE_TYPE (int8x16_t, get_typenode_from_name (INT8_TYPE)) +DEF_MVE_TYPE (int16x8_t, get_typenode_from_name (INT16_TYPE)) +DEF_MVE_TYPE (int32x4_t, get_typenode_from_name (INT32_TYPE)) +DEF_MVE_TYPE (int64x2_t, get_typenode_from_name (INT64_TYPE)) #undef REQUIRES_FLOAT #define REQUIRES_FLOAT true