Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sethi and 64-bit constants



On Tuesday 01 April 2008 18:09:30 der Mouse wrote:
> > In general, full 64-bit constants use something like this:
> >
> >     sethi   %hh(val), %t1
> >     or      %t1, %hm(val), %t1
> >     sethi   %lm(val), %t2
> >     or      %t2, %lo(val), %t2
> >     or      %t1, %t2, %r1
>
> Perhaps I'm missing something, but how does that get anything in the
> high half?  sethi/or produces a 32-bit value, even if the operands come
> from %hh and %hm, and two 32-bit values ORed together is still a 32-bit
> value.  Is there an "sll %t1,32,%t1" or some such missing in there?

Yeah, looks like 'sllx %t1, 32, %t1' is missing before the final or 
instruction.

Instead of %hh and others, is there a way to use bitwise shift and logical 
operators on 64-bit constants? So %hh(val) is equivalent to (val >> 42)

When I have the following

#define CONST64 0x1a1a1a1a1a1a1a1a
...
sethi   (CONST64 >> 42), %l1

I get this message from GNU assembler

Warning: left operand is a bignum; integer 0 assumed


Home | Main Index | Thread Index | Old Index