1 /* gvmat32.c -- C portion of the optimized longest_match for 32 bits x86
\r
2 * Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant.
\r
3 * File written by Gilles Vollant, by modifiying the longest_match
\r
4 * from Jean-loup Gailly in deflate.c
\r
5 * it prepare all parameters and call the assembly longest_match_gvasm
\r
6 * longest_match execute standard C code is wmask != 0x7fff
\r
7 * (assembly code is faster with a fixed wmask)
\r
9 * Read comment at beginning of gvmat32.asm for more information
\r
12 #if defined(ASMV) && (!defined(NOOLDPENTIUMCODE))
\r
13 #include "deflate.h"
\r
15 /* if your C compiler don't add underline before function name,
\r
16 define ADD_UNDERLINE_ASMFUNC */
\r
17 #ifdef ADD_UNDERLINE_ASMFUNC
\r
18 #define longest_match_7fff _longest_match_7fff
\r
19 #define longest_match_686 _longest_match_686
\r
20 #define cpudetect32 _cpudetect32
\r
24 unsigned long cpudetect32();
\r
26 uInt longest_match_c(
\r
28 IPos cur_match); /* current match */
\r
31 uInt longest_match_7fff(
\r
33 IPos cur_match); /* current match */
\r
35 uInt longest_match_686(
\r
37 IPos cur_match); /* current match */
\r
40 static uInt iIsPPro=2;
\r
44 iIsPPro = (((cpudetect32()/0x100)&0xf)>=6) ? 1 : 0;
\r
49 IPos cur_match) /* current match */
\r
52 return longest_match_686(s,cur_match);
\r
54 if (s->w_mask != 0x7fff)
\r
55 return longest_match_686(s,cur_match);
\r
57 /* now ((s->w_mask == 0x7fff) && (iIsPPro==0)) */
\r
58 return longest_match_7fff(s,cur_match);
\r
62 #endif /* defined(ASMV) && (!defined(NOOLDPENTIUMCODE)) */
\r