similar to: [LLVMdev] Inserting Instructions (pass)

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Inserting Instructions (pass)"

2009 Jul 31
0
[LLVMdev] Inserting Instructions (pass)
On Jul 31, 2009, at 10:24 AM, Michael Graumann wrote: > Hi, > I’ am trying to insert an InlineAsm Instruction in my pass, which > FunctionType do I need for Inlineasm? > If I understand it right, I need a call instruction to insert the > new produced InlineAsm? > > Thanks for help Inline asm works like a "callee". So for: call void asm sideeffect
2009 Aug 01
2
[LLVMdev] Inserting Instructions (pass)
Thank you Chris, for your hint, but I am still too stupid. I tried two versions asm_arguments.push_back(Type::VoidTy); FunctionType *asm_type = FunctionType::get(Type::VoidTy, asm_arguments, false); Alternatively FunctionType *asm_type = FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false); . Can you give me a snippet of example code, or somebody else?
2009 Aug 01
1
[LLVMdev] Inserting Instructions (pass)
Hi, both versions are working: FunctionType *asm_Ftype = FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false); InlineAsm* Iasm = InlineAsm::get(asm_Ftype,"isync","~{dirflag},~{fpsr},~{flags}",true); How can I insert this InlineAsm, because it is no instruction and this way it will not work: Instruction *pi = bi;
2009 Aug 01
0
[LLVMdev] Inserting Instructions (pass)
On Jul 31, 2009, at 5:04 PM, Michael Graumann wrote: > Thank you Chris, > for your hint, but I am still too stupid. I tried two versions > > asm_arguments.push_back(Type::VoidTy); > FunctionType *asm_type = FunctionType::get(Type::VoidTy, > asm_arguments, false); > > Alternatively > > FunctionType *asm_type = FunctionType::get(Type::VoidTy, >
2012 Jan 18
2
[LLVMdev] Best way to interface with MSVC _ftol2 runtime function for fptoui?
Hi everyone. On i386--win32 targets, LLVM tries to use the MSVCRT routine _ftol2 for floating-point to unsigned conversions, but this function has a nonstandard calling convention LLVM doesn't understand. It takes its input operand on the x87 stack as ST0, which it pops off of the stack before returning. The return value is given in EDX:EAX. In effect, I need to call it like this: %1 = call
2009 Jun 30
2
[LLVMdev] modifying llc asm output
Hi I am trying to modify the llc in that way: subf 3, 5, 3 subf 3, 5, 3 stw 3, 44(1) stw 3, 44(1) # InlineAsm Start --> isync
2009 Jun 30
0
[LLVMdev] modifying llc asm output
On Tue, Jun 30, 2009 at 8:33 AM, Michael Graumann<MichaelGraumann at gmx.net> wrote: > Hi > > I am trying to modify the llc in that way: > > > >         subf 3, 5, 3                                 subf 3, 5, 3 > >         stw 3, 44(1)                                stw 3, 44(1) > >                                                                # InlineAsm
2008 Jun 06
2
[LLVMdev] Trouble with inline asm
Hi all, I'm having some trouble with inline asm expressions, more specifically how to create the right FunctionType for a given constraint set. So far it has worked well for inputs, but not for outputs. The inline asm support in this language (which is D, LLVMDC[1]) is through asm *statements*. I never have inline asm *expressions*, and outputs are always via memory. I D my test looks like
2009 Aug 03
2
[LLVMdev] inline asm question
Eli Friedman wrote: > 2009/8/2 Richard Pennington <rich at pennware.com>: >> The following fails on x86_64 because of the output constraint '0'. >> My question is, is this legal. LLVM complains about the size difference >> (32 vs 64), but it is the same register (ax). >> Works on x86. >> >> %42 = call i64 asm sideeffect
2008 Jun 06
0
[LLVMdev] Trouble with inline asm
On Fri, Jun 6, 2008 at 6:32 AM, Tomas Lindquist Olsen <tomas.l.olsen at gmail.com> wrote: > Hi all, > > I'm having some trouble with inline asm expressions, more specifically > how to create the right FunctionType for a given constraint set. > So far it has worked well for inputs, but not for outputs. The inline > asm support in this language (which is D, LLVMDC[1]) is
2009 Aug 03
2
[LLVMdev] inline asm question
The following fails on x86_64 because of the output constraint '0'. My question is, is this legal. LLVM complains about the size difference (32 vs 64), but it is the same register (ax). Works on x86. %42 = call i64 asm sideeffect "syscall\0A\09", "={ax},0,{di},~{dirflag},~{fpsr},~{flags}"(i64 231, i64 %41) nounwind ; <i64> [#uses=2] -Rich
2009 Aug 03
0
[LLVMdev] inline asm question
2009/8/2 Richard Pennington <rich at pennware.com>: > Eli Friedman wrote: >> 2009/8/2 Richard Pennington <rich at pennware.com>: >>> The following fails on x86_64 because of the output constraint '0'. >>> My question is, is this legal. LLVM complains about the size difference >>> (32 vs 64), but it is the same register (ax). >>>
2019 Dec 09
4
IR inline assembly: the x86 Intel "offset" operator
Hi all, I'm trying to land (a rebased version of) http://llvm.org/D37461 - which should make it possible to handle x86 Intel assembly like mov eax, offset Foo::ptr + 1 (Currently, omitting the +1 works... but offset doesn't work in compound expressions.) I'm having trouble figuring out what inline assembly I can emit into the LLVM IR that will work properly. So far, the closest
2020 Jan 07
2
Inline assembly in intel syntax mishandling i constraint
Hi all, I'm getting rather odd behavior from a call asm inteldialect(). TL;DR is "mov reg, $0" with a "i" constraint on $0 is behaving identical to "mov reg, dword ptr [$0]" and differently from "movl $0, reg" in AT&T syntax. I'm not sure how to get clang to emit an inteldialect, so for this example, I'm emitting llvm and then modifying
2009 Aug 03
0
[LLVMdev] inline asm question
2009/8/2 Richard Pennington <rich at pennware.com>: > The following fails on x86_64 because of the output constraint '0'. > My question is, is this legal. LLVM complains about the size difference > (32 vs 64), but it is the same register (ax). > Works on x86. > > %42 = call i64 asm sideeffect "syscall\0A\09", >
2015 Nov 18
2
Meaning of IR inline assembly
Hello, Most of the IR language is correctly explained; but with inline assembly I feel alone at some point: define i32 @main(i32 %argc, i8** %argv) #0 { ... //some uninteresting bloat here call void asm sideeffect "outw %eax, $0", "imr,~{dirflag},~{fpsr},~{flags}"(i32 %8) #2, !srcloc !2 ret i32 0 } I reduced the above code to the offending line containing:
2020 Jan 08
2
Inline assembly in intel syntax mishandling i constraint
> On Jan 7, 2020, at 18:41, Craig Topper <craig.topper at gmail.com> wrote: > > What version of llvm are you using? This looks like it may be fixed on trunk. After poking at my installation of rust, I'm not entirely sure what version of LLVM it uses. Looking at the GitHub page, it looks like Rust maintains their own copy of llvm and cherry picks commits. The C example was
2012 Jan 19
0
[LLVMdev] Best way to interface with MSVC _ftol2 runtime function for fptoui?
On Jan 18, 2012, at 3:50 PM, Joe Groff wrote: > Hi everyone. On i386--win32 targets, LLVM tries to use the MSVCRT > routine _ftol2 for floating-point to unsigned conversions, but this > function has a nonstandard calling convention LLVM doesn't understand. > It takes its input operand on the x87 stack as ST0, which it pops off > of the stack before returning. The return value
2015 Nov 18
2
Meaning of IR inline assembly
Thanks, but I could not find the imr, dirflag, fpsr constraints here. Just the usual gcc/clang inline assembly constraints. Those one were of my concern, actually :) --  Alex 18.11.2015, 17:11, "David Siegel" <agnat at icloud.com>: >>  On 18.11.2015, at 16:28, AlexandreFressange via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> >>  I reduced the above
2009 Dec 22
1
[LLVMdev] is there a compiler barrier that is effective at codegen level?
Hi, I would like to prevent that two adjacent calls to external functions getting interleaved/separated by other neighboring code. This mixing seems to happen in the code generator. I can prevent it by putting the two calls into a separate BB, but then I can't use -simplifycfg, -jump-threading, ... as is. Here is an example: %160 = add i64 %158, %159 ; <i64>