Fat arm support

Torbjörn Granlund tg at gmplib.org
Sat Jan 17 23:16:06 UTC 2015


It is possible to avoid parsing /proc/cpuinfo, and instead call
getauxval.  This works on most systems, but my A15 system does not seem
to have the auxv.h include file.


#include <stdio.h>
#include <sys/auxv.h>
#include <asm/hwcap.h>

#define T(FEATURE)					\
  do {							\
    if (feat & HWCAP_ARM_##FEATURE)			\
      printf ("%s%s", s, #FEATURE), s = " ";		\
  } while (0)

int
main()
{
  long feat = getauxval (AT_HWCAP);

  char *s = "";
  T(HALF);
  T(THUMB);
  T(26BIT);
  T(FAST_MULT);
  T(FPA);
  T(VFP);
  T(EDSP);
  T(JAVA);
  T(IWMMXT);
  T(CRUNCH);
  T(THUMBEE);
  T(NEON);
  T(VFPv3);
  T(VFPv3D16);
  T(TLS);
  T(VFPv4);
  T(IDIVA);
  T(IDIVT);
  puts ("");
  return 0;
}


-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-devel mailing list