[Bug inline-asm/21249] incorrect code generation for rdtsc on x86_64

2005-04-27 Thread pinskia at gcc dot gnu dot org
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-27 13:32 --- (In reply to comment #3) > If =A is for using edx:eax in 32 bits mode, what is it doing exactly in 64 > bits > then? rdx:rax? Just rax. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21249

[Bug inline-asm/21249] incorrect code generation for rdtsc on x86_64

2005-04-27 Thread tfautre at pandora dot be
--- Additional Comments From tfautre at pandora dot be 2005-04-27 13:30 --- Thanks for the code, it's working. The inline rdtsc code was from an IBM article; and after reading the GCC doc on =A, I must admit I was expecting it to work on x86_64 too. "ASpecifies the `a' or `d' regis

[Bug inline-asm/21249] incorrect code generation for rdtsc on x86_64

2005-04-27 Thread pinskia at gcc dot gnu dot org
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-27 13:11 --- What do you mean, it is generating wrong code? Actually you are using inline-asm wrong, try the following instead: #define rdtsc(low,high) \ __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) This com

[Bug inline-asm/21249] incorrect code generation for rdtsc on x86_64

2005-04-27 Thread tfautre at pandora dot be
--- Additional Comments From tfautre at pandora dot be 2005-04-27 13:08 --- Created an attachment (id=8754) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8754&action=view) Small test program that exibits the problem. The problem becomes more obvious when the program is compiled wi