gate cpu-specific code with FLAC__NO_ASM

This commit is contained in:
Josh Coalson
2001-05-25 00:04:45 +00:00
parent febdca986a
commit a3f7c2c76c
2 changed files with 20 additions and 19 deletions

View File

@@ -21,7 +21,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> /* for malloc() */ #include <stdlib.h> /* for malloc() */
#include <string.h> /* for memcpy() */ #include <string.h> /* for memcpy() */
#include "FLAC/config.h"
#include "FLAC/encoder.h" #include "FLAC/encoder.h"
#include "FLAC/seek_table.h" #include "FLAC/seek_table.h"
#include "private/bitbuffer.h" #include "private/bitbuffer.h"
@@ -326,25 +325,26 @@ FLAC__EncoderState FLAC__encoder_init(FLAC__Encoder *encoder, FLAC__EncoderWrite
encoder->guts->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation; encoder->guts->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation;
encoder->guts->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor; encoder->guts->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor;
/* now override with asm where appropriate */ /* now override with asm where appropriate */
if(encoder->guts->cpuinfo.use_asm) { #ifndef FLAC__NO_ASM
assert(encoder->guts->cpuinfo.use_asm);
#ifdef FLAC__CPU_IA32 #ifdef FLAC__CPU_IA32
assert(encoder->guts->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32); assert(encoder->guts->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
#ifdef FLAC__HAS_NASM #ifdef FLAC__HAS_NASM
#if 0 #if 0
/* @@@ SSE version not working yet */ /* @@@ SSE version not working yet */
if(encoder->guts->cpuinfo.data.ia32.sse) if(encoder->guts->cpuinfo.data.ia32.sse)
encoder->guts->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_i386_sse; encoder->guts->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_i386_sse;
else else
#endif #endif
fprintf(stderr,"@@@ got _asm_i386 of lpc_compute_autocorrelation()\n"); fprintf(stderr,"@@@ got _asm_i386 of lpc_compute_autocorrelation()\n");
encoder->guts->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_i386; encoder->guts->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_i386;
if(encoder->guts->cpuinfo.data.ia32.mmx && encoder->guts->cpuinfo.data.ia32.cmov) if(encoder->guts->cpuinfo.data.ia32.mmx && encoder->guts->cpuinfo.data.ia32.cmov)
{ {
encoder->guts->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor_asm_i386_mmx_cmov; encoder->guts->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor_asm_i386_mmx_cmov;
fprintf(stderr,"@@@ got _asm_i386_mmx_cmov of fixed_compute_best_predictor()\n");} fprintf(stderr,"@@@ got _asm_i386_mmx_cmov of fixed_compute_best_predictor()\n");}
#endif #endif
#endif #endif
} #endif
if(encoder->bits_per_sample + FLAC__bitmath_ilog2(encoder->blocksize)+1 > 30) if(encoder->bits_per_sample + FLAC__bitmath_ilog2(encoder->blocksize)+1 > 30)
encoder->guts->use_slow = true; encoder->guts->use_slow = true;

View File

@@ -167,21 +167,22 @@ FLAC__StreamDecoderState FLAC__stream_decoder_init(
/* first default to the non-asm routines */ /* first default to the non-asm routines */
decoder->guts->local_lpc_restore_signal = FLAC__lpc_restore_signal; decoder->guts->local_lpc_restore_signal = FLAC__lpc_restore_signal;
/* now override with asm where appropriate */ /* now override with asm where appropriate */
if(decoder->guts->cpuinfo.use_asm) { #ifndef FLAC__NO_ASM
assert(decoder->guts->cpuinfo.use_asm);
#ifdef FLAC__CPU_IA32 #ifdef FLAC__CPU_IA32
assert(decoder->guts->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32); assert(decoder->guts->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
#ifdef FLAC__HAS_NASM #ifdef FLAC__HAS_NASM
#if 0 #if 0
/* @@@ MMX version needs bps check */ /* @@@ MMX version needs bps check */
if(decoder->guts->cpuinfo.data.ia32.mmx && @@@bps check here@@@) if(decoder->guts->cpuinfo.data.ia32.mmx && @@@bps check here@@@)
decoder->guts->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_i386_mmx; decoder->guts->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_i386_mmx;
else else
#endif #endif
fprintf(stderr,"@@@ got _asm_i386 of lpc_restore_signal()\n"); fprintf(stderr,"@@@ got _asm_i386 of lpc_restore_signal()\n");
decoder->guts->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_i386; decoder->guts->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_i386;
#endif
#endif #endif
#endif #endif
}
return decoder->state; return decoder->state;
} }