__sync commands with 16 byte

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

 



Hi,

I try to use __sync_bool_compare_and_swap_16 but the data is not
copied when using long double or 128bit integer. Which data type
should be used for this function?

A test case:
typedef int bigint_t __attribute__ ((__mode__ (__TI__)));

long double a=5, b=0;
__sync_bool_compare_and_swap_16(&b,b,a);
printf("%Lf %Lf\n",a,b);

long  a2=5, b2=0;
__sync_bool_compare_and_swap(&b2,b2,a2);
printf("%ld %ld\n",a2,b2);

bigint_t a3=5, b3=0;
__sync_bool_compare_and_swap_16(&b3,b3,a3);
printf("%Ld %Ld\n",a3,b3);

With gcc 4.2.1 (-march=nocona) I get:
5.000000 0.000000
5 5
5 0

instead of the expected:
5.000000 5.000000
5 5
5 5

Am I using the function wrong or is this a (known) problem in gcc?

Thanks
Roland

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux