This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/14] [x86_64] Vector math functions (vector cos)


On Mon, 18 May 2015, Andrew Senkevich wrote:

> How to calculate offset for .cfi_offset directive after f.e. movq
> %r12, 168(%rsp)?

I think you'll need to use .cfi_escape in order to generate 
DW_CFA_expression describing the register as saved relative to %rsp 
instead of relative to the CFA.  Something like:

DW_CFA_expression
uleb128 register number (as in the x86_64 ABI)
uleb128 length of what follows
DW_OP_drop
DW_OP_breg7 (%rsp is register 7)
sleb128 offset from %rsp

appropriately encoded by hand and entered with .cfi_escape (with 
appropriate comments saying what operations are being encoded).  You could 
probably write an assembler macro to do the encoding (though if the 
offsets in question don't all have the same length when encoded as 
sleb128, that complicates the macro a bit).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]