3 * Copyright 2002 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
26 * execute CPUID instruction, return EAX, EBX, ECX and EDX values in result
29 void cpuid_x86 (unsigned int op, unsigned int result[4]);
33 * CPUID functions returning a single datum
36 static inline unsigned int cpuid_eax(unsigned int op)
43 static inline unsigned int cpuid_ebx(unsigned int op)
50 static inline unsigned int cpuid_ecx(unsigned int op)
57 static inline unsigned int cpuid_edx(unsigned int op)
64 // ----------------------------------------------------------------
69 unsigned int edx = cpuid_edx (1); // standard features
70 return (edx & (1 << 23)) != 0;
76 unsigned int edx = cpuid_edx (1); // standard features
77 return (edx & (1 << 25)) != 0;
83 unsigned int edx = cpuid_edx (1); // standard features
84 return (edx & (1 << 26)) != 0;
90 unsigned int extended_fct_count = cpuid_eax (0x80000000);
91 if (extended_fct_count < 0x80000001)
94 unsigned int extended_features = cpuid_edx (0x80000001);
95 return (extended_features & (1 << 31)) != 0;
99 gr_cpu::has_3dnowext ()
101 unsigned int extended_fct_count = cpuid_eax (0x80000000);
102 if (extended_fct_count < 0x80000001)
105 unsigned int extended_features = cpuid_edx (0x80000001);
106 return (extended_features & (1 << 30)) != 0;
110 gr_cpu::has_altivec ()