I'm not an x86-64 expert, but it implies from intel docs that 64 bit
immediate values are supported only for the MOV instruction:

http://www.intel.com/assets/pdf/manual/253666.pdf
-------------------
2.2.1.5 Immediates
In 64-bit mode, the typical size of immediate operands remains 32 bits. When
the
operand size is 64 bits, the processor sign-extends all immediates to 64
bits prior to
their use.
Support for 64-bit immediate operands is accomplished by expanding the
semantics
of the existing move (MOV reg, imm16/32) instructions. These instructions
(opcodes
B8H – BFH) move 16-bits or 32-bits of immediate data (depending on the
effective
operand size) into a GPR. When the effective operand size is 64 bits, these
instructions
can be used to load an immediate into a GPR. A REX prefix is needed to
override
the 32-bit default operand size to a 64-bit operand size.
For example:
48 B8 8877665544332211 MOV RAX,1122334455667788H
-------------------
Udi

On Fri, Feb 4, 2011 at 9:02 AM, Gilboa Davara <gilb...@gmail.com> wrote:

> Hello all,
>
> I'm trying to pass the following command inside GCC inline assembly
> block (which targets x86_64 kernel and usermode).
>
> asm volatile
> {
>        ...
>        "andq $0x5555555555555555, %%r11 ;"
>        ...
> }
>
> And getting the following error:
> 'Error: operand type mismatch for `and''
>
> The 32bit version of this code (which uses $0x55555555 constant value)
> works just fine.
> Shaving ~4 digits off the constant value, seems to working as well.
>
> So, any idea how I can force-feed 64bit hex values into 64bit inline
> assembly?
>
> - Gilboa
>
>
> _______________________________________________
> Linux-il mailing list
> Linux-il@cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
_______________________________________________
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to