[PATCH] QT 4.4.0-snapshot-20070420 [missing q_atomic_*]

Thiago Macieira thiago at kde.org
Mon Apr 23 14:28:57 BST 2007


Stefan Teleman said:
> On Monday 23 April 2007 05:20, Thiago Macieira wrote:
>
>> However, the use of quads in x86-64 seems wrong. The pointer being
>> passed in q_atomic_fetch_and_add_int is a 'volatile int *', so it's
>> 32-bit, not 64-bit.
>
> /* testamd64ptr.c */
>
> int
> main(int argc, char* argv[])
> {
>     (void) fprintf(stderr, "sizeof(int*) = %ld\n", sizeof(int*));
>     return 0;
> }
>
> [steleman at redneck][~/tmp][04/23/2007 8:36:23][594]>> ./testamd64ptr
> sizeof(int*) = 8

Understood for the size of the pointer. But we're talking about the size
of the pointed data.

sizeof(int) = 4

  movq (%rax),%rdx
loads a 64-bit integer from the address pointed by %rax into %rdx. I think
you meant:
  movl (%rax),%edx
which loads 32 bits. Or even (I don't know if this instruction exists):
  movzlq (%rax),%rdx
to clear the upper 32-bits of %rdx, but I don't see the purpose.

AMD-64 (x86-64) is an LP64 platform on Unix machines (Windows64 is P64 only).

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358






More information about the kde-core-devel mailing list