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