[llvm-commits] [llvm-gcc-4.0] r42134 - /llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
Chris Lattner
clattner at apple.com
Sun Sep 23 15:16:40 PDT 2007
On Sep 23, 2007, at 2:36 PM, Dale Johannesen wrote:
>
> On Sep 23, 2007, at 11:39 AM, Chris Lattner wrote:
>> One problem Dale:
>>
>> @@ -4350,9 +4351,10 @@
>> + case BUILT_IN_POWIL:
>> + return false; // treat long double as normal call
>> case BUILT_IN_POWI:
>> case BUILT_IN_POWIF:
>> - case BUILT_IN_POWIL:
>> Result = EmitBuiltinPOWI(exp);
>> return true;
>>
>> I don't think this works. There is no "powil" function for llvm-gcc
>> to fall back on. Not handling this builtin will result in a call to
>> __builtin_powil, which will fail at link-time. I had to handle these
>> explicitly here because "fold" produces these operations in some
>> cases. Try long double X*X*X with -ffast-math.
>
> You're right. A quick one: is changing the Intrinsics definitions
> going to affect the bitcode format?
It depends on how you change it. One thing that you may be able to
do is change this:
let Properties = [IntrNoMem] in {
..
def int_powi_f32 : Intrinsic<[llvm_float_ty, llvm_float_ty,
llvm_i32_ty]>;
def int_powi_f64 : Intrinsic<[llvm_double_ty, llvm_double_ty,
llvm_i32_ty]>;
}
to:
let Properties = [IntrNoMem] in {
..
def int_powi : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>,
llvm_i32_ty]>;
}
I don't think this changes the .ll or .bc syntax for f32/f64, but
allows any fp type to be used with powi. Calls to
Intrinsic::getDeclaration(powi) will have to change though.
-Chris
More information about the llvm-commits
mailing list