Macros with 64-bit constants in assembly?

Tabi Timur-B04825 B04825@freescale.com
Tue Jun 28 03:47:00 GMT 2011


I have a PowerPC assembly language program, and I'm trying to create a
macro that will manipulate 64-bit constants.  Specifically, I'm trying
to do this:

#define A 0x1234567890ULL
#define M(x) ((x) >> 32)

This works in C, but not in assembly language.  The assembler
complains about the "ULL".  So if I remove the "ULL":

#define A 0x1234567890
#define M(x) ((x) >> 32)

The assembler evaluates "M(A)" as 0.  I think that's because it
truncates A to 32-bits, and then a 32-bit number shifted right by 32
bits is always 0.

Is there any way to get this work.  I have existing header files that
defined unsigned long long constants, and I want to use those header
files in my assembly code.

-- 
Timur Tabi
Linux kernel developer at Freescale



More information about the Gcc-help mailing list