diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-01-02 21:59:36 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-01-02 21:59:36 +0100 |
commit | d2f9088822e4c2e69871c936c5de00c69dc73bbc (patch) | |
tree | ad1be98f1d810b581b92f61b1af346f712d84775 /cpu_mode_x86_64.c | |
parent | a31630e0d5b9880c716d9004ef4154396ba41ebc (diff) | |
download | ka9q-fec-d2f9088822e4c2e69871c936c5de00c69dc73bbc.tar.gz ka9q-fec-d2f9088822e4c2e69871c936c5de00c69dc73bbc.tar.bz2 ka9q-fec-d2f9088822e4c2e69871c936c5de00c69dc73bbc.zip |
Apply my old patch from 2012 for x86_64
Diffstat (limited to 'cpu_mode_x86_64.c')
-rw-r--r-- | cpu_mode_x86_64.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/cpu_mode_x86_64.c b/cpu_mode_x86_64.c new file mode 100644 index 0000000..758096a --- /dev/null +++ b/cpu_mode_x86_64.c @@ -0,0 +1,27 @@ +/* Determine CPU support for SIMD + * Copyright 2004 Phil Karn, KA9Q + * + * Modified in 2012 by Matthias P. Braendli, HB9EGM + */ +#include <stdio.h> +#include "fec.h" + +/* Various SIMD instruction set names */ +char *Cpu_modes[] = {"Unknown","Portable C","x86 Multi Media Extensions (MMX)", + "x86 Streaming SIMD Extensions (SSE)", + "x86 Streaming SIMD Extensions 2 (SSE2)", + "PowerPC G4/G5 Altivec/Velocity Engine"}; + +enum cpu_mode Cpu_mode; + +void find_cpu_mode(void){ + + int f; + if(Cpu_mode != UNKNOWN) + return; + + /* According to the wikipedia entry x86-64, all x86-64 processors have SSE2 */ + /* The same assumption is also in other source files ! */ + Cpu_mode = SSE2; + fprintf(stderr,"CPU: x86-64, using portable C implementation\n"); +} |