]> git.pld-linux.org Git - packages/Glide_V2.git/blob - glide-morearchs.patch
- rediffed patches, pass AR to remove 'l' option, which changed meaning
[packages/Glide_V2.git] / glide-morearchs.patch
1 --- GlideV2/glide2x/cvg/init/sst1init.h.orig    2022-09-26 18:55:51.354408063 +0200
2 +++ GlideV2/glide2x/cvg/init/sst1init.h 2022-09-26 19:00:30.416229589 +0200
3 @@ -163,6 +163,18 @@ p6Fence(void);
4  #elif defined (__GNUC__) && defined(__i386__)
5  #  define P6FENCE asm("xchg %%eax,%0" : /*outputs*/ : "m" (p6FenceVar) : \
6                                         "eax");
7 +#elif defined(__ia64__)
8 +#define P6FENCE asm volatile ("mf.a" ::: "memory");
9 +#elif defined(__alpha__)
10 +# define P6FENCE asm volatile("mb" ::: "memory");
11 +#elif defined(__powerpc__)
12 +# define P6FENCE asm volatile ("sync" ::: "memory");
13 +#elif defined (__x86_64__)
14 +# define P6FENCE asm volatile("mfence" ::: "memory");
15 +#elif defined(__sparc64__)
16 +# define P6FENCE asm volatile("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" ::: "memory");
17 +#elif defined(__sparc__)
18 +# define P6FENCE asm volatile("" ::: "memory");
19  #else
20  #  error "P6 Fencing in-line assembler code needs to be added for this compiler"
21  #endif  
22 --- GlideV2/glide2x/cvg/glide/src/cpudetect.c.orig      2000-04-20 23:26:36.000000000 +0200
23 +++ GlideV2/glide2x/cvg/glide/src/cpudetect.c   2013-09-21 08:28:32.804847399 +0200
24 @@ -34,14 +34,25 @@
25  }
26  
27  void single_precision_asm() {
28 +#if defined(__x86_64__)
29 +  asm("push %rax \n fnclex \n fstcw (%rsp) \n movl (%rsp), %eax \n "
30 +      "and $0x0000fcff, %eax \n movl %eax, (%rsp) \n fldcw (%rsp) \n pop %rax");
31 +#elif defined(__i386__)
32    asm("push %eax \n fnclex \n fstcw (%esp) \n movl (%esp), %eax \n "
33        "and $0x0000fcff, %eax \n movl %eax, (%esp) \n fldcw (%esp) \n pop %eax");
34 +#endif
35  }
36  
37  
38  void double_precision_asm() {
39 -  asm("push %eax \n fnclex \n fstcw (%esp) \n movw (%esp), %eax \n "
40 +#if defined(__x86_64__)
41 +  asm("push %rax \n fnclex \n fstcw (%rsp) \n movl (%rsp), %eax \n "
42 +      "and $0x0000fcff, %eax \n or $0x000002ff, %eax \n mov %eax, (%rsp) \n "
43 +      "fldcw (%rsp) \n pop %rax");
44 +#elif defined(__i386__)
45 +  asm("push %eax \n fnclex \n fstcw (%esp) \n movl (%esp), %eax \n "
46        "and $0x0000fcff, %eax \n or $0x000002ff, %eax \n mov %eax, (%esp) \n "
47        "fldcw (%esp) \n pop %eax");
48 +#endif
49  }
50  
51 --- GlideV2/glide2x/cvg/init/makefile.linux.orig        2000-04-20 23:26:36.000000000 +0200
52 +++ GlideV2/glide2x/cvg/init/makefile.linux     2013-09-21 10:33:25.196185785 +0200
53 @@ -52,5 +52,5 @@
54  # for some strange reason
55  #
56  ifndef DEBUG
57 -CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS)
58 +CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS) -fPIC
59  endif
60 --- GlideV2/glide3x/cvg/init/sst1init.h.orig    2022-09-26 18:55:51.354408063 +0200
61 +++ GlideV2/glide3x/cvg/init/sst1init.h 2022-09-26 19:00:56.486088357 +0200
62 @@ -163,6 +163,18 @@ p6Fence(void);
63  #elif defined (__GNUC__) && defined(__i386__)
64  #  define P6FENCE asm("xchg %%eax,%0" : /*outputs*/ : "m" (p6FenceVar) : \
65                                         "eax");
66 +#elif defined(__ia64__)
67 +#define P6FENCE asm volatile ("mf.a" ::: "memory");
68 +#elif defined(__alpha__)
69 +# define P6FENCE asm volatile("mb" ::: "memory");
70 +#elif defined(__powerpc__)
71 +# define P6FENCE asm volatile ("sync" ::: "memory");
72 +#elif defined (__x86_64__)
73 +# define P6FENCE asm volatile("mfence" ::: "memory");
74 +#elif defined(__sparc64__)
75 +# define P6FENCE asm volatile("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" ::: "memory");
76 +#elif defined(__sparc__)
77 +# define P6FENCE asm volatile("" ::: "memory");
78  #else
79  #  error "P6 Fencing in-line assembler code needs to be added for this compiler"
80  #endif  
81 --- GlideV2/glide3x/cvg/glide3/src/makefile.linux.orig  2000-04-20 23:26:39.000000000 +0200
82 +++ GlideV2/glide3x/cvg/glide3/src/makefile.linux       2013-09-21 14:30:15.403246286 +0200
83 @@ -144,7 +144,7 @@
84  CFILES          =       gxdraw.c
85  else
86  CFILES          =       gxdraw.c
87 -ASMTRISETUP     =       xdraw2.S xdraw3.S
88 +ASMTRISETUP     =       xdraw2.S xdraw3.S cpudtect.S
89  DSPOPTS         +=       -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1
90  endif
91  
92 @@ -193,7 +193,7 @@
93  LAINCS          =       -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
94  LAOPTS          =       $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
95  
96 -AFILES          =       $(ASMTRISETUP) cpudtect.S
97 +AFILES          =       $(ASMTRISETUP)
98  
99  # sources
100  HEADERS         =       glide.h glidesys.h glideutl.h
101 --- GlideV2/glide3x/cvg/init/makefile.linux.orig        2000-04-20 23:26:36.000000000 +0200
102 +++ GlideV2/glide3x/cvg/init/makefile.linux     2013-09-21 10:33:25.196185785 +0200
103 @@ -52,5 +52,5 @@
104  # for some strange reason
105  #
106  ifndef DEBUG
107 -CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS)
108 +CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS) -fPIC
109  endif
110 --- GlideV2/glide3x/cvg/glide3/src/gdraw.c.orig 2013-09-22 19:48:44.822836076 +0200
111 +++ GlideV2/glide3x/cvg/glide3/src/gdraw.c      2013-09-23 19:53:38.014765302 +0200
112 @@ -243,7 +243,7 @@
113      vlist[0] = (float *)a;
114      vlist[1] = (float *)b;
115      vlist[2] = (float *)c;
116 -    _grDrawTriangles(GR_VTX_PTR_ARRAY, 3, vlist);
117 +    _grDrawTriangles_Default(GR_VTX_PTR_ARRAY, 3, vlist);
118    } else {
119      /* 
120      ** draw a simple triangle 
121 --- GlideV2/glide3x/cvg/glide3/src/gpci.c.orig  2000-04-20 23:26:39.000000000 +0200
122 +++ GlideV2/glide3x/cvg/glide3/src/gpci.c       2013-09-23 20:33:53.300359679 +0200
123 @@ -221,6 +221,16 @@
124  /* Collection of all of the known procs for a given system */
125  static GrTriSetupProc _triSetupProcs[][2][2] = 
126  {
127 +#ifdef GLIDE_USE_C_TRISETUP
128 +  {
129 +    { NULL, NULL },
130 +    { NULL, _vptrisetup_cull }
131 +  },
132 +  {
133 +    { NULL, NULL },
134 +    { NULL, _vptrisetup_cull }
135 +  }
136 +#else
137    /* Default Procs */
138    {
139      { _trisetup_Default_Default, _trisetup_Default_cull }, /* GR_WINDOW_COORDS */
140 @@ -233,10 +243,20 @@
141      { _trisetup_clip_coor_thunk, _trisetup_clip_coor_thunk }, /* GR_CLIP_COORDS */
142    },
143  #endif /* GL_AMD3D */
144 +#endif
145  };
146  
147 +#ifdef GLIDE_USE_C_TRISETUP
148 +void FX_CSTYLE
149 +_grDrawVertexList(FxU32 pktype, FxU32 type, FxI32 mode, FxI32 count, void *pointers);
150 +#endif
151 +
152  static GrVertexListProc _vertexListProcs[][2] = {
153 +#ifdef GLIDE_USE_C_TRISETUP
154 +  { _grDrawVertexList, _grDrawVertexList },
155 +#else
156    { _drawvertexlist, _vpdrawvertexlist },
157 +#endif
158  #if GL_AMD3D
159    { _grDrawVertexList_3DNow_Window, _grDrawVertexList_3DNow_Clip }
160  #endif /* GL_AMD3D */
161 @@ -577,7 +597,12 @@
162  
163    /* Setup the basic proc tables based on the cpu type. */
164    {
165 -    _GlideRoot.CPUType = _cpu_detect_asm();
166 +    _GlideRoot.CPUType =
167 +#ifdef __i386__
168 +      _cpu_detect_asm();
169 +#else
170 +      0;
171 +#endif
172      if (GETENV("FX_CPU")) _GlideRoot.CPUType = atoi(GETENV("FX_CPU"));
173  
174      /* Default case */
This page took 0.063084 seconds and 3 git commands to generate.