search for: asmfuncty

Displaying 2 results from an estimated 2 matches for "asmfuncty".

2008 Apr 18
0
[LLVMdev] Giving labels to intrinsics and getting the address
...0x0f, 0x36, 0x00" and label address put into register a. // Get the label from instrinsic's arguments.. BasicBlock* theLabel = ...magic?... // Create a function type that takes a label and returns void std::vector<const Type*>asmArgs; asmArgs.push_back(Type::LabelTy); FunctionType* asmFuncTy = FunctionType::get(Type::VoidTy, asmArgs, false); // Create inline asm that emits the desired opcode and prepares register a InlineAsm* asm = InlineAsm::get(asmFuncTy, ".byte 0x0f, 0x36, 0x00", "{ax},~{dirflag},~{fpsr},~{flags},~{memory}", true); // Create call to the inline...
2011 Jun 28
1
[LLVMdev] retrieve information from a macro inlined as x86_64 asm in LLVM IR
...es in this address, at runtime. (Similar to sending a parameter by reference. ) If I send the address of the Value* lim as a param to the macro, it puts the hardcoded address (as expected). std::stringstream out; out.str(std::string()); out << &lim; InlineAsm* IA = InlineAsm::get(asmFuncTy, "camus_macro_decision" + out.str() , "=r", true); CallInst* cmp = CallInst::Create(IA, ...); creates the call: camus_macro_decision 0x7fffdf3172f0 I tried also by creating a pointer to the Value* lim, without any success. I know this is not the good approach, but...