[LLVMdev] Math Library Intrinsics as native intrinsics

Villmow, Micah Micah.Villmow at amd.com
Tue Apr 14 08:39:29 PDT 2009

 I have a large list of functions(60+) that I want to be legalized. I
have currently been adding them in the same manner as pow/exp etc...
These functions come in both scalar and vector versions of up to 16
elements as the 1.0 spec requires. Is this something that I could
Merge back into the tree or is another approach required? 
Some of the thoughts we were having as not to clutter the llvm namespace
was to add a math namespace and the intrinsic would go there instead.
i.e. llvm.math.fpow, llvm.math.fpowi, llvm.math.fpowr, etc...

Any ideas?


-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
On Behalf Of Dan Gohman
Sent: Monday, April 13, 2009 6:30 PM
To: LLVM Developers Mailing List
Subject: Re: [LLVMdev] Math Library Intrinsics as native intrinsics

On Apr 8, 2009, at 12:43 AM, Duncan Sands wrote:

> Hi Micah,
>> There seems to be some math library functions that are already built
>> into llvm as intrinsic(pow, exp, etc...) but there are lots that  
>> are not
>> built in yet. Is there currently work going on that is implementing
>> these? I do not want to duplicate work so I want to see what is out
>> there.
> another approach is to get rid of the llvm intrinsics, because they
> don't buy you anything that you can't get with function attributes
> and a list of libcalls.

FWIW, the reason pow, exp, and others were added as intrinsics was to
allow them to be overloaded with vector types, and to allow them
to be legalized (split, scalarized, etc.).


LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu

More information about the llvm-dev mailing list