]> git.ipfire.org Git - thirdparty/gcc.git/blame - zlib/contrib/masmx86/gvmat32c.c
This commit was generated by cvs2svn to compensate for changes in r104181,
[thirdparty/gcc.git] / zlib / contrib / masmx86 / gvmat32c.c
CommitLineData
fbac2044 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
8 *\r
9 * Read comment at beginning of gvmat32.asm for more information\r
10 */\r
11\r
12#if defined(ASMV) && (!defined(NOOLDPENTIUMCODE))\r
13#include "deflate.h"\r
14\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
21#endif\r
22\r
23\r
24unsigned long cpudetect32();\r
25\r
26uInt longest_match_c(\r
27 deflate_state *s,\r
28 IPos cur_match); /* current match */\r
29\r
30\r
31uInt longest_match_7fff(\r
32 deflate_state *s,\r
33 IPos cur_match); /* current match */\r
34\r
35uInt longest_match_686(\r
36 deflate_state *s,\r
37 IPos cur_match); /* current match */\r
38\r
39\r
40static uInt iIsPPro=2;\r
41\r
42void match_init ()\r
43{\r
44 iIsPPro = (((cpudetect32()/0x100)&0xf)>=6) ? 1 : 0;\r
45}\r
46\r
47uInt longest_match(\r
48 deflate_state *s,\r
49 IPos cur_match) /* current match */\r
50{\r
51 if (iIsPPro!=0)\r
52 return longest_match_686(s,cur_match);\r
53\r
54 if (s->w_mask != 0x7fff)\r
55 return longest_match_686(s,cur_match);\r
56\r
57 /* now ((s->w_mask == 0x7fff) && (iIsPPro==0)) */\r
58 return longest_match_7fff(s,cur_match);\r
59}\r
60\r
61\r
62#endif /* defined(ASMV) && (!defined(NOOLDPENTIUMCODE)) */\r