This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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/RFA] SH TLS support


> Simpler than that.  The GOTOFF->TPOFF substitution can be made
> based solely on how X gets bound.
> 
> You don't have to replace the pc-rel load at all, and thus don't
> have to worry about whether it's in range.  You just need to be
> able to find the indexed load and nop it out.  I.e.
> 
>         mov.l   .L1, r0         ->      mov.l   .L1, r0         (unchanged)
>         stc     gbr, r1         ->      stc     gbr, r1         (unchanged)
>         mov.l   @(r0,r12), r0   ->      nop
>         add     r1, r0          ->      add     r1, r0          (unchanged)
>         ...
>         (constant pool)
> L1:     .long   x at GOTTPOFF      ->      .long   x at TPOFF

That requires the indexed load to use r0 for its destination.
Removing this requirement is important to give the register allocator
and the scheduler more freedom.


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