Displaying 20 results from an estimated 231 matches for "cfi_startproc".
2005 Sep 03
2
xen unstable build domU kenel fails on entry.S
...#39; flag was
Which option in make ARCH=xen menuconfig should i disable to get rid of the
following compile error of domU linux-2.6.12-domU?
-------------------
arch/xen/x86_64/kernel/entry.S: Assembler messages:
arch/xen/x86_64/kernel/entry.S:468: Error: CFI instruction used without
previous .cfi_startproc
arch/xen/x86_64/kernel/entry.S:468: Error: junk at end of line, first
unrecognized character is `-''
arch/xen/x86_64/kernel/entry.S:495: Error: CFI instruction used without
previous .cfi_startproc
arch/xen/x86_64/kernel/entry.S:495: Error: junk at end of line, first
unrecognized characte...
2013 Jul 10
2
[LLVMdev] [BUG] Support for .cfi_startproc simple
Hi,
According to the GNU as documentation [1], .cfi_startproc simple is a
valid directive. Unfortunately, LLVM complains with:
error: invalid instruction mnemonic 'simple'
I happened to notice it while attempting to compile linux.git with
clang: see arch/x86/ia32/ia32entry.S:75.
[1]: http://sourceware.org/binutils/docs-2.22/as/Pseudo-Ops.html#Ps...
2013 Dec 19
1
[LLVMdev] [PATCH] MC: handle .cfi_startproc simple
...quot;simple" is
to skip the initial cfi instructions. We should test if that is the
case and implement it too. Accepting and ignoring "simple" is not very
user friendly.
On 11 July 2013 05:25, Ramkumar Ramachandra <artagnon at gmail.com> wrote:
> The statement
>
> .cfi_startproc simple
>
> is perfectly valid, and GNU as supports it. Unfortunately, LLVM barfs
> with:
>
> error: invalid instruction mnemonic 'simple'
>
> Fix this by modifying ParseDirectiveCFIStartProc() to parse the
> identifier "simple".
>
> Cc: Rafael Espi...
2011 Aug 01
2
[LLVMdev] llvm 3.0 svn and cfi_* directives
Hi,
Compiling a simple function with the 3.0 SVN branch
llc produces .s output containing cfi_startproc, cfi_endproc,
cfi_def_cfa_offset that gcc refuses to compile
(OS X 10.7 on X86-64) with the following error:
test.s:6:Unknown pseudo-op: .cfi_startproc
test.s:10:Unknown pseudo-op: .cfi_def_cfa_offset
test.s:10:Rest of line ignored. 1st junk character valued 51 (3).
test.s:38:Unknown pseudo-op: .c...
2012 Apr 27
2
[LLVMdev] complex library functions (creal and cimag)
When I compile this code which includes call to crealf,
$ cat foo1.c
#include <complex.h>
float foo1(complex float z) { return crealf(z); }
clang emits a call to crealf,
$ clang foo1.c -S -o - -O3
foo1: # @foo1
.cfi_startproc
# BB#0: # %entry
jmp crealf # TAILCALL
while gcc does it in two move instructions:
$ gcc foo1.c -S -o -O3
foo1:
.LFB0:
.cfi_startproc
movq %xmm0, -8(%rsp)
movss -8(%rsp), %xmm0
Is this an optimization which is m...
2013 Jul 14
0
[LLVMdev] [PATCH v2] MC: handle .cfi_startproc simple
Hi,
After your change, EmitCFIStartProcImpl in MCAsmStreamer does not
match the signature of the EmitCFIStartProcImpl in MCStreamer and you
end up not overriding the original function. One of the places where
"virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) = 0" would
have helped. :)
Specifically, adding
virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame)
2019 Feb 05
2
clang emits calls to consexpr function.
Hi Devs,
consider below testcase
$cat test.cpp
constexpr int product()
{
return 10*20;
}
int main()
{
const int x = product();
return 0;
}
$./clang test.cpp -std=c++11 -S
$./clang -v
clang version 9.0.0
Target: x86_64-unknown-linux-gnu
$cat test.s
main:
.cfi_startproc
# %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $16, %rsp
movl $0, -4(%rbp)
callq _Z7productv //here you can see the calls to product
function
xor...
2018 Apr 12
3
[RFC] __builtin_constant_p() Improvements
...tribute__((always_inline)) int foo(int x) {
if (__builtin_constant_p(x))
return 1;
return 0;
}
static __attribute__((always_inline)) int mux() {
if (__builtin_constant_p(37))
return 927;
return 0;
}
int bar(int a) {
if (a)
return foo(42);
else
return mux();
}
Now outputs this code at -O1:
bar:
.cfi_startproc
# %bb.0: # %entry
testl %edi, %edi
movl $927, %ecx # imm = 0x39F
movl $1, %eax
cmovel %ecx, %eax
retq
And this code at -O0:
bar: # @bar
.cfi_startproc
# %bb.0: # %entry
pushq %rbp
.cfi_de...
2012 May 24
4
[LLVMdev] use AVX automatically if present
...float> %x, %y
store <8 x float> %z, <8 x float>* %0
ret void
}
$ llc -o - avx.ll
.file "avx.ll"
.text
.globl _fun1
.align 16, 0x90
.type _fun1, at function
_fun1: # @_fun1
.cfi_startproc
# BB#0: # %_L1
movaps (%rdi), %xmm0
movaps 16(%rdi), %xmm1
addps (%rsi), %xmm0
addps 16(%rsi), %xmm1
movaps %xmm1, 16(%rdi)
movaps %xmm0, (%rdi)
ret
.Ltmp0:
.size _fun1, .Ltmp0-_fun1...
2017 Apr 05
2
Deopt operand bundle behavior
...e()
define void @testFunc() {
entry:
%0 = call { i8*, i8* } @getCode()
%1 = extractvalue { i8*, i8* } %0, 1
%2 = bitcast i8* %1 to void ()*
call void %2() [ "deopt"() ]
ret void
}
We get this output machine code for x86_64:
_testFunc: ## @testFunc
.cfi_startproc
## BB#0: ## %entry
pushq %rax
Lcfi0:
.cfi_def_cfa_offset 16
callq _getCode
callq *%rax
Ltmp0:
popq %rax
retq
Without the deopt operand bundle:
_testFunc: ## @testFunc
.cfi_startproc
## BB#0:...
2013 Jul 10
4
[LLVMdev] unaligned AVX store gets split into two instructions
...ad <4 x double>* %0, align 8
ret <4 x double> %1
}
------------------------------------------------------------
Running llvm-32/bin/llc vstore.ll creates:
.section __TEXT,__text,regular,pure_instructions
.globl _vstore
.align 4, 0x90
_vstore: ## @vstore
.cfi_startproc
## BB#0: ## %entry
pushq %rbp
Ltmp2:
.cfi_def_cfa_offset 16
Ltmp3:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp4:
.cfi_def_cfa_register %rbp
vmovups (%rdi), %ymm0
popq %rbp
ret
.cfi_endproc
----------------------------------------------------------------
Running llvm-33...
2012 Mar 02
3
[LLVMdev] how to annotate assembler
Hi,
In GCC there is one useful option -dp (or -dP for more verbose output)
to annotate assembler with instruction patterns, that was used when
assembler was generated. For example:
double
test(long long s)
{
return s;
}
gcc -S -dp -O0 test.c
test:
.LFB0:
.cfi_startproc
pushq %rbp # 18 *pushdi2_rex64/1 [length = 1]
.cfi_def_cfa_offset 16
movq %rsp, %rbp # 19 *movdi_1_rex64/2 [length = 3]
.cfi_offset 6, -16
.cfi_def_cfa_register 6
movq %rdi, -8(%rbp) # 2 *movdi_1_rex64/4 [length = 4]
cvtsi2sdq -8(%rbp), %xmm0 # 6 *floatdidf2_sse_interunit/2...
2013 Aug 19
2
[LLVMdev] Duplicate loading of double constants
Hi,
I found that in some cases llvm generates duplicate loads of double
constants,
e.g.
$ cat t.c
double f(double* p, int n)
{
double s = 0;
if (n)
s += *p;
return s;
}
$ clang -S -O3 t.c -o -
...
f: # @f
.cfi_startproc
# BB#0:
xorps %xmm0, %xmm0
testl %esi, %esi
je .LBB0_2
# BB#1:
xorps %xmm0, %xmm0
addsd (%rdi), %xmm0
.LBB0_2:
ret
...
Note that there are 2 xorps instructions, the one in BB#1 being clearly
redundant
as it's dominated by the first o...
2018 Apr 13
0
[RFC] __builtin_constant_p() Improvements
...;
> }
>
> static __attribute__((always_inline)) int mux() {
> if (__builtin_constant_p(37))
> return 927;
> return 0;
> }
>
> int bar(int a) {
> if (a)
> return foo(42);
> else
> return mux();
> }
>
> Now outputs this code at -O1:
>
> bar:
> .cfi_startproc
> # %bb.0: # %entry
> testl %edi, %edi
> movl $927, %ecx # imm = 0x39F
> movl $1, %eax
> cmovel %ecx, %eax
> retq
>
> And this code at -O0:
>
> bar: # @bar
> .cfi_startproc
> # %bb.0:...
2010 Aug 19
4
How to compile 64-bit Wine 1.3.0 under Mac OS X 10.6.4
...my Mac running Mac OS X 10.6.4 with a goal of taking advantage of the 8.0 GB of RAM I've got.
I set CFLAGS="-march=native -m64", CXXFLAGS="-march=native -m64", and ./configure --enable-win64.
During make, I get the following error:
acledit.3BX36l.s:225:Unknown pseudo-op: .cfi_startproc
acledit.3BX36l.s:227:Unknown pseudo-op: .cfi_adjust_cfa_offset
acledit.3BX36l.s:227:Rest of line ignored. 1st junk character valued 52 (4).
acledit.3BX36l.s:237:Unknown pseudo-op: .cfi_adjust_cfa_offset
acledit.3BX36l.s:237:Rest of line ignored. 1st junk character valued 45 (-).
acledit.3BX36l.s:23...
2012 Mar 02
0
[LLVMdev] how to annotate assembler
...annotate assembler with instruction patterns, that was used when
> assembler was generated. For example:
The internal "-mllvm -show-mc-inst" option is probably as close as you can get.
$ clang -S -O0 test.c -mllvm -show-mc-inst -o -
_test: ## @test
.cfi_startproc
## BB#0: ## %entry
pushq %rbp ## <MCInst #2120 PUSH64r
## <MCOperand Reg:106>>
Ltmp2:
.cfi_def_cfa_offset 16
Ltmp3:
.cfi_offset %rbp, -16
movq %rsp, %rbp ## <MCInst #1491 MOV64...
2012 Apr 27
0
[LLVMdev] complex library functions (creal and cimag)
...le this code which includes call to crealf,
>
> $ cat foo1.c
> #include <complex.h>
>
> float foo1(complex float z) { return crealf(z); }
>
> clang emits a call to crealf,
>
> $ clang foo1.c -S -o - -O3
> foo1: # @foo1
> .cfi_startproc
> # BB#0: # %entry
> jmp crealf # TAILCALL
>
> while gcc does it in two move instructions:
>
> $ gcc foo1.c -S -o -O3
> foo1:
> .LFB0:
> .cfi_startproc
> movq %xmm0, -8(%rsp)
> movss ...
2016 May 24
5
Liveness of AL, AH and AX in x86 backend
...interesting scenario.
For example, I wrote this piece:
typedef struct {
char x, y;
} struct_t;
struct_t z;
struct_t foo(char *p) {
struct_t s;
s.x = *p++;
s.y = *p;
z = s;
s.x++;
return s;
}
But the output at -O2 is
foo: # @foo
.cfi_startproc
# BB#0: # %entry
movb (%rdi), %al
movzbl 1(%rdi), %ecx
movb %al, z(%rip)
movb %cl, z+1(%rip)
incb %al
shll $8, %ecx
movzbl %al, %eax
orl %ecx, %eax
retq
I was hopi...
2014 May 11
2
[LLVMdev] [cfe-dev] Code generation for noexcept functions
...d test2(FP fp) {
> test(fp);
> test(fp);
> }
>
> The code generated by GCC (ToT, -O3, Linux x64) is:
>
> .LHOTB0:
> .p2align 4,,15
> .globl _Z5test2PFvvE
> .type _Z5test2PFvvE, @function
> _Z5test2PFvvE:
> .LFB1:
> .cfi_startproc
> .cfi_personality 0x3,__gxx_personality_v0
> .cfi_lsda 0x3,.LLSDA1
> pushq %rbx
> .cfi_def_cfa_offset 16
> .cfi_offset 3, -16
> movq %rdi, %rbx
> call *%rdi
> movq %rbx, %rax
> popq %rb...
2017 Oct 06
2
CFI directives for callee saved registers
...we would use cfi_offset
to give an offset of where it is saved on the stack. I tried to instead
use the cfi_restore directive. As the docs say ".cfi_restore says that the
rule for Register is now the same as it was at the beginning of the
function, after all initial instructions added by .cfi_startproc were
executed." To use this, I need to add new instructions that move the value
from the vector back into the gpr after the .cfi_startproc section.
However, when I tried this, the instructions were executed on entry to the
function before the vector registers have been assigned. How do I a...