Conversion between different types on IA-64
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
Quoted 9 lines · CH Gowri Kumar
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.
Signature · 1 line
Martin
Hi Martin,
Quoted 1 line
In C just a cast ought to do it.
OOPS! I should have asked it as "IA-64 assembly".
Quoted 2 lines
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