search for: floatty

Displaying 20 results from an estimated 30 matches for "floatty".

Did you mean: float
2007 Jul 20
5
[LLVMdev] Seg faulting on vector ops
...uot; #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/Support/ManagedStatic.h" #include <iostream> using namespace llvm; Value* makeVector(Value* s, unsigned int dim, BasicBlock* basicBlock) { AllocaInst* pV = new AllocaInst(VectorType::get(Type::FloatTy,dim),"pv",basicBlock); Value* v = new LoadInst(pV,"v",basicBlock); for (unsigned int i = 0 ; i < dim ; ++i) v = new InsertElementInst(v,s,i,"v",basicBlock); return v; } Function* generateVectorAndSelect(Module* pModule) { std...
2014 Feb 18
3
[LLVMdev] How to codegen an LLVM-IR that has dynamic arrays in it?
...n an LLVM IR file from my code generator? Say., how to create an array type with a size determined through a global variable. Symbolically, something like below: Value *sz = Mod->getOrInsertGlobal("SIZE", Int32Ty); Type *ArrayTy = ArrayType::get(FloatTy, sz) AllocaInst *AI = CreateAlloca(ArrayTy, 0, ""); Thanks, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140217/249b89be/attachment.html>
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
2007 Jul 21
0
[LLVMdev] Seg faulting on vector ops
...t; > #include "llvm/Support/ManagedStatic.h" > > #include <iostream> > > using namespace llvm; > > > > Value* makeVector(Value* s, unsigned int dim, BasicBlock* basicBlock) > > { > > AllocaInst* pV = new > AllocaInst(VectorType::get(Type::FloatTy,dim),"pv",basicBlock); > > Value* v = new LoadInst(pV,"v",basicBlock); > > > > for (unsigned int i = 0 ; i < dim ; ++i) > > v = new InsertElementInst(v,s,i,"v",basicBlock); > > > > return v; > > } > > &...
2008 Feb 22
2
[LLVMdev] Calling functions
Hello! I'm trying LLVM for generating code and I found something I cannot figure out or find in the documentation: I'm doing something like this to call "sin" from std: std::vector<const Type*> params; params.push_back( Type::FloatTy ); FunctionType *FT = FunctionType::get( Type::FloatTy, params, false); Function *F = new Function( FT, Function::ExternalLinkage, "sin", M ); CallInst *CallExternal = new CallInst( F, SomeValue, "external_call", BB ); I can make some calls to functions like glclear() a...
2007 Jul 24
2
[LLVMdev] Seg faulting on vector ops
...quot; >> >> #include <iostream> >> >> using namespace llvm; >> >> >> >> Value* makeVector(Value* s, unsigned int dim, BasicBlock* basicBlock) >> >> { >> >> AllocaInst* pV = new >> AllocaInst(VectorType::get(Type::FloatTy,dim),"pv",basicBlock); >> >> Value* v = new LoadInst(pV,"v",basicBlock); >> >> >> >> for (unsigned int i = 0 ; i < dim ; ++i) >> >> v = new InsertElementInst(v,s,i,"v",basicBlock); >> >> >&g...
2008 Feb 25
0
[LLVMdev] Calling functions
...| I'm trying LLVM for generating code and I found something I cannot figure out or find in the documentation: | | I'm doing something like this to call "sin" from std: | | std::vector<const Type*> params; | params.push_back( Type::FloatTy ); | FunctionType *FT = FunctionType::get( Type::FloatTy, params, false); | Function *F = new Function( FT, Function::ExternalLinkage, "sin", M ); | CallInst *CallExternal = new CallInst( F, SomeValue, "external_call", BB ); | | | I...
2007 Jul 20
0
[LLVMdev] Seg faulting on vector ops
...> #include "llvm/Support/ManagedStatic.h" > > #include <iostream> > > using namespace llvm; > > > > Value* makeVector(Value* s, unsigned int dim, BasicBlock* basicBlock) > > { > > AllocaInst* pV = new AllocaInst(VectorType::get > (Type::FloatTy,dim),"pv",basicBlock); > > Value* v = new LoadInst(pV,"v",basicBlock); > > > > for (unsigned int i = 0 ; i < dim ; ++i) > > v = new InsertElementInst(v,s,i,"v",basicBlock); > > > > return v; > > } > &g...
2007 Jul 26
0
[LLVMdev] Seg faulting on vector ops
...gt; >>> using namespace llvm; >>> >>> >>> >>> Value* makeVector(Value* s, unsigned int dim, BasicBlock* >>> basicBlock) >>> >>> { >>> >>> AllocaInst* pV = new >>> AllocaInst(VectorType::get(Type::FloatTy,dim),"pv",basicBlock); >>> >>> Value* v = new LoadInst(pV,"v",basicBlock); >>> >>> >>> >>> for (unsigned int i = 0 ; i < dim ; ++i) >>> >>> v = new InsertElementInst(v,s,i,"v",basic...
2008 Jan 04
7
[LLVMdev] Calling functions across modules. And those pesky vectors!
...9;t seem to get a simple function which takes in and returns vectors to work properly. And I don't understand the error. I made a simple function which was just supposed to multiply two 3 component float vectors and return the result: //Snip on: VectorType *vType = VectorType::get(Type::FloatTy, 3); std::vector<const Type*> Vectors(2, vType); FunctionType *mul_type = FunctionType::get(vType, Vectors, false); Function* mul = new Function(mul_type, Function::ExternalLinkage, "mul", mod); mul->setCallingConv(CallingConv::C); Fu...
2009 Apr 15
0
[LLVMdev] Tablegen question
I still think there is a bug somewhere, but not sure where yet. This is what is generated in intrinsic.gen: case Intrinsic::opencl_math_fdistance: // llvm.opencl.math.fdistance ResultTy = Type::FloatTy; ArgTys.push_back(Tys[0]); ArgTys.push_back(Tys[0]); break; This is the intrinsic definition: def int_opencl_math_fdistance_fast : Intrinsic<[llvm_float_ty], [llvm_anyfloat_ty, LLVMMatchType<0>]>; The problem comes when I try to use the intrins...
2008 Jan 05
0
[LLVMdev] Calling functions across modules. And those pesky vectors!
...imple function which was just supposed to multiply two 3 component > float vectors and return the result: "Vectors must have a power of two length (1, 2, 4, 8, 16 ...)." - http://llvm.org/docs/LangRef.html#t_vector > //Snip on: > VectorType *vType = VectorType::get(Type::FloatTy, 3); Nick
2009 Apr 15
1
[LLVMdev] Tablegen question
...at 11:15 AM, Villmow, Micah <Micah.Villmow at amd.com> wrote: > I still think there is a bug somewhere, but not sure where yet. > This is what is generated in intrinsic.gen: > case Intrinsic::opencl_math_fdistance:          // > llvm.opencl.math.fdistance >    ResultTy = Type::FloatTy; >    ArgTys.push_back(Tys[0]); >    ArgTys.push_back(Tys[0]); >    break; > > This is the intrinsic definition: > def int_opencl_math_fdistance_fast   : Intrinsic<[llvm_float_ty], >                           [llvm_anyfloat_ty, LLVMMatchType<0>]>; > > The prob...
2009 Apr 15
3
[LLVMdev] Tablegen question
Oops. That was premature. I think your original question was on the right track. TableGen distinguishes between known and "overloaded" types (like "llvm_anyfloat_ty" in your example). The overloaded types are numbered separately, and the argument to LLVMMatchType is an index into these overloaded types, ignoring the known types. So, in your case, the first
2009 Apr 15
2
[LLVMdev] Tablegen question
On Apr 15, 2009, at 11:15 AM, Villmow, Micah wrote: > I still think there is a bug somewhere, but not sure where yet. > This is what is generated in intrinsic.gen: > case Intrinsic::opencl_math_fdistance: // > llvm.opencl.math.fdistance > ResultTy = Type::FloatTy; > ArgTys.push_back(Tys[0]); > ArgTys.push_back(Tys[0]); > break; OK. That looks right to me. > This is the intrinsic definition: > def int_opencl_math_fdistance_fast : Intrinsic<[llvm_float_ty], > [llvm_anyfloat_ty, LLVMMatchType<0&gt...
2007 Sep 05
2
[LLVMdev] Seeing a crash with ConstantFP::get
...1 ? atol(argv[1]) : 24; // Create some module to put our function into it. Module *M = new Module("test"); // We are about to create the "fib" function: Function *FibF = CreateFibFunction(M); // add the following line Constant* C = ConstantFP::get(Type::FloatTy,0.0); Can someone verify this? This is on the PC side of my system which I build with the VStudio files. I don't know if the Mac side sees this as well, but I'll try and verify. Seems really odd to have something this basic crash me. It came up because the JITter will call Consta...
2009 May 21
3
[LLVMdev] Passing a pointer to a function
...rTy->getElementType()->isInteger()) { fcall = buildFcallMem(*theModule, "load_int", Type::Int32Ty); CallInst::Create(fcall, P, "", &I); } else if (PtrTy->getElementType()->isInteger()){ fcall = buildFcallMem(*theModule, "load_float", Type::FloatTy); CallInst::Create(fcall, P, "", &I); } } But then I get segfaults or assertions fail in Type.h (it's a huge mess). I could be more specific, but I have tried several different approaches and am trying to be brief here. Perhaps I am overlooking an obvious approach. I will...
2007 Sep 05
2
[LLVMdev] Seeing a crash with ConstantFP::get
...1 ? atol(argv[1]) : 24; // Create some module to put our function into it. Module *M = new Module("test"); // We are about to create the "fib" function: Function *FibF = CreateFibFunction(M); // add the following line Constant* C = ConstantFP::get(Type::FloatTy,0.0); Can someone verify this? This is on the PC side of my system which I build with the VStudio files. I don't know if the Mac side sees this as well, but I'll try and verify. Seems really odd to have something this basic crash me. It came up because the JITter will call Consta...
2007 Sep 05
0
[LLVMdev] Seeing a crash with ConstantFP::get
...our function into it. > > Module *M = new Module("test"); > > > > // We are about to create the "fib" function: > > Function *FibF = CreateFibFunction(M); > > > > // add the following line > > Constant* C = ConstantFP::get(Type::FloatTy,0.0); > > > > > > Can someone verify this? This is on the PC side of my system which > I build with the VStudio files. I don’t know if the Mac side sees > this as well, but I’ll try and verify. Seems really odd to have > something this basic crash me. It came up...
2007 Sep 06
0
[LLVMdev] Seeing a crash with ConstantFP::get
...1 ? atol(argv[1]) : 24; // Create some module to put our function into it. Module *M = new Module("test"); // We are about to create the "fib" function: Function *FibF = CreateFibFunction(M); // add the following line Constant* C = ConstantFP::get(Type::FloatTy,0.0); Can someone verify this? This is on the PC side of my system which I build with the VStudio files. I don't know if the Mac side sees this as well, but I'll try and verify. Seems really odd to have something this basic crash me. It came up because the JITter will call Consta...