search for: doublety

Displaying 20 results from an estimated 20 matches for "doublety".

2020 Jan 14
2
sizeof implementation: how to get size as a constantInt?
...terNull::get(pointerTy), constint1); auto *size = builder.CreatePtrToInt(p, llvm::IntegerType::get(context, 64)); and type definitions: auto *constint1 = llvm::ConstantInt::get(context, llvm::APInt(64, 1)); auto *int64Ty = llvm::IntegerType::get(context, 64); auto *doubleTy = llvm::Type::getDoubleTy(context); auto *structTy = llvm::StructType::create(context, "Foo"); structTy->setBody({int64Ty, doubleTy}); auto *pointerTy = llvm::PointerType::get(structTy, 0); take care that the "size" is a "llvm::Value" type, not a "llvm::consta...
2008 Jun 09
0
[LLVMdev] regression? Or did I do something wrong again?
...e*, double) > hendrik at lovesong:~/dv/llvm/tut$ It seems the ConstantFP method get might have been modified to take a reference-to-APFloat, meaning you can't pass in APFloat(Value) anonymously. You should either put it in a local variable, like APFloat F(Val); return ConstantFP::get(Type::DoubleTy, F); which I _think_ is the right way to use the first get() function. Easier is to use the alternative get() function, which simply takes a double directly. i.e., return ConstantFP::get(Type::DoubleTy, Val); Could you please test both and report the results? Gr. Matthijs -------------- next pa...
2008 Jun 10
1
[LLVMdev] regression? Or did I do something wrong again?
...: > Hi Hendrik, > > It seems the ConstantFP method get might have been modified to take a > reference-to-APFloat, meaning you can't pass in APFloat(Value) anonymously. > You should either put it in a local variable, like > APFloat F(Val); > return ConstantFP::get(Type::DoubleTy, F); > which I _think_ is the right way to use the first get() function. Easier is to > use the alternative get() function, which simply takes a double directly. > i.e., > return ConstantFP::get(Type::DoubleTy, Val); > > Could you please test both and report the results? >...
2009 Aug 23
1
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
...ur function doesn't > take parameters. Maybe using an irbuilder would help? It does take one parameter. Here's the important bits: // My Function extern "C" void print(double X) { printf("%f\n", X); } // Args type std::vector<const Type*> args(1, Type::getDoubleTy(getGlobalContext())); // return void, 1 arg double, no varargs FT = FunctionType::get(Type::getVoidTy(getGlobalContext()), args, false); // creating stub for print function Function* printFunction = Function::Create(FT, Function::ExternalLinkage, "print", module); By doing this (and the...
2008 Jun 09
7
[LLVMdev] regression? Or did I do something wrong again?
I don't know if the toy program in chapter 4 of the tutorial implementing Kaleidoscope in llvm with C++ is part of your regression suite, but with the version of llvm I installed last weekend, it does not compile: hendrik at lovesong:~/dv/llvm/tut$ g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit native` -O3 -o toy toy.cpp: In member function ‘virtual llvm::Value*
2015 Jan 22
3
[LLVMdev] numeric limits of llvm Types?
Hi all, can I access the numeric limits of the llvm types, e.g. HalfTy, FloatTy, DoubleTy, etc. in a fashion like the std numeric_limits tool? std::numeric_limits<half>::min() std::numeric_limits<half>::max() In c++API, I want to initialize values and need to know the correct range for the llvm types.... Thx Alex
2009 Aug 22
1
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
...Albert, I'm having a similar problem and I found I can't declare the function and use it, most likely because my syntax is wrong. I have the function extern'd and am creating only the signature on the IR code (attached). The idea is that it creates something like this: My variable is DoubleTy and the expected parameter is also, but I'm getting this error: Assertion `(0 == FTy->getNumParams() || FTy->getParamType(0) == Actual->getType()) && "Calling a function with a bad signature!"' cheers, --renato Reclaim your digital rights, eliminate DRM, learn...
2009 Aug 22
0
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
...milar problem and I found I can't declare the function > and use it, most likely because my syntax is wrong. > > I have the function extern'd and am creating only the signature on the > IR code (attached). The idea is that it creates something like this: > > My variable is DoubleTy and the expected parameter is also, but I'm > getting this error: > > Assertion `(0 == FTy->getNumParams() || FTy->getParamType(0) == > Actual->getType()) && "Calling a function with a bad signature!"' > > cheers, > --renato > > Reclaim...
2008 Jun 09
0
[LLVMdev] regression? Or did I do something wrong again?
...sy to fix; from the LLVM 2.3 release notes: "The ConstantFP::get method that uses APFloat now takes one argument instead of two. The type argument has been removed, and the type is now inferred from the size of the given APFloat value." So to make it compile, "ConstantFP::get(Type::DoubleTy, APFloat(Val));" needs to be changed to "ConstantFP::get(APFloat(Val));". -Eli
2009 Jul 04
2
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
John McCall wrote: > On Jul 2, 2009, at 1:05 AM, Carter Cheng wrote: >> I am having some difficulties getting the LLVM JIT to resolve extern >> "C" functions which I have defined in source file and invoking them >> via EE::runFunction() after generating a Function prototype for it. >> Is this possible or do I need to generate a .so for my functions are
2017 Feb 06
3
Kaleidoscope tutorial: comments, corrections and Windows support
...- "LLVMContext" does not exist as a variable -> "TheContext" - Chapter 3: 5 times - Chapter 4: 1 time - Chapter 5: 4 times - Chapter 6: 2 times - Chapter 7: 2 times 3.4. Function Code Generation - Wouldn't it make sense to have a "Type *DoubleTy = Type::getDoubleTy(TheContext);"? - "Function *TheFunction = TheModule->getFunction(Proto->getName());" The new getName method is unexpected, the tutorial user has to lookup and copy the definition from the full listing. 3.5. Driver Changes and Closing Thoughts -...
2009 Jun 05
2
[LLVMdev] Int1 to Double Type Conversion
Hello, I would like to know if there is an instruction to convert values from the Int1 type to the Double type in LLVM. I would like to achieve the equivalent of casting a bool value to a double value in C++. Doing the simple CreateSIToFP or CreateUIToFP does not work, it throws an assertion ("invalid cast"). I simply want to avoid branching it's not necessary. What's the
2009 Jun 05
0
[LLVMdev] Int1 to Double Type Conversion
On Fri, Jun 5, 2009 at 2:15 PM, Nyx<mcheva at cs.mcgill.ca> wrote: > > Hello, > > I would like to know if there is an instruction to convert values from the > Int1 type to the Double type in LLVM. I would like to achieve the equivalent > of casting a bool value to a double value in C++. Doing the simple > CreateSIToFP or CreateUIToFP does not work, it throws an assertion
2011 Oct 21
2
[LLVMdev] convert integer to double "uitofp" or "sitofp" ?
...;sitofp" ? We track the values taken by all load instructions and we process them using a function. If the value is a pointer, we use int64 as the type of the function argument. But in case the load instruction loads from a scalar, we need to convert it to a unique type, which we chose to be DoubleTy and use a function that expects a double as parameter. Hence, we need to convert integers of various sizes to double. Is it possible to detect which instruction should be  used ("uitofp" or "sitofp" )? Thank you, Alexandra -------------- next part -------------- An HTML attac...
2008 Jun 07
2
[LLVMdev] ExecutionEngine::create returns 0
What does it mean when ExecutionEngine::create returns 0? Here's a simplified example: #include "llvm/Module.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" main() { llvm::Module * module = new llvm::Module("the module"); llvm::ExecutionEngine *ee = llvm::ExecutionEngine::create(module); fprintf(stdout, "pointer is %x.\n", ee); } I
2008 Jun 09
0
[LLVMdev] ExecutionEngine::create returns 0
...discovered this with a more complicated example in which I got a > segmentation fault the moment I tried to use the created execution > engine for anything. I got the toy.cpp program from Chapter 4 of the tutorial to compile, after one change to line 359 from return ConstantFP::get(Type::DoubleTy, APFloat(Val)); to return ConstantFP::get(APFloat(Val)); Now to compare it in detail with the much smaller program I've got and maybe I'll figure out what's wrong with my call to ExecutionEngine::create. -- hendrik
2009 Sep 30
0
[LLVMdev] long double type on ARM
Hi Jin-Gu Kang! It are possible that the problem you are experiencing have already been solved in the current llvm 2.6 release tree and the current svn trunk. So try using llc from llvm 2.6 release branch or llvm pre2.7 svn trunk! It would be helpful if you could open a bugreport for this issue and attach the problematic od.bc since we need a testcase from the bitcode that exposes the bug inorder
2006 Sep 02
0
[LLVMdev] gfortran calling convention
On Fri, 1 Sep 2006, Michael McCracken wrote: > Here's what works now, and I have a separate test case for each of these: > > statement functions > intrinsic functions (print, cos, etc) > loops, goto statments > scalarized array operations > function calls with *no arguments* > simple common blocks Great! > Function calls with more than one argument don't work.
2006 Sep 02
2
[LLVMdev] gfortran calling convention
The NIST F77 test suite doesn't seem to be compatible with gfortran at all, so I had to work from my own sample codes, and generate test cases from them. Here's what works now, and I have a separate test case for each of these: statement functions intrinsic functions (print, cos, etc) loops, goto statments scalarized array operations function calls with *no arguments* simple common
2009 Sep 30
5
[LLVMdev] long double type on ARM
Dear LLVM members. I am compiling coreutils-7.4 package for ARM linux using LLVM 2.5 version. When i compiled 'od' program in coreutils package using LLVM 2.5, i could see the error message on llc processing. > llvm-gcc -emit-llvm ./od.c -c -o ./od.bc -other-options... > llc -march=arm ./od.bc -f -o ./od.s llc: