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

Help in defining cycle counter for sparc needed



When building fftw3 on sparc, the build fails on some machines because
fftw3 does not yet know about the cycle counter for the arch. In
working to send a patch upstream to address this, there are some
issues which need to be addressed that require some knowledge of the
architecture.

First, if the linux kernel can be believed, the way to access the
cycle counter can be found in linux/include/asm-sparc*/timex.h. This
information is used in a function within fftw3. Obviously, some
judicious use of #if is used so the correct version of the function is
found for each arch. A typical example, for x86, is

#if (defined(__GNUC__) || defined(__ICC)) && defined(__i386__)  && !defined(HAVE_TICK_COUNTER)
...
#endif

Upstream provided one area for sparc:

#if defined(__GNUC__) && defined(__sparc__) && !defined(HAVE_TICK_COUNTER)
...
#endif

Information from linux/include/asm-sparc64/timex.h was used to create the
contents of the #if.

Config.sub contains a number of variants of sparc:
  sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b
What I need to understand is which of these fftw3 should provide a definition
for? What is the relation between these and the contents of
linux/include/asm-sparc/timex.h and linux/include/asm-sparc64/timex.h?

Making things more difficult is that linux/include/asm-sparc/timex.h
says to simply return 0 for the cycle counter. This is rather useless.
Any ideas what to do about this?

Any help you can provide in clarifying what needs to be done for sparc*
would be appreciated.

Note that I am not subscribed to debian-sparc so please CC me in any
replies.

-- 
James (Jay) Treacy
treacy@debian.org



Reply to: