From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30131 invoked by alias); 26 Sep 2014 11:12:24 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 30119 invoked by uid 89); 26 Sep 2014 11:12:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: cam-smtp0.cambridge.arm.com Received: from fw-tnat.cambridge.arm.com (HELO cam-smtp0.cambridge.arm.com) (217.140.96.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 26 Sep 2014 11:12:20 +0000 Received: from arm.com (e106375-lin.cambridge.arm.com [10.1.203.160]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id s8QBCGwE021144; Fri, 26 Sep 2014 12:12:16 +0100 Date: Fri, 26 Sep 2014 11:12:00 -0000 From: James Greenhalgh To: leon zadorin Cc: gcc-help Subject: Re: GCC vectorization of math functions similar to what LLVM does... Message-ID: <20140926111216.GA30080@arm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00134.txt.bz2 On Thu, Sep 25, 2014 at 02:27:04PM +0100, leon zadorin wrote: > Hello, > > a quick question on whether GCC can do (auto) vectorization of math > functions like pow, exp, log, sin, cos, et. al. as per similar to what > LLVM suggests of being able to do: > http://llvm.org/docs/Vectorizers.html#vectorization-of-function-calls > > Is GCC (e.g. 4.9.1) capable of something similar? Yes, though as with LLVM, which builtin functions are considered for vectorization will depend on the architecture you are targetting. The relevant target hook to look for in the GCC sources is "TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION" [1]. Cheers, James --- [1] https://gcc.gnu.org/onlinedocs/gccint/Addressing-Modes.html#Addressing-Modes