similar to: [LLVMdev] FW: Need help in converting int to double

Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] FW: Need help in converting int to double"

2011 Sep 22
0
[LLVMdev] Need help in converting int to double
Hi Sarath, It would have really helped if you had removed the commented out code and inlined the calls to your homemade helper functions before sending it... You are doing this, in LLVM IR: %0 = getelementptr %Value* %firstArg, i32 0 ; i8** %1 = load i8** %0 ; i8* %2 = bitcast i8* %1 to i64* %3 = getelementptr %Value* %secondArg, i32 0 ; i8** %4 = load i8** %3; i8* %5 = bitcast i8* %4 to i64*
2011 Sep 22
1
[LLVMdev] Need help in converting int to double
Yeah, that's the fault...got the answer...... Thanks James for the help... Struggling with this for so many days....... On Thu, Sep 22, 2011 at 4:02 PM, James Molloy <James.Molloy at arm.com> wrote: > Hi Sarath,**** > > ** ** > > It would have really helped if you had removed the commented out code and > inlined the calls to your homemade helper functions before
2011 Sep 22
2
[LLVMdev] Need help in converting int to double
On Thu, Sep 22, 2011 at 3:46 PM, sarath chandra <sarathcse19 at gmail.com>wrote: > Hi James, > > First i converted the void * to int* and then did FPToSI...then did SHL...( > because CreateShl only accepts integers... i pointer casted it to int64 type > first)... Below is the code snippet.... > > > lhs = mBuilder.CreateStructGEP(firstArg, 0); > lhs =
2011 Sep 22
3
[LLVMdev] Need help in converting int to double
Hi, I'm pursuing M.Tech course. As a part of the project work i'm using LLVM as back-end. My project area is "Enhancing the performance of V8 javascript engine using LLVM as a back-end". Now i'm writing code for shift left(SHL) operator. I had my own Value Structure .. it's like this Struct Value { void *val ; char type; } The "char type" holds
2011 Sep 23
0
[LLVMdev] Need help in converting int to double
Good to know, thanks. The docs are slightly hazy on that - they do mention type-to-type if same size, but the examples are only between pointers and integers, not floats. Would it be worthwhile my updating the documentation to explicitly state that or is it just me? Cheers, James -----Original Message----- From: John McCall [mailto:rjmccall at apple.com] Sent: 23 September 2011 00:06 To: James
2011 Sep 23
1
[LLVMdev] Need help in converting int to double
Hi James, > The docs are slightly hazy on that - they do mention type-to-type if same size, but the examples are only between pointers and integers, not floats. you can't use bitcast to convert a pointer to an integer or vice-versa. You must use ptrtoint/inttoptr. Ciao, Duncan. Would it be worthwhile my updating the documentation to explicitly state that or is it just me? > >
2007 Dec 17
0
[LLVMdev] Elsa and LLVM and LLVM submissions
I used &Idx[0]. In future, please avoid tabs in your patch. I applied your patch. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071217/056403.html - Devang On Dec 17, 2007, at 2:57 AM, Richard Pennington wrote: > Devang Patel wrote: >> On Dec 15, 2007, at 12:15 PM, Richard Pennington wrote: >>> I got the current version of LLVM via svn yesterday and
2011 Sep 22
2
[LLVMdev] Need help in converting int to double
On Sep 22, 2011, at 3:32 AM, James Molloy wrote: > It’s in trouble by this point because it needs to do a fptosi on a double operand, but you’ve got an i64 operand and you can’t reinterpret-cast ints to floats in LLVM IR (AFAIK) You can bitcast ints to floats and vice-versa if they're the same size — for example, i32 to float and i64 to double. John.
2010 Sep 28
2
[LLVMdev] x86 rounding mode question
Hi, Is there a recommended way to round to the nearest whole (x86 RC field of FPU control = 00) ? It appears an intentional truncation instruction is generated (if ms disassembly is correct): IRBuilder<>::CreateFPToSI %1 = fptosi double %0 to i64 00370025 fisttp qword ptr [esp] Thanks, Bob -------------- next part -------------- An HTML attachment was
2016 Jan 22
2
fptosi undefined behaviour
Hi all, Consider the following snippet, the aim of which is to convert a double to a signed i16, returning 0 if not exactly representable: define i16 @foo(double) { top: %1 = fptosi double %0 to i16 %2 = sitofp i16 %1 to double %3 = fcmp une double %2, %0 %4 = select i1 %3, i16 0, i16 %1 ret i16 %4 } Of course, if the value is out-of-range, the result of fptosi is undefined.
2017 Mar 20
2
Is it a valid fp transformation?
I agree. There’s implementation-defined behavior on the conversion of (arg*58) to int, but that shouldn’t be at issue here. The transform of (float)x + 1 => (float)(x + 1) is bogus. > On Mar 20, 2017, at 10:41 AM, Sanjay Patel via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Looks broken to me; I don't think there's UB in the original program. > > The fold in
2016 Apr 14
2
Little explanation of this behaviour
I tried to emit IR for a function that returns the sum between an signed char and a double in C++, just to see how Clang handles type implicit casting. Can you explain me why Clang converted the char type into a 32-bit integer type before casting it to a floating point? Can a sitofp i8 %3 to double be done or is it wrong? define i32 @_Z5sumad(i8 signext %x, double %y) #0 { %1 = alloca i8,
2016 May 16
6
Working on FP SCEV Analysis
[+CC Andy] Hi Elena, I don't have any fundamental issues with teaching SCEV about floating point types, but given this will be a major change, I think a high level roadmap should be discussed on llvm-dev before we start reviewing and committing changes. Here are some issues that I think are worth discussing: - Core motivation: why do we even care about optimizing floating point
2016 May 18
2
Working on FP SCEV Analysis
>What situations are they common in? ICC Vectorizer made a paradigm shift a while ago. If there aren’t a clear reason why something can’t be vectorized, we should try our best to vectorize. The rest is a performance modeling (and priority to implement) question, not a capability question. We believe this is a good paradigm to follow in a vectorizer development. It was a big departure from
2008 Mar 04
0
[LLVMdev] Deleting Instructions after Intrinsic Creation
Hi, I tried creating intrinsics which are to be placeholders for a set of instructions which should not be executed by the backend. I want to retain only intrinsic,phi and terminator instructions in a basic block. I have taken care of the external dependencies of basic block. How do I delete the rest of the instructions? Thank You Aditya P.S:
2008 Mar 04
1
[LLVMdev] Deleting Instructions after Intrinsic Creation
Hi, I tried creating intrinsics which are to be placeholders for a set of instructions which should not be executed by the backend. I want to retain only intrinsic,phi and terminator instructions in a basic block. I have taken care of the external dependencies of basic block. How do I delete the rest of the instructions? Thank You Aditya P.S:
2017 Feb 13
2
RFC: Representing unions in TBAA
Hello all, I'm new to the llvm community. I'm learning how things work. I noticed that there has been some interest in improving how unions are handled. Bug 21725 is one example. I figured it might be a interesting place to start. I discussed this with a couple people, and below is a suggestion on how to represent unions. I would like some comments on how this fits in with how
2011 Oct 19
2
[LLVMdev] Error when cond of select instruction is a vector
Hi LLVMdev, In the specification of llvm ir, the select operation can takes a condition of vector type, 'select' Instruction Syntax: <result> = select *selty* <cond>, <ty> <val1>, <ty> <val2> *; yields ty* *selty* is either i1 or {<N x i1>} Overview: The 'select' instruction is used to choose one value based on a condition,
2011 Oct 19
0
[LLVMdev] Error when cond of select instruction is a vector
This is indeed a bug. I get a different error on my machine. Until we solve this bug, as a workaround, you can use the <4 x float> type for which the vselect works. From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Fan Dawei Sent: Wednesday, October 19, 2011 10:10 To: LLVMdev at cs.uiuc.edu Subject: [LLVMdev] Error when cond of select instruction is
2008 Jun 03
0
[LLVMdev] Truncate float to int?
On Tue, Jun 3, 2008 at 11:32 AM, Mark Leone <markleone at gmail.com> wrote: > Newbie question here: what's the best way to truncate a float to a > signed int? The fptosi instruction rounds, and the fptrunc > instruction simply truncates from a large float type to a smaller > float type. fptosi is equivalent to a C cast from float to int. -Eli