From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by sourceware.org (Postfix) with ESMTPS id 2228A3858400 for ; Mon, 11 Jul 2022 04:54:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2228A3858400 Received: by mail-pj1-x1034.google.com with SMTP id y14-20020a17090a644e00b001ef775f7118so7202052pjm.2 for ; Sun, 10 Jul 2022 21:54:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=yCBP/fLsPxmp3DeAUScj8Dt1SgQ9cr7jK1tlYkYCAm4=; b=wfblqbFq5OJnMN/AI3KoL2itiHE8k2FlBdgALnkpQ/xXBJb8MrrJdk2xWmUyimu/PK IbXV5ni1NKtKz2gb/83FM3YABj24mJkeJ7GeNynFhA4FjrvjFNpdgovy5SiA7XSOfq0w B9SWhKIKTdOkQvXPNvt45fMEyPuYhGLxIjyO1L9plZINqKorgJgcDMBRsAqIMxK1p1M/ bSmqlzx2u1dB6lkQ5m3ZzAQ+9fgJ7wwEqsX+69p47wbRMSDYXeYGkMUMQTBf+DBAxxQa RZp0P+0NufX6CVm5mXu5w7HNHPaCi9Ouhx2cTVyf5pbZSuDkVLrSLmo1xQ8hHVOTOf/o Y79w== X-Gm-Message-State: AJIora8EqQYw+EYv6ba+C3e/YGw0MyWWt8ywL5SwR9QNO623l7+FFUdo rKmO30ZUnzbAae1wx/OPRksWAcbOtVg= X-Google-Smtp-Source: AGRyM1uffUAOxBwss3V9U9H7A0Uf3vkvxp6NosW8A4LfKy/0MKhRU/zjk5fz2hBUJAILp1gd1CmCLQ== X-Received: by 2002:a17:90b:1d0d:b0:1ef:afd1:9f25 with SMTP id on13-20020a17090b1d0d00b001efafd19f25mr15171373pjb.200.1657515286224; Sun, 10 Jul 2022 21:54:46 -0700 (PDT) Received: from [172.31.0.204] (c-73-63-24-84.hsd1.ut.comcast.net. [73.63.24.84]) by smtp.gmail.com with ESMTPSA id w13-20020a17090a1b8d00b001e2f892b352sm5898694pjc.45.2022.07.10.21.54.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Jul 2022 21:54:45 -0700 (PDT) Message-ID: <659026ec-f845-71d6-f35d-407030d30e60@gmail.com> Date: Sun, 10 Jul 2022 22:54:45 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] [RFC]Support vectorization for Complex type. Content-Language: en-US To: gcc-patches@gcc.gnu.org References: <20220711034339.18450-1-hongtao.liu@intel.com> From: Jeff Law In-Reply-To: <20220711034339.18450-1-hongtao.liu@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 04:54:49 -0000 On 7/10/2022 9:43 PM, liuhongt via Gcc-patches wrote: > The patch only handles load/store(including ctor/permutation, except > gather/scatter) for complex type, other operations don't needs to be > handled since they will be lowered by pass cplxlower.(MASK_LOAD is not > supported for complex type, so no need to handle either). > > Instead of support vector(2) _Complex double, this patch takes vector(4) > double as vector type of _Complex double. Since vectorizer originally > takes TYPE_VECTOR_SUBPARTS as nunits which is not true for complex > type, the patch handles nunits/ncopies/vf specially for complex type. > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > Also test the patch for SPEC2017 and find there's complex type vectorization > in 510/549(but no performance impact). No comment on the implementation.  From a benchmarking standpoint you might want to look at cam4 in speed, not rate mode.     I'd bet you'd want -ffast-math or -fcx-limited-range to avoid divdc3 and have those calls expanded inline which may give you a better crack at exposing vectorization opportunities in there. jeff