search for: _bar

Displaying 20 results from an estimated 31 matches for "_bar".

2016 Apr 19
3
Backward references in assembly absolute expressions
While trying to compile an existing codebase which uses handwritten assembly with LLVM, I ran into an issue around using backward references in assembly absolute expressions. A simple example can be the following snippet: _foo: .fill 0x100 _bar: .fill _bar - _foo _baz: .fill 0x100 While gas compiles this snippet without any errors, the integrated assembler throws an error: expected absolute expression for _bar - _foo. I haven't found any definition of absolute expression in gas manual, and it's arguable whether this case sho...
2018 Jul 03
2
Why Clang is yielding different LLVM IR return type for the same function
Hi: So I have a library function called fooo() in a source file B.c and an external A.c file that is referencing a function fooo() in it. foo is returning a pointer to a structure A.ll: %struct._bar= type { %struct._foo, i32, i32 (%struct.doo*, %struct.doo*, %struct.doo*)* } declare i8* @fooo() #2 B.ll: %struct._bar= type { %struct._foo, i32, i32 (%struct.doo*, %struct.doo*, %struct.doo*)* } define noalias %struct._bar* @fooo() #2{ .......... } I am implementing a transform pass that...
2005 Feb 11
3
render_collection_of_partials vs. loop whats the difference ?
...view (HTML excluded), I get one item returned and rendered: <% @foo.bars.each do |@bar| %> <%= @bar.data %> <% end %> I thought from the docs that this could be rewritten as <%= render_collection_of_partials "bar", @foo.bars %> With, <%= @bar.data %> in _bar.rhtml. With the former, I get the expect single record result. With the latter, I get a single iteration, but my @bar doesn''t have any data. Have I misunderstood the function of r_c_o_p ? Thanks, -- Dominic
2016 Jun 30
4
Help required regarding IPRA and Local Function optimization
...} and its generated assembly code when IPRA enabled: .section __TEXT,__text,regular,pure_instructions .macosx_version_min 10, 12 .p2align 4, 0x90 _foo: ## @foo .cfi_startproc ## BB#0: ## InlineAsm Start movl %r14d, %r15d ## InlineAsm End retq .cfi_endproc .globl _bar .p2align 4, 0x90 _bar: ## @bar .cfi_startproc ## BB#0: pushq %r15 Ltmp0: .cfi_def_cfa_offset 16 pushq %rbx Ltmp1: .cfi_def_cfa_offset 24 pushq %rax Ltmp2: .cfi_def_cfa_offset 32 Ltmp3: .cfi_offset %rbx, -24 Ltmp4: .cfi_offset %r15, -16 ## InlineAsm Start movl %ecx,...
2013 Nov 01
2
[LLVMdev] Implementing the ldr pseudo instruction in ARM integrated assembler
...ign” which precedes the next function. The constant pool for the previous function would end up being emitted after the alignment directive for the following function, which will make that next symbol potentially not sufficiently aligned. For example, _foo: ldr, r1, =0x12345678 … bx lr .align 4 _bar: … The result will be that _bar is not 16-byte aligned, but only 4-byte aligned, which will come as quite the surprise to the programmer. The next thought is to detect subsections-via-symbols and require the directive if another atom is seen and there is a non-empty constant pool. That gets a bi...
2013 Nov 01
0
[LLVMdev] Implementing the ldr pseudo instruction in ARM integrated assembler
...y to know how far apart the atoms in the section will be at > runtime, as the linker can, and will, move things around. Hmm, yes that does sound quite tricky. How do we currently deal with that for other pc-relative loads. Say the programmer writes something like this _foo: ldr r1, [pc, #392] _bar: .space 200 _baz: .space 200 _some_important_constants: .word 0x12345678 If bar and baz get deleted by the linker the offset would obviously be wrong. Do we do anything special for this or just rely on the programmer not to write this code? > We could, perhaps, always require an explicit dir...
2017 Jun 06
4
LLD support for mach-o aliases (weak or otherwise)
...least within one module). My goal is to at least turn them into strong aliases somehow, so I can at a minimum make the musl source compatible with clang on macos. The following compiles but foo is not exported: $ cat a.c #include <stdio.h> void foo() __attribute__((weak_import)) __asm("_bar"); void bar() { printf("bar\n"); } int main() { foo(); } $ cc -c a.c -o a.o $ nm a.o 0000000000000000 T _bar 0000000000000020 T _main U _printf Any ideas how I can get foo as an exported symbol? Is weak alias or plan alias support planned for ma...
2018 Sep 14
6
Function calls keep increasing the stack usage
Hi everyone, I found that LLVM generates redundant code when calling functions with constant parameters, with optimizations disabled. Consider the following C code snippet: int foo(int x, int y); void bar() { foo(1, 2); foo(3, 4); } Clang/LLVM 6.0 generates the following assembly code: _bar: subl $32, %esp movl $1, %eax movl $2, %ecx movl $1, (%esp) movl $2, 4(%esp) movl %eax, 28(%esp) movl %ecx, 24(%esp) calll _foo movl $3, %ecx movl $4, %edx movl $3, (%esp) movl $4, 4(%esp) movl %eax, 20(%esp) movl %ecx, 16(%esp) movl %edx, 12(%esp) calll _foo movl %eax, 8(%esp) addl $32, %esp retl...
2018 Sep 14
2
Function calls keep increasing the stack usage
...with optimizations disabled. >> >> Consider the following C code snippet: >> >> int foo(int x, int y); >> >> void bar() >> { >> foo(1, 2); >> foo(3, 4); >> } >> >> Clang/LLVM 6.0 generates the following assembly code: >> _bar: >> subl $32, %esp >> movl $1, %eax >> movl $2, %ecx >> movl $1, (%esp) >> movl $2, 4(%esp) >> movl %eax, 28(%esp) >> movl %ecx, 24(%esp) >> calll _foo >> movl $3, %ecx >> movl $4, %edx >> movl $3, (%esp) >> movl $4, 4(%esp) &g...
2016 Jun 30
0
Help required regarding IPRA and Local Function optimization
...tion __TEXT,__text,regular,pure_instructions > .macosx_version_min 10, 12 > .p2align 4, 0x90 > _foo: ## @foo > .cfi_startproc > ## BB#0: > ## InlineAsm Start > movl %r14d, %r15d > ## InlineAsm End > retq > .cfi_endproc > > .globl _bar > .p2align 4, 0x90 > _bar: ## @bar > .cfi_startproc > ## BB#0: > pushq %r15 > Ltmp0: > .cfi_def_cfa_offset 16 > pushq %rbx > Ltmp1: > .cfi_def_cfa_offset 24 > pushq %rax > Ltmp2: > .cfi_def_cfa_offset 32 > Ltmp3: > .cfi_...
2010 Dec 25
2
[LLVMdev] LLVM dllimport
?Hi all, Can someone tell me how to import functions from shared libraries and use them in LLVM assembly Regards, Dylan Borg +356 99214902 borgdylan at hotmail.com borgdylang at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101225/77e1182c/attachment.html>
2010 Dec 27
0
[LLVMdev] LLVM dllimport
...e "import libraries", you may call them with general calling conversions. Without import libraries, for example; declare dllimport i32 @foo(i32) @quux = dllimport global i32 define i32 @bar() nounwind { %a = load i32* @quux %r = call i32 @foo(i32 %a) ret i32 %r } .globl _bar _bar: subl $4, %esp movl __imp__quux, %eax movl (%eax), %eax movl %eax, (%esp) calll *__imp__foo addl $4, %esp ret If you have clang or llvm-gcc, you can confirm outputs with clang foo.c -S -emit-llvm -o foo.ll clang foo.c -S...
2006 Aug 01
2
Partial Naming Madness
...ttempts to render the foo partial back, passing it a variable like so: render_partial ''something/foo'', nil, ''foo'' => Foo.find(params[:foo]) This code complains that foo is null when it renders back, however, if I copy the _foo.rhtml code into a file called _bar.rhtml and do: render_partial ''something/bar'', nil, ''foo'' => Foo.find(params[:foo]) everything works. Why is this happening? -- Posted via http://www.ruby-forum.com/.
2013 Feb 14
1
[LLVMdev] Question about compilation result - taking address of input array member
...and that produces the assembly you're looking for: $ clang -cc1 -emit-llvm -O1 takeaddr.c $ cat takeaddr.ll define i32* @bar(i32* %table) nounwind readnone { entry: %arrayidx = getelementptr inbounds i32* %table, i64 2 ret i32* %arrayidx } $ llc takeaddr.ll $ cat takeaddr.s <snip> _bar: ## @bar ## BB#0: ## %entry leaq 8(%rdi), %rax ret Cheers, Lang. On Fri, Feb 1, 2013 at 12:14 PM, Eli Bendersky <eliben at google.com> wrote: > On Fri, Feb 1, 2013 at 12:11 PM, Eli Bendersky <eliben...
2017 Jun 14
1
LLD support for mach-o aliases (weak or otherwise)
...My goal is to at least turn them into strong aliases somehow, so I can at a minimum make the musl source compatible with clang on macos. The following compiles but foo is not exported: > > $ cat a.c > #include <stdio.h> > > void foo() __attribute__((weak_import)) __asm("_bar"); > > void bar() > { > printf("bar\n"); > } > > int main() > { > foo(); > } > > $ cc -c a.c -o a.o > $ nm a.o > 0000000000000000 T _bar > 0000000000000020 T _main > U _printf > > Any ideas how...
2013 Nov 01
0
[LLVMdev] Implementing the ldr pseudo instruction in ARM integrated assembler
> >>> I was thinking that without the .ltorg directive the constant pool > >>> would go at the end of the section. > >>> > >> So where does the assembler place the constant pool(s) if that > >> directive isn't present? I was under the impression it was always > required. > > > > From my understanding it is not required. I see
2006 Jun 07
6
Links on the left hand side - are components necessary?
Hello, Maybe this is super-trivial... I need to have a list of links on the left hand side of my application, for *every* single page. So, I''ve created a layout called "main" (main.rhtml) under view/layouts, and included >layout "main"< in pretty all of my controllers. main.rhtml has, amongst all the other HTML stuff: <%= render_component
2013 Nov 01
2
[LLVMdev] Implementing the ldr pseudo instruction in ARM integrated assembler
On Nov 1, 2013, at 12:06 PM, David Peixotto <dpeixott at codeaurora.org> wrote: >>> I was thinking that without the .ltorg directive the constant pool >>> would go at the end of the section. >>> >> So where does the assembler place the constant pool(s) if that directive >> isn't present? I was under the impression it was always required. >
2007 Mar 13
4
Object sync problem
Hi, Sorry to hassle everyone again, yes I''m a newbie!! I''ve created some code and I''m getting a out of sync style error message. Here''s a snipet of the code (to reproduce the problem): package { [ "tar", "gzip", "bzip2", "sed" ]: ensure => latest } define xxx { $xenrelease = ''3.0.4''
2017 Jun 14
4
LLD support for mach-o aliases (weak or otherwise)
...trong aliases somehow, so I can at a minimum make the musl source compatible with clang on macos. The following compiles but foo is not exported: >>> >>> $ cat a.c >>> #include <stdio.h> >>> >>> void foo() __attribute__((weak_import)) __asm("_bar"); >>> >>> void bar() >>> { >>> printf("bar\n"); >>> } >>> >>> int main() >>> { >>> foo(); >>> } >>> >>> $ cc -c a.c -o a.o >>> $ nm a.o >>&gt...