* common assembly code between ppc32 & ppc64
@ 2005-09-20 21:03 Kumar Gala
2005-09-20 22:29 ` Andreas Schwab
0 siblings, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2005-09-20 21:03 UTC (permalink / raw)
To: Alan Modra; +Cc: binutils
Alan,
I was wondering if there was any GNU asm magic that you where aware
of to deal with the fact that pointers are different sizes on ppc32
vs ppc64. For example:
#ifndef __powerpc64__
#define END_FTR_SECTION(msk, val) \
99: \
.section __ftr_fixup,"a"; \
.align 2; \
.long msk; \
.long val; \
.long 98b; \
.long 99b; \
.previous
#else /* __powerpc64__ */
#define END_FTR_SECTION(msk, val) \
99: \
.section __ftr_fixup,"a"; \
.align 3; \
.llong msk; \
.llong val; \
.llong 98b; \
.llong 99b; \
.previous
#endif /* __powerpc64__ */
Is there any magic to handle ".llong" vs ".long" that we could
possibly use to reduce the duplication between these two code fragments.
thanks
- kumar
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: common assembly code between ppc32 & ppc64
2005-09-20 21:03 common assembly code between ppc32 & ppc64 Kumar Gala
@ 2005-09-20 22:29 ` Andreas Schwab
2005-09-20 22:57 ` Kumar Gala
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2005-09-20 22:29 UTC (permalink / raw)
To: Kumar Gala; +Cc: Alan Modra, binutils
Kumar Gala <kumar.gala@freescale.com> writes:
> Is there any magic to handle ".llong" vs ".long" that we could
> possibly use to reduce the duplication between these two code fragments.
#ifndef __powerpc64__
.macro pointer val
.long \val
.endm
.macro align_p
.align 2
.endm
#else
.macro pointer val
.llong \val
.endm
.macro align_p
.align 3
.endm
#endif
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: common assembly code between ppc32 & ppc64
2005-09-20 22:29 ` Andreas Schwab
@ 2005-09-20 22:57 ` Kumar Gala
2005-09-20 23:59 ` Andreas Schwab
0 siblings, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2005-09-20 22:57 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Alan Modra, binutils
Andreas,
Can you explain further what this gets me ?
I kinda get the align_p macro portion, but I'm not sure I understand
the 'pointer' and \val stuff.
thanks
- kumar
On Sep 20, 2005, at 4:26 PM, Andreas Schwab wrote:
> Kumar Gala <kumar.gala@freescale.com> writes:
>
>
>> Is there any magic to handle ".llong" vs ".long" that we could
>> possibly use to reduce the duplication between these two code
>> fragments.
>>
>
> #ifndef __powerpc64__
> .macro pointer val
> .long \val
> .endm
> .macro align_p
> .align 2
> .endm
> #else
> .macro pointer val
> .llong \val
> .endm
> .macro align_p
> .align 3
> .endm
> #endif
>
> Andreas.
>
> --
> Andreas Schwab, SuSE Labs, schwab@suse.de
> SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
> Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: common assembly code between ppc32 & ppc64
2005-09-20 22:57 ` Kumar Gala
@ 2005-09-20 23:59 ` Andreas Schwab
2005-09-21 3:49 ` Kumar Gala
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2005-09-20 23:59 UTC (permalink / raw)
To: Kumar Gala; +Cc: Alan Modra, binutils
Kumar Gala <kumar.gala@freescale.com> writes:
> I kinda get the align_p macro portion, but I'm not sure I understand
> the 'pointer' and \val stuff.
Read about the macro directive in the GAS manual.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: common assembly code between ppc32 & ppc64
2005-09-20 23:59 ` Andreas Schwab
@ 2005-09-21 3:49 ` Kumar Gala
0 siblings, 0 replies; 5+ messages in thread
From: Kumar Gala @ 2005-09-21 3:49 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Alan Modra, binutils
Thanks, learn something new everyday :)
- kumar
On Sep 20, 2005, at 5:29 PM, Andreas Schwab wrote:
> Kumar Gala <kumar.gala@freescale.com> writes:
>
>
>> I kinda get the align_p macro portion, but I'm not sure I understand
>> the 'pointer' and \val stuff.
>>
>
> Read about the macro directive in the GAS manual.
>
> Andreas.
>
> --
> Andreas Schwab, SuSE Labs, schwab@suse.de
> SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
> Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-09-20 22:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-20 21:03 common assembly code between ppc32 & ppc64 Kumar Gala
2005-09-20 22:29 ` Andreas Schwab
2005-09-20 22:57 ` Kumar Gala
2005-09-20 23:59 ` Andreas Schwab
2005-09-21 3:49 ` Kumar Gala
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).