* Conversion between different types on IA-64
@ 2003-07-29 21:54 CH Gowri Kumar
2003-07-30 3:55 ` Martin Pool
2003-07-30 10:20 ` CH Gowri Kumar
0 siblings, 2 replies; 3+ messages in thread
From: CH Gowri Kumar @ 2003-07-29 21:54 UTC (permalink / raw)
To: linux-ia64
Hi all,
Can anyone point me to a source of how to convert from a
wider size to narrow size (long to int, int to char etc.) on IA-64?
For the other way round(narrow to wider), I could find SXT(sign extend)
and ZXT(zero extend) instructions.
gcc seems(but not sure) to be storing the original value and loading it
using the appropriate LD* instruction.
I am sorry if it's a too trivial question to be asked on this list.
Regards,
Gowri Kumar
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Conversion between different types on IA-64
2003-07-29 21:54 Conversion between different types on IA-64 CH Gowri Kumar
@ 2003-07-30 3:55 ` Martin Pool
2003-07-30 10:20 ` CH Gowri Kumar
1 sibling, 0 replies; 3+ messages in thread
From: Martin Pool @ 2003-07-30 3:55 UTC (permalink / raw)
To: linux-ia64
On 30 Jul 2003, CH Gowri Kumar <gkumar@csa.iisc.ernet.in> wrote:
> Hi all,
> Can anyone point me to a source of how to convert from a
> wider size to narrow size (long to int, int to char etc.) on IA-64?
>
> For the other way round(narrow to wider), I could find SXT(sign extend)
> and ZXT(zero extend) instructions.
>
> gcc seems(but not sure) to be storing the original value and loading it
> using the appropriate LD* instruction.
In C just a cast ought to do it.
In asm it seems like you can either ST and then LD4/LD2/LD1, or use
AND or EXTR.
Sorry if I'm misunderstanding your question.
--
Martin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Conversion between different types on IA-64
2003-07-29 21:54 Conversion between different types on IA-64 CH Gowri Kumar
2003-07-30 3:55 ` Martin Pool
@ 2003-07-30 10:20 ` CH Gowri Kumar
1 sibling, 0 replies; 3+ messages in thread
From: CH Gowri Kumar @ 2003-07-30 10:20 UTC (permalink / raw)
To: linux-ia64
Hi Martin,
> In C just a cast ought to do it.
OOPS! I should have asked it as "IA-64 assembly".
> In asm it seems like you can either ST and then LD4/LD2/LD1, or use
> AND or EXTR.
Seems the instructions extr and extr.u would do the work for signed
and unsigned forms respectively.
Thanks for the help, Martin.
Regards,
Gowri Kumar
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-07-30 10:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-29 21:54 Conversion between different types on IA-64 CH Gowri Kumar
2003-07-30 3:55 ` Martin Pool
2003-07-30 10:20 ` CH Gowri Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox