This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC]: MD_FALLBACK_FRAME_STATE_FOR macro for darwin PPC
- From: David Daney <ddaney at avtrex dot com>
- To: Andreas Tobler <toa at pop dot agri dot ch>
- Cc: Geoffrey Keating <geoffk at apple dot com>, Geoffrey Keating <gkeating at apple dot com>,gcc-patches <gcc-patches at gcc dot gnu dot org>, Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Wed, 21 Jan 2004 10:32:20 -0800
- Subject: Re: [RFC]: MD_FALLBACK_FRAME_STATE_FOR macro for darwin PPC
- References: <400D9173.7010508@pop.agri.ch> <7809AEC4-4B8A-11D8-83EB-000A95B1F520@apple.com> <400E3C5C.3060001@pop.agri.ch>
Andreas Tobler wrote:
+ new_cfa_ = mc_->ss.r1; \
+ (FS)->cfa_how = CFA_REG_OFFSET; \
+ (FS)->cfa_reg = STACK_POINTER_REGNUM; \
+ (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
+ \
+ /* r0 to r31 are variable names in the ppc_thread_state struct \
+ since we need the address we just increment the r0 by i_ * 4 \
+ to get the other vars addresses. */ \
+ \
+ for (i_ = 0; i_ < 32; i_++) { \
+ if (i_ != STACK_POINTER_REGNUM) \
+ { \
+ (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[i_].loc.offset \
+ = (long)&(mc_->ss.r0) + (i_*4) - new_cfa_; \
+ } \
+ } \
+ \
+ (FS)->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[LINK_REGISTER_REGNUM].loc.offset \
+ = (long)&(mc_->ss.lr) - new_cfa_; \
+ \
+ (FS)->regs.reg[CR0_REGNO].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[CR0_REGNO].loc.offset \
+ = (long)&(mc_->ss.srr0) - new_cfa_; \
+ (FS)->retaddr_column = CR0_REGNO; \
+ goto SUCCESS; \
+ } while (0)
I know next to nothing about PPC ABIs, but are any of these floating
point registers?
Are there any call saved FP registers in this ABI? and if so are you
restoring them. Although I don't think that the unwinder uses floating
point, it seems that restoring call saved FP registers is a good idea if
you are not already doing it.
Just my $0.02
David Daney.