diff options
author | Torbjorn Granlund <tege@gmplib.org> | 2011-12-04 19:31:38 +0100 |
---|---|---|
committer | Torbjorn Granlund <tege@gmplib.org> | 2011-12-04 19:31:38 +0100 |
commit | 7ea346e227a00b17e3aad30c07638556b48e7bc1 (patch) | |
tree | d34b37e8f4a55fe97d72fdaffbb5886399995ca3 | |
parent | 96381eabd0b915b04c87e9af4caff14cb38cc93b (diff) | |
download | gmp-7ea346e227a00b17e3aad30c07638556b48e7bc1.tar.gz |
(MAKE_FMS): Rewrite to handle modern CPUs.
-rw-r--r-- | mpn/x86/fat/fat.c | 7 | ||||
-rw-r--r-- | mpn/x86_64/fat/fat.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/mpn/x86/fat/fat.c b/mpn/x86/fat/fat.c index c3d1866c6..63304039e 100644 --- a/mpn/x86/fat/fat.c +++ b/mpn/x86/fat/fat.c @@ -4,7 +4,7 @@ THEY'RE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN FUTURE GNU MP RELEASES. -Copyright 2003, 2004 Free Software Foundation, Inc. +Copyright 2003, 2004, 2011 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -49,8 +49,9 @@ int __gmpn_cpuid_available __GMP_PROTO ((void)); #define __gmpn_cpuid fake_cpuid #define __gmpn_cpuid_available fake_cpuid_available -#define MAKE_FMS(family, model) \ - (((family) << 8) + ((model << 4))) +#define MAKE_FMS(family, model) \ + ((((family) & 0xf) << 8) + (((family) & 0xff0) << 16) \ + + (((model) & 0xf) << 4) + (((model) & 0xf0) << 12)) static struct { const char *name; diff --git a/mpn/x86_64/fat/fat.c b/mpn/x86_64/fat/fat.c index 354579728..c8c6bbdff 100644 --- a/mpn/x86_64/fat/fat.c +++ b/mpn/x86_64/fat/fat.c @@ -7,7 +7,7 @@ THEY'RE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN FUTURE GNU MP RELEASES. -Copyright 2003, 2004, 2009 Free Software Foundation, Inc. +Copyright 2003, 2004, 2009, 2011 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -49,8 +49,9 @@ long __gmpn_cpuid __GMP_PROTO ((char dst[12], int id)); #define __gmpn_cpuid fake_cpuid #define __gmpn_cpuid_available fake_cpuid_available -#define MAKE_FMS(family, model) \ - (((family) << 8) + ((model << 4))) +#define MAKE_FMS(family, model) \ + ((((family) & 0xf) << 8) + (((family) & 0xff0) << 16) \ + + (((model) & 0xf) << 4) + (((model) & 0xf0) << 12)) static struct { const char *name; |