search for: fsqrt

Displaying 20 results from an estimated 42 matches for "fsqrt".

Did you mean: sqrt
2005 Apr 29
1
[LLVMdev] Floating point instructions patch
...fabsf() so for me this is unimportant ... > 2. Codegen fsin/fcos to fsin/fcos for X86. We cannot do this, except > under the control of something like -enable-unsafe-fp-math. These > instructions are architected to have a limited range. OK, I will add this flag. > 3. Codegen fsqrt/fsqrtf C functions to the FSQRT dag node. These > functions can set errno, so this is not a safe transformation. The > proper way to do this is to introduce an llvm.sqrt.f32/llvm.sqrt.f64 > pair of intrinsics to represent these operations without errno. The > optimizer ca...
2005 Apr 28
0
[LLVMdev] Floating point instructions patch
...25890.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050425/025891.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050425/025892.html Add fabs/fabsf support to x86 isel simple: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050425/025893.html Add fsqrt support to x86 pattern isel: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050425/025896.html New X86 instrs: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050425/025894.html The patches I didn't apply are these: 1. Match (Y < 0) ? -Y : Y -> FABS in the Se...
2005 Apr 28
3
[LLVMdev] Floating point instructions patch
Hello, I have been gone for a while, finishing work on my Master's thesis... Now that I'm back I updated LLVM to the most recent version and found that my FP_ABS SelectionDAGNode type and code generation was now conflicting with the new FABS node type. I brought the rest of my local modifications in line with the FABS implementation, so here is my patch that includes sqrt, sin and cos
2016 Aug 31
2
mapping calls to exp() to expf opcode
...wever, if I call exp() on the C side, I don't see the expf opcode show up on the generated assembly, I see a call to an exp function from libm. Here's what we've got in our TargetInstrinfo.td file for both of these instructions: def SQRTF64 : Other2ROp< 0b0001101, "sqrtF", fsqrt, OpInfo_F64, II_ELEMF3 >; def SQRTF32 : Other2ROp< 0b0001101, "sqrtF", fsqrt, OpInfo_F32, II_ELEMF1 >; def EXPF64 : Other2ROp< 0b0001010, "expF", fexp2, OpInfo_F64, II_ELEMF3 >; def EXPF32 : Other2ROp< 0b0001010, "expF", fexp2, OpInfo_F32, II_ELE...
2013 Jan 20
0
[LLVMdev] On calling intrinsics
sqrtf is detected by code in SelectionDAGBuilder.cpp. This gets turns into a FSQRT ISD node type that the target can handle just like any other ISD node. If the target doesn't mark ISD::FSQRT as Legal or Custom then ExpandNode in LegalizeDAG.cpp turns it back into a sqrtf libcall. On Sun, Jan 20, 2013 at 11:34 AM, David Given <dg at cowlark.com> wrote: > On 20/01/1...
2008 Dec 16
0
[LLVMdev] Another compiler shootout
...4.18s (gcc -Wall -O3 -lm ray.c -o ray) llvm-gcc 4.2.1: 5.00s (llvm-gcc -O3 -march=opteron -msse2 -lm ray.c -o ray) Note that the LLVM-generated code is 60% slower than GCC's in the first case. I am unfamiliar with x86 assembler but I believe the problem is that LLVM is calling a function for fsqrt rather than using the x86 op-code. Should I be passing some command line arguments or using a newer llvm-gcc to get it to emit fsqrt or is that not yet implemented? Benchmark was: time ./ray 9 512 >image.pgm Compile times go down from 0.36s to 0.13s on x86 and 0.35s to 0.19s on x86-64 as...
2013 Jan 20
2
[LLVMdev] On calling intrinsics
On 20/01/13 19:20, Caldarale, Charles R wrote: [...] > That's because there is no llvm.ceil.* intrinsic defined in include/llvm/Intrinsics.td for 3.2 Ah. Yes, that would explain it... does this mean that I can rely on all the intrinsics listed existing for the common types (int, float, double)? Or should I be trying to follow the libc call route? I've noticed that llc is successfully
2008 Dec 16
6
[LLVMdev] Another compiler shootout
FYI. http://leonardo-m.livejournal.com/73732.html If anyone is motivated, please file bugs for the losing cases. Also, it might make sense to incorporate the tests into our nightly tester test suite. Thanks, Evan
2013 May 17
3
[LLVMdev] Inlining sqrt library function in X86
...t with a sqrtsd instruction inline. It turns out that it could do exactly that, were it not for the fact that in the function visitUnaryFloatCall() at line 5514 in SelectionDAGBuilder.cpp, the result of !I.onlyReadsMemory() Is true, so the code is unable to replace the function call with an ISD::FSQRT SDNode. If I remove the above test, then the compiler will emit a sqrtsd instruction. I am hoping that someone might be able to comment on what onlyReadsMemory is supposed to do be doing in general and why it is returning false in this case. Thanks! Preston -- Preston Gurd <preston.gurd at i...
2013 Aug 09
2
[LLVMdev] Making MipsOptimizeMathLibCalls generic
MipsOptimizeMathLibCalls.cpp converts: g = sqrt (f); into: r1 = sqrt (f) readonly; if (g is a NaN) r2 = sqrt (f); g = phi (r1, r2) I'd like to do the same on z. Would it be OK to make this pass generic and do the transformation whenever FSQRT isLegalOrCustom for the type? If so, should it stay a separate pass, or should I merge it with something else? Thanks, Richard
2016 Jun 24
3
creating Intrinsic DAG Node
...6, at 7:49 AM, Ryan Taylor via llvm-dev < >> llvm-dev at lists.llvm.org> wrote: >> >> given the following C code: >> >> float b=16, a=0; >> int main() { >> float a = sqrt(b); >> return0; >> } >> >> I'm trying to lower FSQRT down, but getting a casting issue, my code is: >> >> SDValue XXXLowering::LowerFSQRT(SDValue Op, SelectionDAG &DAG) const { >> SDLoc DL(Op); >> EVT VT = Op.getValueType(); >> SDValue LHS = Op.getOperand(0); >> >> SDValue newNode = DAG.getNod...
2014 Sep 18
3
[LLVMdev] predicates vs. requirements [TableGen, X86InstrInfo.td]
...ving as I expected. Example: // For scalar unary operations, fold a load into the operation // only in OptForSize mode. It eliminates an instruction, but it also // eliminates a whole-register clobber (the load), so it introduces a // partial register update condition. def : Pat<(f32 (fsqrt (load addr:$src))), (VSQRTSSm (f32 (IMPLICIT_DEF)), addr:$src)>, Requires<[HasAVX, OptForSize]>; This is generated: vsqrtss (%rdi), %xmm0, %xmm0 regardless of whether I specify -Os or -O1 with clang. -------------- next part -------------- An HTML attachmen...
2011 Mar 15
3
[LLVMdev] mblaze backend: unreachable executed
...the 2.8 release. I added code to emit an fneg assembly instruction and now I'm getting "UNREACHABLE executed!" when trying to compile the code. The only change I made was to add the following two lines next to the square root lines in the code (FPU and sqrt are enabled in llc): def FSQRT : ArithF2<0x16, 0x300, "fsqrt ", IIAlu>; def FNEG : ArithF2<0x16, 0x300, "fneg ", IIAlu>; // added for fneg and def : Pat<(fsqrt FGR32:$V), (FSQRT FGR32:$V)>; def : Pat<(fneg FGR32:$V), (FNEG FGR32:$V)>; // added for fneg Does anyone know w...
2013 Oct 19
2
[LLVMdev] Feature request for include llvm-mc in llvm.org/builds
...86-pc-mingw sqrt.s The output format is file format ELF32-i386, i wanna to know is there a way to output COFF format along with target=i686-pc-mingw. because I want to compile to following asm file for both linux/gcc and windows/visual C++. .global sqrt .type sqrt, at function sqrt: fldl 4(%esp) fsqrt fstsw %ax sub $12,%esp fld %st(0) fstpt (%esp) mov (%esp),%ecx and $0x7ff,%ecx cmp $0x400,%ecx jnz 1f and $0x200,%eax sub $0x100,%eax sub %eax,(%esp) fstp %st(0) fldt (%esp) 1: add $12,%esp fstpl 4(%esp) fldl 4(%esp) ret > > Cheers, > Rafael -- 此致 礼 罗勇刚 Yours sincerely, Y...
2013 Aug 16
0
[LLVMdev] Making MipsOptimizeMathLibCalls generic
...thLibCalls.cpp converts: > > g = sqrt (f); > > into: > > r1 = sqrt (f) readonly; > if (g is a NaN) > r2 = sqrt (f); > g = phi (r1, r2) > > I'd like to do the same on z. Would it be OK to make this pass generic > and do the transformation whenever FSQRT isLegalOrCustom for the type? > > If so, should it stay a separate pass, or should I merge it with > something else? > > Thanks, > Richard > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs...
2013 May 17
0
[LLVMdev] Inlining sqrt library function in X86
...e. > > It turns out that it could do exactly that, were it not for the fact that in the function visitUnaryFloatCall() at line 5514 in SelectionDAGBuilder.cpp, the result of > > !I.onlyReadsMemory() > > Is true, so the code is unable to replace the function call with an ISD::FSQRT SDNode. If I remove the above test, then the compiler will emit a sqrtsd instruction. > > I am hoping that someone might be able to comment on what onlyReadsMemory is supposed to do be doing in general and why it is returning false in this case. > The compiler is being conservative ab...
2013 Dec 11
1
[LLVMdev] runtime performance benchmarking tools for clang
2) For lag in execution time due to floating point operations, it was clearly observed that gcc used floating point instruction FSQRT, where as clang seemed to use emulated function (?) BL SQRT. Note that we used the following flags for both clang as well as gcc compilation. -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 Infact, i was surprised to see that even when " -march=armv7-a -mfloat-abi=hard...
2016 Jun 24
2
creating Intrinsic DAG Node
...int, not a float. —escha > On Jun 24, 2016, at 7:49 AM, Ryan Taylor via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > given the following C code: > > float b=16, a=0; > int main() { > float a = sqrt(b); > return0; > } > > I'm trying to lower FSQRT down, but getting a casting issue, my code is: > > SDValue XXXLowering::LowerFSQRT(SDValue Op, SelectionDAG &DAG) const { > SDLoc DL(Op); > EVT VT = Op.getValueType(); > SDValue LHS = Op.getOperand(0); > > SDValue newNode = DAG.getNode(ISD::INTRINSIC_WO_CHAIN,...
2013 Oct 21
0
[LLVMdev] Feature request for include llvm-mc in llvm.org/builds
...is file format ELF32-i386, i wanna to know > is there a way to output COFF format along with target=i686-pc-mingw. > because I want to compile to following asm file for both linux/gcc and > windows/visual C++. > > .global sqrt > .type sqrt, at function > sqrt: fldl 4(%esp) > fsqrt > fstsw %ax > sub $12,%esp > fld %st(0) > fstpt (%esp) > mov (%esp),%ecx > and $0x7ff,%ecx > cmp $0x400,%ecx > jnz 1f > and $0x200,%eax > sub $0x100,%eax > sub %eax,(%esp) > fstp %st(0) > fldt (%esp) > 1: add $12,%esp > fstpl 4(%esp) > fldl 4(%esp) &g...
2013 Dec 11
0
[LLVMdev] runtime performance benchmarking tools for clang
...time than clang, when same libc.so.6 & ld-linux.so.3 were being used for both executables generated by gcc & clang executions. What could be the possible reason ? 2) For lag in execution time due to floating point operations, it was clearly observed that gcc used floating point instruction FSQRT, where as clang seemed to use emulated function (?) BL SQRT. Note that we used the following flags for both clang as well as gcc compilation. -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 Infact, i was surprised to see that even when " -march=armv7-a -mfloat-abi= *hard* -...