[ODE] AMD64: Error: `(%esi)' is not a valid 64 bit base/index expression

Tanguy Fautre tanguy.fautre at spaceapplications.com
Wed Feb 23 14:08:49 MST 2005


Hi,

I've seen a lotsa talk about the x86-64 compilation problems in the 
January 2005 archives. Since now I got a nice dual Opteron on Linux to 
play with, I thought I'd give some of my findings.

The "Error: `(%esi)' is not a valid 64 bit base/index expression" is 
caused by timer.cpp.

This file mainly contains four conditional compilation paths:
  - Win32
  - GCC Assembly (not for Win32)
  - Generic Unix
  - Mac

The compilation error comes from the fact that the GCC assembly is not 
correct in x86-64. ESI being a 32 bits register, it cannot be used to 
give a 64 bits address during a movl.

The configurator.c program should detect that when on a x86-64 platform 
it should not #define PENTIUM 1.
Another solution is to provide an assembly for x86-64.

My personal opinion would be to drop the assembly path, since RDTSC does 
not work on modern CPUs that changes their frequency depending on the 
workload (it's particularly obvious on a laptop).
This means that using RDTSC on such CPU (laptops, P4 6xx, etc) won't be 
able to provide you with a linear time mesure, only a number of clock 
cycles.

PS: What is timer.cpp used for in ODE anyway?

Regards,

Tanguy


More information about the ODE mailing list