- Timestamp:
- May 21, 2000, 10:57:14 PM (25 years ago)
- Location:
- trunk/src/opengl/mesa
- Files:
-
- 9 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/accum.h
r2938 r3582 1 /* $Id: accum.h,v 1. 1 2000-02-29 00:48:24 sandervlExp $ */1 /* $Id: accum.h,v 1.2 2000-05-21 19:58:10 jeroen Exp $ */ 2 2 3 3 /* … … 36 36 37 37 38 extern void gl_alloc_accum_buffer( GLcontext *ctx ); 38 extern void 39 _mesa_alloc_accum_buffer( GLcontext *ctx ); 39 40 40 41 41 extern void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value ); 42 extern void 43 _mesa_clear_accum_buffer( GLcontext *ctx ); 42 44 43 45 44 extern void gl_ClearAccum( GLcontext *ctx, GLfloat red, GLfloat green,45 GLfloat blue, GLfloat alpha);46 extern void 47 _mesa_Accum( GLenum op, GLfloat value ); 46 48 47 49 48 extern void gl_clear_accum_buffer( GLcontext *ctx ); 50 extern void 51 _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); 52 53 49 54 50 55 -
trunk/src/opengl/mesa/all.h
r2938 r3582 1 /* $Id: all.h,v 1. 1 2000-02-29 00:48:24 sandervlExp $ */1 /* $Id: all.h,v 1.2 2000-05-21 20:00:53 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 52 52 #endif 53 53 54 #ifndef XFree86LOADER 55 #include <assert.h> 56 #include <limits.h> 57 #include <stdlib.h> 58 #include <stdio.h> 59 #include <string.h> 60 #include <float.h> 61 #include <math.h> 62 #endif 63 #include "gl.h" 64 #ifdef XFree86Server 65 #include "GL/osmesa.h" 66 #endif 54 #include "glheader.h" 67 55 #include "accum.h" 68 56 #include "alpha.h" … … 96 84 #include "masking.h" 97 85 #include "matrix.h" 98 #include "glmisc.h"99 86 #include "mmath.h" 100 87 #include "pb.h" … … 125 112 #include "xform.h" 126 113 #include "zoom.h" 127 #ifdef XFree86Server128 #include "GL/xf86glx.h"129 #endif130 114 131 115 #endif /*SRC_ALL_H*/ -
trunk/src/opengl/mesa/alpha.h
r2938 r3582 1 /* $Id: alpha.h,v 1. 1 2000-02-29 00:48:24 sandervlExp $ */1 /* $Id: alpha.h,v 1.2 2000-05-21 20:03:18 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern GLint gl_alpha_test( const GLcontext *ctx, GLuint n, 39 CONST GLubyte rgba[][4], GLubyte mask[] ); 38 extern GLint 39 _mesa_alpha_test( const GLcontext *ctx, GLuint n, 40 CONST GLubyte rgba[][4], GLubyte mask[] ); 40 41 41 42 42 extern void gl_AlphaFunc( GLcontext *ctx, GLenum func, GLclampf ref ); 43 extern void 44 _mesa_AlphaFunc( GLenum func, GLclampf ref ); 43 45 44 46 -
trunk/src/opengl/mesa/assyntax.h
r2938 r3582 1 /* $Id: assyntax.h,v 1. 1 2000-02-29 00:48:24 sandervlExp $ */1 /* $Id: assyntax.h,v 1.2 2000-05-21 20:04:51 jeroen Exp $ */ 2 2 3 3 #ifndef __ASSYNTAX_H__ … … 74 74 #endif 75 75 76 #if (defined(__STDC__) && !defined(UNIXCPP)) || (defined (sun) && defined (i386) && defined (SVR4) && defined (__STDC__) && !defined (__GNUC__)) 76 #if (defined(__STDC__) && !defined(UNIXCPP)) || (defined (sun) && defined (i386) \ 77 && defined (SVR4) && defined (__STDC__) && !defined (__GNUC__)) 77 78 #define CONCAT(x, y) x ## y 78 79 #else … … 89 90 #define AX ax 90 91 #define EAX ax 91 #define BLbl92 #define BHbh93 #define BXbx94 #define EBXbx95 #define CLcl96 #define CHch97 #define CXcx98 #define ECXcx99 #define DLdl100 #define DHdh101 #define DXdx102 #define EDXdx103 #define BPbp104 #define EBPbp105 #define SIsi106 #define ESIsi107 #define DIdi108 #define EDIdi109 #define SPsp110 #define ESPsp111 #define CScs112 #define SSss113 #define DSds114 #define ESes115 #define FSfs116 #define GSgs92 #define BL bl 93 #define BH bh 94 #define BX bx 95 #define EBX bx 96 #define CL cl 97 #define CH ch 98 #define CX cx 99 #define ECX cx 100 #define DL dl 101 #define DH dh 102 #define DX dx 103 #define EDX dx 104 #define BP bp 105 #define EBP bp 106 #define SI si 107 #define ESI si 108 #define DI di 109 #define EDI di 110 #define SP sp 111 #define ESP sp 112 #define CS cs 113 #define SS ss 114 #define DS ds 115 #define ES es 116 #define FS fs 117 #define GS gs 117 118 /* Control Registers */ 118 #define CR0cr0119 #define CR1cr1120 #define CR2cr2121 #define CR3cr3119 #define CR0 cr0 120 #define CR1 cr1 121 #define CR2 cr2 122 #define CR3 cr3 122 123 /* Debug Registers */ 123 #define DR0dr0124 #define DR1dr1125 #define DR2dr2126 #define DR3dr3127 #define DR4dr4128 #define DR5dr5129 #define DR6dr6130 #define DR7dr7124 #define DR0 dr0 125 #define DR1 dr1 126 #define DR2 dr2 127 #define DR3 dr3 128 #define DR4 dr4 129 #define DR5 dr5 130 #define DR6 dr6 131 #define DR7 dr7 131 132 /* Floating-point Stack */ 132 #define STst133 134 #define AS_BEGIN.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text135 136 137 #define _WTOG o16/* word toggle for _W instructions */138 #define _LTOG/* long toggle for _L instructions */139 #define ADDR_TOGGLEa16140 #define OPSZ_TOGGLEo16141 #define USE16.use16142 #define USE32.use32143 144 #define CHOICE(a,b,c)c133 #define ST st 134 135 #define AS_BEGIN .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text 136 137 138 #define _WTOG o16 /* word toggle for _W instructions */ 139 #define _LTOG /* long toggle for _L instructions */ 140 #define ADDR_TOGGLE a16 141 #define OPSZ_TOGGLE o16 142 #define USE16 .use16 143 #define USE32 .use32 144 145 #define CHOICE(a,b,c) c 145 146 146 147 #else /* AT&T or GAS */ 147 148 148 149 /* Redefine register names for GAS & AT&T assemblers */ 149 #define AL%al150 #define AH%ah151 #define AX%ax152 #define EAX%eax153 #define BL%bl154 #define BH%bh155 #define BX%bx156 #define EBX%ebx157 #define CL%cl158 #define CH%ch159 #define CX%cx160 #define ECX%ecx161 #define DL%dl162 #define DH%dh163 #define DX%dx164 #define EDX%edx165 #define BP%bp166 #define EBP%ebp167 #define SI%si168 #define ESI%esi169 #define DI%di170 #define EDI%edi171 #define SP%sp172 #define ESP%esp173 #define CS%cs174 #define SS%ss175 #define DS%ds176 #define ES%es177 #define FS%fs178 #define GS%gs150 #define AL %al 151 #define AH %ah 152 #define AX %ax 153 #define EAX %eax 154 #define BL %bl 155 #define BH %bh 156 #define BX %bx 157 #define EBX %ebx 158 #define CL %cl 159 #define CH %ch 160 #define CX %cx 161 #define ECX %ecx 162 #define DL %dl 163 #define DH %dh 164 #define DX %dx 165 #define EDX %edx 166 #define BP %bp 167 #define EBP %ebp 168 #define SI %si 169 #define ESI %esi 170 #define DI %di 171 #define EDI %edi 172 #define SP %sp 173 #define ESP %esp 174 #define CS %cs 175 #define SS %ss 176 #define DS %ds 177 #define ES %es 178 #define FS %fs 179 #define GS %gs 179 180 /* Control Registers */ 180 #define CR0%cr0181 #define CR1%cr1182 #define CR2%cr2183 #define CR3%cr3181 #define CR0 %cr0 182 #define CR1 %cr1 183 #define CR2 %cr2 184 #define CR3 %cr3 184 185 /* Debug Registers */ 185 #define DR0%db0186 #define DR1%db1187 #define DR2%db2188 #define DR3%db3189 #define DR4%db4190 #define DR5%db5191 #define DR6%db6192 #define DR7%db7186 #define DR0 %db0 187 #define DR1 %db1 188 #define DR2 %db2 189 #define DR3 %db3 190 #define DR4 %db4 191 #define DR5 %db5 192 #define DR6 %db6 193 #define DR7 %db7 193 194 /* Floating-point Stack */ 194 #define ST %st 195 #define _STX0 %st(0) 196 #define _STX1 %st(1) 197 #define _STX2 %st(2) 198 #define _STX3 %st(3) 199 #define _STX4 %st(4) 200 #define _STX5 %st(5) 201 #define _STX6 %st(6) 202 #define _STX7 %st(7) 203 #define ST(x) CONCAT(_STX,x) 195 204 /* MMX Registers */ 196 #define MM0 197 #define MM1 198 #define MM2 199 #define MM3 200 #define MM4 201 #define MM5 202 #define MM6 203 #define MM7 205 #define MM0 %mm0 206 #define MM1 %mm1 207 #define MM2 %mm2 208 #define MM3 %mm3 209 #define MM4 %mm4 210 #define MM5 %mm5 211 #define MM6 %mm6 212 #define MM7 %mm7 204 213 /* SSE Registers */ 205 #define XMM0 206 #define XMM1 207 #define XMM2 208 #define XMM3 209 #define XMM4 210 #define XMM5 211 #define XMM6 212 #define XMM7 213 214 #define 215 #define 216 #define 214 #define XMM0 %xmm0 215 #define XMM1 %xmm1 216 #define XMM2 %xmm2 217 #define XMM3 %xmm3 218 #define XMM4 %xmm4 219 #define XMM5 %xmm5 220 #define XMM6 %xmm6 221 #define XMM7 %xmm7 222 223 #define AS_BEGIN 224 #define USE16 225 #define USE32 217 226 218 227 #ifdef GNU_ASSEMBLER 219 228 220 #define ADDR_TOGGLEaword221 #define OPSZ_TOGGLEword222 223 #define CHOICE(a,b,c)b229 #define ADDR_TOGGLE aword 230 #define OPSZ_TOGGLE word 231 232 #define CHOICE(a,b,c) b 224 233 225 234 #else … … 237 246 238 247 239 #if defined( Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__) || defined(__FreeBSD__) && __FreeBSD__ >= 3248 #if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__) 240 249 #define GLNAME(a) a 241 250 #else … … 253 262 /* Redefine assembler directives */ 254 263 /*********************************/ 255 #define GLOBL 264 #define GLOBL CHOICE(.globl, .globl, .extern) 256 265 /* 257 #define ALIGNTEXT32CHOICE(.align 32, .align ARG2(5,0x90), .align 32)266 #define ALIGNTEXT32 CHOICE(.align 32, .align ARG2(5,0x90), .align 32) 258 267 */ 259 #define ALIGNTEXT32CHOICE(.align 32, .balign 32, .align 32)260 #define ALIGNTEXT16CHOICE(.align 16, .balign 16, .align 16)261 #define ALIGNTEXT8CHOICE(.align 8, .balign 8, .align 8)262 #define ALIGNTEXT4CHOICE(.align 4, .balign 4, .align 4)263 #define ALIGNTEXT2CHOICE(.align 2, .balign 2, .align 2)268 #define ALIGNTEXT32 CHOICE(.align 32, .balign 32, .align 32) 269 #define ALIGNTEXT16 CHOICE(.align 16, .balign 16, .align 16) 270 #define ALIGNTEXT8 CHOICE(.align 8, .balign 8, .align 8) 271 #define ALIGNTEXT4 CHOICE(.align 4, .balign 4, .align 4) 272 #define ALIGNTEXT2 CHOICE(.align 2, .balign 2, .align 2) 264 273 /* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is 265 274 * guaranteed to be filled with NOPs. Otherwise it does nothing. 266 275 */ 267 #define ALIGNTEXT32ifNOPCHOICE(.align 32, .balign ARG2(32,0x90), /*can't do it*/)268 #define ALIGNTEXT16ifNOPCHOICE(.align 16, .balign ARG2(16,0x90), /*can't do it*/)269 #define ALIGNTEXT8ifNOPCHOICE(.align 8, .balign ARG2(8,0x90), /*can't do it*/)270 #define ALIGNTEXT4ifNOPCHOICE(.align 4, .balign ARG2(4,0x90), /*can't do it*/)271 #define ALIGNDATA32CHOICE(.align 32, .balign ARG2(32,0x0), .align 32)272 #define ALIGNDATA16CHOICE(.align 16, .balign ARG2(16,0x0), .align 16)273 #define ALIGNDATA8CHOICE(.align 8, .balign ARG2(8,0x0), .align 8)274 #define ALIGNDATA4CHOICE(.align 4, .balign ARG2(4,0x0), .align 4)275 #define ALIGNDATA2CHOICE(.align 2, .balign ARG2(2,0x0), .align 2)276 #define FILE(s)CHOICE(.file s, .file s, .file s)277 #define STRING(s)CHOICE(.string s, .asciz s, .asciz s)278 #define D_LONGCHOICE(.long, .long, .data4)279 #define D_WORDCHOICE(.value, .short, .data2)280 #define D_BYTECHOICE(.byte, .byte, .data1)281 #define SPACECHOICE(.comm, .space, .space)282 #define COMMCHOICE(.comm, .comm, .comm)283 #define SEG_DATACHOICE(.data, .data, .sect .data)284 #define SEG_TEXTCHOICE(.text, .text, .sect .text)285 #define SEG_BSSCHOICE(.bss, .bss, .sect .bss)276 #define ALIGNTEXT32ifNOP CHOICE(.align 32, .balign ARG2(32,0x90), /*can't do it*/) 277 #define ALIGNTEXT16ifNOP CHOICE(.align 16, .balign ARG2(16,0x90), /*can't do it*/) 278 #define ALIGNTEXT8ifNOP CHOICE(.align 8, .balign ARG2(8,0x90), /*can't do it*/) 279 #define ALIGNTEXT4ifNOP CHOICE(.align 4, .balign ARG2(4,0x90), /*can't do it*/) 280 #define ALIGNDATA32 CHOICE(.align 32, .balign ARG2(32,0x0), .align 32) 281 #define ALIGNDATA16 CHOICE(.align 16, .balign ARG2(16,0x0), .align 16) 282 #define ALIGNDATA8 CHOICE(.align 8, .balign ARG2(8,0x0), .align 8) 283 #define ALIGNDATA4 CHOICE(.align 4, .balign ARG2(4,0x0), .align 4) 284 #define ALIGNDATA2 CHOICE(.align 2, .balign ARG2(2,0x0), .align 2) 285 #define FILE(s) CHOICE(.file s, .file s, .file s) 286 #define STRING(s) CHOICE(.string s, .asciz s, .asciz s) 287 #define D_LONG CHOICE(.long, .long, .data4) 288 #define D_WORD CHOICE(.value, .short, .data2) 289 #define D_BYTE CHOICE(.byte, .byte, .data1) 290 #define SPACE CHOICE(.comm, .space, .space) 291 #define COMM CHOICE(.comm, .comm, .comm) 292 #define SEG_DATA CHOICE(.data, .data, .sect .data) 293 #define SEG_TEXT CHOICE(.text, .text, .sect .text) 294 #define SEG_BSS CHOICE(.bss, .bss, .sect .bss) 286 295 287 296 #ifdef GNU_ASSEMBLER 288 #define D_SPACE(n). = . + n297 #define D_SPACE(n) . = . + n 289 298 #else 290 #define D_SPACE(n).space n299 #define D_SPACE(n) .space n 291 300 #endif 292 301 293 302 /* Addressing Modes */ 294 303 /* Immediate Mode */ 295 #define ADDR(a)CHOICE(CONCAT($,a), CONCAT($,a), a)296 #define CONST(a)CHOICE(CONCAT($,a), CONCAT($,a), a)304 #define ADDR(a) CHOICE(CONCAT($,a), CONCAT($,a), a) 305 #define CONST(a) CHOICE(CONCAT($,a), CONCAT($,a), a) 297 306 298 307 /* Indirect Mode */ 299 #define CONTENT(a) CHOICE(a, a, (a))/* take contents of variable */300 #define REGIND(a) CHOICE((a), (a), (a))/* Register a indirect */308 #define CONTENT(a) CHOICE(a, a, (a)) /* take contents of variable */ 309 #define REGIND(a) CHOICE((a), (a), (a)) /* Register a indirect */ 301 310 /* Register b indirect plus displacement a */ 302 #define REGOFF(a, b)CHOICE(a(b), a(b), a(b))311 #define REGOFF(a, b) CHOICE(a(b), a(b), a(b)) 303 312 /* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode 304 313 * which has no scaling 305 314 */ 306 #define REGBID(b,i,d)CHOICE(d(b,i), d(b,i), d(b)(i))315 #define REGBID(b,i,d) CHOICE(d(b,i), d(b,i), d(b)(i)) 307 316 /* Reg indirect Base + (Index * Scale) + Displacement */ 308 #define 317 #define REGBISD(b,i,s,d) CHOICE(d(b,i,s), d(b,i,s), d(b)(i*s)) 309 318 /* Displaced Scaled Index: */ 310 #define REGDIS(d,i,s) 319 #define REGDIS(d,i,s) CHOICE(d(,i,s), d(,i,s), d(i * s)) 311 320 /* Indexed Base: */ 312 #define REGBI(b,i) 321 #define REGBI(b,i) CHOICE((b,i), (b,i), (b)(i)) 313 322 /* Displaced Base: */ 314 #define REGDB(d,b) 323 #define REGDB(d,b) CHOICE(d(b), d(b), d(b)) 315 324 /* Variable indirect: */ 316 325 #define VARINDIRECT(var) CHOICE(*var, *var, (var)) 317 326 /* Use register contents as jump/call target: */ 318 #define CODEPTR(reg) 327 #define CODEPTR(reg) CHOICE(*reg, *reg, reg) 319 328 320 329 /* For expressions requiring bracketing … … 322 331 */ 323 332 324 #define EXPR(a)CHOICE([a], (a), [a])325 #define ENOT(a)CHOICE(0!a, ~a, ~a)326 #define EMUL(a,b)CHOICE(a\*b, a*b, a*b)327 #define EDIV(a,b)CHOICE(a\/b, a/b, a/b)333 #define EXPR(a) CHOICE([a], (a), [a]) 334 #define ENOT(a) CHOICE(0!a, ~a, ~a) 335 #define EMUL(a,b) CHOICE(a\*b, a*b, a*b) 336 #define EDIV(a,b) CHOICE(a\/b, a/b, a/b) 328 337 329 338 /* … … 333 342 * so the following works. 334 343 */ 335 #define ARG2(a, b)a,b336 #define ARG3(a,b,c)a,b,c344 #define ARG2(a, b) a,b 345 #define ARG3(a,b,c) a,b,c 337 346 338 347 /* Redefine assembler commands */ 339 #define AAACHOICE(aaa, aaa, aaa)340 #define AADCHOICE(aad, aad, aad)341 #define AAMCHOICE(aam, aam, aam)342 #define AASCHOICE(aas, aas, aas)343 #define ADC_L(a, b)CHOICE(adcl ARG2(a,b), adcl ARG2(a,b), _LTOG adc ARG2(b,a))344 #define ADC_W(a, b)CHOICE(adcw ARG2(a,b), adcw ARG2(a,b), _WTOG adc ARG2(b,a))345 #define ADC_B(a, b)CHOICE(adcb ARG2(a,b), adcb ARG2(a,b), adcb ARG2(b,a))346 #define ADD_L(a, b)CHOICE(addl ARG2(a,b), addl ARG2(a,b), _LTOG add ARG2(b,a))347 #define ADD_W(a, b)CHOICE(addw ARG2(a,b), addw ARG2(a,b), _WTOG add ARG2(b,a))348 #define ADD_B(a, b)CHOICE(addb ARG2(a,b), addb ARG2(a,b), addb ARG2(b,a))349 #define AND_L(a, b)CHOICE(andl ARG2(a,b), andl ARG2(a,b), _LTOG and ARG2(b,a))350 #define AND_W(a, b)CHOICE(andw ARG2(a,b), andw ARG2(a,b), _WTOG and ARG2(b,a))351 #define AND_B(a, b)CHOICE(andb ARG2(a,b), andb ARG2(a,b), andb ARG2(b,a))352 #define ARPL(a,b)CHOICE(arpl ARG2(a,b), arpl ARG2(a,b), arpl ARG2(b,a))353 #define BOUND_L(a, b)CHOICE(boundl ARG2(a,b), boundl ARG2(b,a), _LTOG bound ARG2(b,a))354 #define BOUND_W(a, b)CHOICE(boundw ARG2(a,b), boundw ARG2(b,a), _WTOG bound ARG2(b,a))355 #define BSF_L(a, b)CHOICE(bsfl ARG2(a,b), bsfl ARG2(a,b), _LTOG bsf ARG2(b,a))356 #define BSF_W(a, b)CHOICE(bsfw ARG2(a,b), bsfw ARG2(a,b), _WTOG bsf ARG2(b,a))357 #define BSR_L(a, b)CHOICE(bsrl ARG2(a,b), bsrl ARG2(a,b), _LTOG bsr ARG2(b,a))358 #define BSR_W(a, b)CHOICE(bsrw ARG2(a,b), bsrw ARG2(a,b), _WTOG bsr ARG2(b,a))359 #define BT_L(a, b)CHOICE(btl ARG2(a,b), btl ARG2(a,b), _LTOG bt ARG2(b,a))360 #define BT_W(a, b)CHOICE(btw ARG2(a,b), btw ARG2(a,b), _WTOG bt ARG2(b,a))361 #define BTC_L(a, b)CHOICE(btcl ARG2(a,b), btcl ARG2(a,b), _LTOG btc ARG2(b,a))362 #define BTC_W(a, b)CHOICE(btcw ARG2(a,b), btcw ARG2(a,b), _WTOG btc ARG2(b,a))363 #define BTR_L(a, b)CHOICE(btrl ARG2(a,b), btrl ARG2(a,b), _LTOG btr ARG2(b,a))364 #define BTR_W(a, b)CHOICE(btrw ARG2(a,b), btrw ARG2(a,b), _WTOG btr ARG2(b,a))365 #define BTS_L(a, b)CHOICE(btsl ARG2(a,b), btsl ARG2(a,b), _LTOG bts ARG2(b,a))366 #define BTS_W(a, b)CHOICE(btsw ARG2(a,b), btsw ARG2(a,b), _WTOG bts ARG2(b,a))367 #define CALL(a)CHOICE(call a, call a, call a)368 #define CALLF(s,a)CHOICE(lcall ARG2(s,a), lcall ARG2(s,a), callf s:a)369 #define CBWCHOICE(cbtw, cbw, cbw)370 #define CWDECHOICE(cwtd, cwde, cwde)371 #define CLCCHOICE(clc, clc, clc)372 #define CLDCHOICE(cld, cld, cld)373 #define CLICHOICE(cli, cli, cli)374 #define CLTSCHOICE(clts, clts, clts)375 #define CMCCHOICE(cmc, cmc, cmc)376 #define CMP_L(a, b)CHOICE(cmpl ARG2(a,b), cmpl ARG2(a,b), _LTOG cmp ARG2(b,a))377 #define CMP_W(a, b)CHOICE(cmpw ARG2(a,b), cmpw ARG2(a,b), _WTOG cmp ARG2(b,a))378 #define CMP_B(a, b)CHOICE(cmpb ARG2(a,b), cmpb ARG2(a,b), cmpb ARG2(b,a))379 #define CMPS_LCHOICE(cmpsl, cmpsl, _LTOG cmps)380 #define CMPS_WCHOICE(cmpsw, cmpsw, _WTOG cmps)381 #define CMPS_BCHOICE(cmpsb, cmpsb, cmpsb)382 #define CWDCHOICE(cwtl, cwd, cwd)383 #define CDQCHOICE(cltd, cdq, cdq)384 #define DAACHOICE(daa, daa, daa)385 #define DASCHOICE(das, das, das)386 #define DEC_L(a)CHOICE(decl a, decl a, _LTOG dec a)387 #define DEC_W(a)CHOICE(decw a, decw a, _WTOG dec a)388 #define DEC_B(a)CHOICE(decb a, decb a, decb a)389 #define DIV_L(a)CHOICE(divl a, divl a, div a)390 #define DIV_W(a)CHOICE(divw a, divw a, div a)391 #define DIV_B(a)CHOICE(divb a, divb a, divb a)392 #define ENTER(a,b)CHOICE(enter ARG2(a,b), enter ARG2(a,b), enter ARG2(b,a))393 #define HLTCHOICE(hlt, hlt, hlt)394 #define IDIV_L(a)CHOICE(idivl a, idivl a, _LTOG idiv a)395 #define IDIV_W(a)CHOICE(idivw a, idivw a, _WTOG idiv a)396 #define IDIV_B(a)CHOICE(idivb a, idivb a, idivb a)348 #define AAA CHOICE(aaa, aaa, aaa) 349 #define AAD CHOICE(aad, aad, aad) 350 #define AAM CHOICE(aam, aam, aam) 351 #define AAS CHOICE(aas, aas, aas) 352 #define ADC_L(a, b) CHOICE(adcl ARG2(a,b), adcl ARG2(a,b), _LTOG adc ARG2(b,a)) 353 #define ADC_W(a, b) CHOICE(adcw ARG2(a,b), adcw ARG2(a,b), _WTOG adc ARG2(b,a)) 354 #define ADC_B(a, b) CHOICE(adcb ARG2(a,b), adcb ARG2(a,b), adcb ARG2(b,a)) 355 #define ADD_L(a, b) CHOICE(addl ARG2(a,b), addl ARG2(a,b), _LTOG add ARG2(b,a)) 356 #define ADD_W(a, b) CHOICE(addw ARG2(a,b), addw ARG2(a,b), _WTOG add ARG2(b,a)) 357 #define ADD_B(a, b) CHOICE(addb ARG2(a,b), addb ARG2(a,b), addb ARG2(b,a)) 358 #define AND_L(a, b) CHOICE(andl ARG2(a,b), andl ARG2(a,b), _LTOG and ARG2(b,a)) 359 #define AND_W(a, b) CHOICE(andw ARG2(a,b), andw ARG2(a,b), _WTOG and ARG2(b,a)) 360 #define AND_B(a, b) CHOICE(andb ARG2(a,b), andb ARG2(a,b), andb ARG2(b,a)) 361 #define ARPL(a,b) CHOICE(arpl ARG2(a,b), arpl ARG2(a,b), arpl ARG2(b,a)) 362 #define BOUND_L(a, b) CHOICE(boundl ARG2(a,b), boundl ARG2(b,a), _LTOG bound ARG2(b,a)) 363 #define BOUND_W(a, b) CHOICE(boundw ARG2(a,b), boundw ARG2(b,a), _WTOG bound ARG2(b,a)) 364 #define BSF_L(a, b) CHOICE(bsfl ARG2(a,b), bsfl ARG2(a,b), _LTOG bsf ARG2(b,a)) 365 #define BSF_W(a, b) CHOICE(bsfw ARG2(a,b), bsfw ARG2(a,b), _WTOG bsf ARG2(b,a)) 366 #define BSR_L(a, b) CHOICE(bsrl ARG2(a,b), bsrl ARG2(a,b), _LTOG bsr ARG2(b,a)) 367 #define BSR_W(a, b) CHOICE(bsrw ARG2(a,b), bsrw ARG2(a,b), _WTOG bsr ARG2(b,a)) 368 #define BT_L(a, b) CHOICE(btl ARG2(a,b), btl ARG2(a,b), _LTOG bt ARG2(b,a)) 369 #define BT_W(a, b) CHOICE(btw ARG2(a,b), btw ARG2(a,b), _WTOG bt ARG2(b,a)) 370 #define BTC_L(a, b) CHOICE(btcl ARG2(a,b), btcl ARG2(a,b), _LTOG btc ARG2(b,a)) 371 #define BTC_W(a, b) CHOICE(btcw ARG2(a,b), btcw ARG2(a,b), _WTOG btc ARG2(b,a)) 372 #define BTR_L(a, b) CHOICE(btrl ARG2(a,b), btrl ARG2(a,b), _LTOG btr ARG2(b,a)) 373 #define BTR_W(a, b) CHOICE(btrw ARG2(a,b), btrw ARG2(a,b), _WTOG btr ARG2(b,a)) 374 #define BTS_L(a, b) CHOICE(btsl ARG2(a,b), btsl ARG2(a,b), _LTOG bts ARG2(b,a)) 375 #define BTS_W(a, b) CHOICE(btsw ARG2(a,b), btsw ARG2(a,b), _WTOG bts ARG2(b,a)) 376 #define CALL(a) CHOICE(call a, call a, call a) 377 #define CALLF(s,a) CHOICE(lcall ARG2(s,a), lcall ARG2(s,a), callf s:a) 378 #define CBW CHOICE(cbtw, cbw, cbw) 379 #define CWDE CHOICE(cwtd, cwde, cwde) 380 #define CLC CHOICE(clc, clc, clc) 381 #define CLD CHOICE(cld, cld, cld) 382 #define CLI CHOICE(cli, cli, cli) 383 #define CLTS CHOICE(clts, clts, clts) 384 #define CMC CHOICE(cmc, cmc, cmc) 385 #define CMP_L(a, b) CHOICE(cmpl ARG2(a,b), cmpl ARG2(a,b), _LTOG cmp ARG2(b,a)) 386 #define CMP_W(a, b) CHOICE(cmpw ARG2(a,b), cmpw ARG2(a,b), _WTOG cmp ARG2(b,a)) 387 #define CMP_B(a, b) CHOICE(cmpb ARG2(a,b), cmpb ARG2(a,b), cmpb ARG2(b,a)) 388 #define CMPS_L CHOICE(cmpsl, cmpsl, _LTOG cmps) 389 #define CMPS_W CHOICE(cmpsw, cmpsw, _WTOG cmps) 390 #define CMPS_B CHOICE(cmpsb, cmpsb, cmpsb) 391 #define CWD CHOICE(cwtl, cwd, cwd) 392 #define CDQ CHOICE(cltd, cdq, cdq) 393 #define DAA CHOICE(daa, daa, daa) 394 #define DAS CHOICE(das, das, das) 395 #define DEC_L(a) CHOICE(decl a, decl a, _LTOG dec a) 396 #define DEC_W(a) CHOICE(decw a, decw a, _WTOG dec a) 397 #define DEC_B(a) CHOICE(decb a, decb a, decb a) 398 #define DIV_L(a) CHOICE(divl a, divl a, div a) 399 #define DIV_W(a) CHOICE(divw a, divw a, div a) 400 #define DIV_B(a) CHOICE(divb a, divb a, divb a) 401 #define ENTER(a,b) CHOICE(enter ARG2(a,b), enter ARG2(a,b), enter ARG2(b,a)) 402 #define HLT CHOICE(hlt, hlt, hlt) 403 #define IDIV_L(a) CHOICE(idivl a, idivl a, _LTOG idiv a) 404 #define IDIV_W(a) CHOICE(idivw a, idivw a, _WTOG idiv a) 405 #define IDIV_B(a) CHOICE(idivb a, idivb a, idivb a) 397 406 /* More forms than this for imul!! */ 398 #define IMUL_L(a, b)CHOICE(imull ARG2(a,b), imull ARG2(a,b), _LTOG imul ARG2(b,a))399 #define IMUL_W(a, b)CHOICE(imulw ARG2(a,b), imulw ARG2(a,b), _WTOG imul ARG2(b,a))400 #define IMUL_B(a)CHOICE(imulb a, imulb a, imulb a)401 #define IN_LCHOICE(inl (DX), inl ARG2(DX,EAX), _LTOG in DX)402 #define IN_WCHOICE(inw (DX), inw ARG2(DX,AX), _WTOG in DX)403 #define IN_BCHOICE(inb (DX), inb ARG2(DX,AL), inb DX)407 #define IMUL_L(a, b) CHOICE(imull ARG2(a,b), imull ARG2(a,b), _LTOG imul ARG2(b,a)) 408 #define IMUL_W(a, b) CHOICE(imulw ARG2(a,b), imulw ARG2(a,b), _WTOG imul ARG2(b,a)) 409 #define IMUL_B(a) CHOICE(imulb a, imulb a, imulb a) 410 #define IN_L CHOICE(inl (DX), inl ARG2(DX,EAX), _LTOG in DX) 411 #define IN_W CHOICE(inw (DX), inw ARG2(DX,AX), _WTOG in DX) 412 #define IN_B CHOICE(inb (DX), inb ARG2(DX,AL), inb DX) 404 413 /* Please AS code writer: use the following ONLY, if you refer to ports<256 405 414 * directly, but not in IN1_W(DX), for instance, even if IN1_ looks nicer … … 410 419 #define IN1_B(a) CHOICE(inb (a), inb ARG2(a,AL), inb a) 411 420 #else 412 #define IN1_L(a)CHOICE(inl a, inl ARG2(a,EAX), _LTOG in a)413 #define IN1_W(a)CHOICE(inw a, inw ARG2(a,AX), _WTOG in a)414 #define IN1_B(a)CHOICE(inb a, inb ARG2(a,AL), inb a)421 #define IN1_L(a) CHOICE(inl a, inl ARG2(a,EAX), _LTOG in a) 422 #define IN1_W(a) CHOICE(inw a, inw ARG2(a,AX), _WTOG in a) 423 #define IN1_B(a) CHOICE(inb a, inb ARG2(a,AL), inb a) 415 424 #endif 416 #define INC_L(a)CHOICE(incl a, incl a, _LTOG inc a)417 #define INC_W(a)CHOICE(incw a, incw a, _WTOG inc a)418 #define INC_B(a)CHOICE(incb a, incb a, incb a)419 #define INS_LCHOICE(insl, insl, _LTOG ins)420 #define INS_WCHOICE(insw, insw, _WTOG ins)421 #define INS_BCHOICE(insb, insb, insb)422 #define INT(a)CHOICE(int a, int a, int a)423 #define INT3CHOICE(int CONST(3), int3, int CONST(3))424 #define INTOCHOICE(into, into, into)425 #define IRETCHOICE(iret, iret, iret)426 #define IRETDCHOICE(iret, iret, iretd)427 #define JA(a)CHOICE(ja a, ja a, ja a)428 #define JAE(a)CHOICE(jae a, jae a, jae a)429 #define JB(a)CHOICE(jb a, jb a, jb a)430 #define JBE(a)CHOICE(jbe a, jbe a, jbe a)431 #define JC(a)CHOICE(jc a, jc a, jc a)432 #define JE(a)CHOICE(je a, je a, je a)433 #define JG(a)CHOICE(jg a, jg a, jg a)434 #define JGE(a)CHOICE(jge a, jge a, jge a)435 #define JL(a)CHOICE(jl a, jl a, jl a)436 #define JLE(a)CHOICE(jle a, jle a, jle a)437 #define JNA(a)CHOICE(jna a, jna a, jna a)438 #define JNAE(a)CHOICE(jnae a, jnae a, jnae a)439 #define JNB(a)CHOICE(jnb a, jnb a, jnb a)440 #define JNBE(a)CHOICE(jnbe a, jnbe a, jnbe a)441 #define JNC(a)CHOICE(jnc a, jnc a, jnc a)442 #define JNE(a)CHOICE(jne a, jne a, jne a)443 #define JNG(a)CHOICE(jng a, jng a, jng a)444 #define JNGE(a)CHOICE(jnge a, jnge a, jnge a)445 #define JNL(a)CHOICE(jnl a, jnl a, jnl a)446 #define JNLE(a)CHOICE(jnle a, jnle a, jnle a)447 #define JNO(a)CHOICE(jno a, jno a, jno a)448 #define JNP(a)CHOICE(jnp a, jnp a, jnp a)449 #define JNS(a)CHOICE(jns a, jns a, jns a)450 #define JNZ(a)CHOICE(jnz a, jnz a, jnz a)451 #define JO(a)CHOICE(jo a, jo a, jo a)452 #define JP(a)CHOICE(jp a, jp a, jp a)453 #define JPE(a)CHOICE(jpe a, jpe a, jpe a)454 #define JPO(a)CHOICE(jpo a, jpo a, jpo a)455 #define JS(a)CHOICE(js a, js a, js a)456 #define JZ(a)CHOICE(jz a, jz a, jz a)457 #define JMP(a)CHOICE(jmp a, jmp a, jmp a)458 #define JMPF(s,a)CHOICE(ljmp ARG2(s,a), ljmp ARG2(s,a), jmpf s:a)459 #define LAHFCHOICE(lahf, lahf, lahf)425 #define INC_L(a) CHOICE(incl a, incl a, _LTOG inc a) 426 #define INC_W(a) CHOICE(incw a, incw a, _WTOG inc a) 427 #define INC_B(a) CHOICE(incb a, incb a, incb a) 428 #define INS_L CHOICE(insl, insl, _LTOG ins) 429 #define INS_W CHOICE(insw, insw, _WTOG ins) 430 #define INS_B CHOICE(insb, insb, insb) 431 #define INT(a) CHOICE(int a, int a, int a) 432 #define INT3 CHOICE(int CONST(3), int3, int CONST(3)) 433 #define INTO CHOICE(into, into, into) 434 #define IRET CHOICE(iret, iret, iret) 435 #define IRETD CHOICE(iret, iret, iretd) 436 #define JA(a) CHOICE(ja a, ja a, ja a) 437 #define JAE(a) CHOICE(jae a, jae a, jae a) 438 #define JB(a) CHOICE(jb a, jb a, jb a) 439 #define JBE(a) CHOICE(jbe a, jbe a, jbe a) 440 #define JC(a) CHOICE(jc a, jc a, jc a) 441 #define JE(a) CHOICE(je a, je a, je a) 442 #define JG(a) CHOICE(jg a, jg a, jg a) 443 #define JGE(a) CHOICE(jge a, jge a, jge a) 444 #define JL(a) CHOICE(jl a, jl a, jl a) 445 #define JLE(a) CHOICE(jle a, jle a, jle a) 446 #define JNA(a) CHOICE(jna a, jna a, jna a) 447 #define JNAE(a) CHOICE(jnae a, jnae a, jnae a) 448 #define JNB(a) CHOICE(jnb a, jnb a, jnb a) 449 #define JNBE(a) CHOICE(jnbe a, jnbe a, jnbe a) 450 #define JNC(a) CHOICE(jnc a, jnc a, jnc a) 451 #define JNE(a) CHOICE(jne a, jne a, jne a) 452 #define JNG(a) CHOICE(jng a, jng a, jng a) 453 #define JNGE(a) CHOICE(jnge a, jnge a, jnge a) 454 #define JNL(a) CHOICE(jnl a, jnl a, jnl a) 455 #define JNLE(a) CHOICE(jnle a, jnle a, jnle a) 456 #define JNO(a) CHOICE(jno a, jno a, jno a) 457 #define JNP(a) CHOICE(jnp a, jnp a, jnp a) 458 #define JNS(a) CHOICE(jns a, jns a, jns a) 459 #define JNZ(a) CHOICE(jnz a, jnz a, jnz a) 460 #define JO(a) CHOICE(jo a, jo a, jo a) 461 #define JP(a) CHOICE(jp a, jp a, jp a) 462 #define JPE(a) CHOICE(jpe a, jpe a, jpe a) 463 #define JPO(a) CHOICE(jpo a, jpo a, jpo a) 464 #define JS(a) CHOICE(js a, js a, js a) 465 #define JZ(a) CHOICE(jz a, jz a, jz a) 466 #define JMP(a) CHOICE(jmp a, jmp a, jmp a) 467 #define JMPF(s,a) CHOICE(ljmp ARG2(s,a), ljmp ARG2(s,a), jmpf s:a) 468 #define LAHF CHOICE(lahf, lahf, lahf) 460 469 #if !defined(_REAL_MODE) && !defined(_V86_MODE) 461 #define LAR(a, b)CHOICE(lar ARG2(a, b), lar ARG2(a, b), lar ARG2(b, a))470 #define LAR(a, b) CHOICE(lar ARG2(a, b), lar ARG2(a, b), lar ARG2(b, a)) 462 471 #endif 463 #define LEA_L(a, b)CHOICE(leal ARG2(a,b), leal ARG2(a,b), _LTOG lea ARG2(b,a))464 #define LEA_W(a, b)CHOICE(leaw ARG2(a,b), leaw ARG2(a,b), _WTOG lea ARG2(b,a))465 #define LEAVECHOICE(leave, leave, leave)466 #define LGDT(a)CHOICE(lgdt a, lgdt a, lgdt a)467 #define LIDT(a)CHOICE(lidt a, lidt a, lidt a)468 #define LDS(a, b)CHOICE(ldsl ARG2(a,b), lds ARG2(a,b), lds ARG2(b,a))469 #define LES(a, b)CHOICE(lesl ARG2(a,b), les ARG2(a,b), les ARG2(b,a))470 #define LFS(a, b)CHOICE(lfsl ARG2(a,b), lfs ARG2(a,b), lfs ARG2(b,a))471 #define LGS(a, b)CHOICE(lgsl ARG2(a,b), lgs ARG2(a,b), lgs ARG2(b,a))472 #define LSS(a, b)CHOICE(lssl ARG2(a,b), lss ARG2(a,b), lss ARG2(b,a))473 #define LLDT(a)CHOICE(lldt a, lldt a, lldt a)474 #define LMSW(a)CHOICE(lmsw a, lmsw a, lmsw a)475 #define LOCK 476 #define LODS_LCHOICE(lodsl, lodsl, _LTOG lods)477 #define LODS_WCHOICE(lodsw, lodsw, _WTOG lods)478 #define LODS_BCHOICE(lodsb, lodsb, lodsb)479 #define LOOP(a)CHOICE(loop a, loop a, loop a)480 #define LOOPE(a)CHOICE(loope a, loope a, loope a)481 #define LOOPZ(a)CHOICE(loopz a, loopz a, loopz a)482 #define LOOPNE(a)CHOICE(loopne a, loopne a, loopne a)483 #define LOOPNZ(a)CHOICE(loopnz a, loopnz a, loopnz a)472 #define LEA_L(a, b) CHOICE(leal ARG2(a,b), leal ARG2(a,b), _LTOG lea ARG2(b,a)) 473 #define LEA_W(a, b) CHOICE(leaw ARG2(a,b), leaw ARG2(a,b), _WTOG lea ARG2(b,a)) 474 #define LEAVE CHOICE(leave, leave, leave) 475 #define LGDT(a) CHOICE(lgdt a, lgdt a, lgdt a) 476 #define LIDT(a) CHOICE(lidt a, lidt a, lidt a) 477 #define LDS(a, b) CHOICE(ldsl ARG2(a,b), lds ARG2(a,b), lds ARG2(b,a)) 478 #define LES(a, b) CHOICE(lesl ARG2(a,b), les ARG2(a,b), les ARG2(b,a)) 479 #define LFS(a, b) CHOICE(lfsl ARG2(a,b), lfs ARG2(a,b), lfs ARG2(b,a)) 480 #define LGS(a, b) CHOICE(lgsl ARG2(a,b), lgs ARG2(a,b), lgs ARG2(b,a)) 481 #define LSS(a, b) CHOICE(lssl ARG2(a,b), lss ARG2(a,b), lss ARG2(b,a)) 482 #define LLDT(a) CHOICE(lldt a, lldt a, lldt a) 483 #define LMSW(a) CHOICE(lmsw a, lmsw a, lmsw a) 484 #define LOCK CHOICE(lock, lock, lock) 485 #define LODS_L CHOICE(lodsl, lodsl, _LTOG lods) 486 #define LODS_W CHOICE(lodsw, lodsw, _WTOG lods) 487 #define LODS_B CHOICE(lodsb, lodsb, lodsb) 488 #define LOOP(a) CHOICE(loop a, loop a, loop a) 489 #define LOOPE(a) CHOICE(loope a, loope a, loope a) 490 #define LOOPZ(a) CHOICE(loopz a, loopz a, loopz a) 491 #define LOOPNE(a) CHOICE(loopne a, loopne a, loopne a) 492 #define LOOPNZ(a) CHOICE(loopnz a, loopnz a, loopnz a) 484 493 #if !defined(_REAL_MODE) && !defined(_V86_MODE) 485 #define LSL(a, b)CHOICE(lsl ARG2(a,b), lsl ARG2(a,b), lsl ARG2(b,a))494 #define LSL(a, b) CHOICE(lsl ARG2(a,b), lsl ARG2(a,b), lsl ARG2(b,a)) 486 495 #endif 487 #define LTR(a)CHOICE(ltr a, ltr a, ltr a)488 #define MOV_SR(a, b)CHOICE(movw ARG2(a,b), mov ARG2(a,b), mov ARG2(b,a))489 #define MOV_L(a, b)CHOICE(movl ARG2(a,b), movl ARG2(a,b), _LTOG mov ARG2(b,a))490 #define MOV_W(a, b)CHOICE(movw ARG2(a,b), movw ARG2(a,b), _WTOG mov ARG2(b,a))491 #define MOV_B(a, b)CHOICE(movb ARG2(a,b), movb ARG2(a,b), movb ARG2(b,a))492 #define MOVS_LCHOICE(movsl, movsl, _LTOG movs)493 #define MOVS_WCHOICE(movsw, movsw, _WTOG movs)494 #define MOVS_BCHOICE(movsb, movsb, movsb)495 #define MOVSX_BL(a, b)CHOICE(movsbl ARG2(a,b), movsbl ARG2(a,b), movsx ARG2(b,a))496 #define MOVSX_BW(a, b)CHOICE(movsbw ARG2(a,b), movsbw ARG2(a,b), movsx ARG2(b,a))497 #define MOVSX_WL(a, b)CHOICE(movswl ARG2(a,b), movswl ARG2(a,b), movsx ARG2(b,a))498 #define MOVZX_BL(a, b)CHOICE(movzbl ARG2(a,b), movzbl ARG2(a,b), movzx ARG2(b,a))499 #define MOVZX_BW(a, b)CHOICE(movzbw ARG2(a,b), movzbw ARG2(a,b), movzx ARG2(b,a))500 #define MOVZX_WL(a, b)CHOICE(movzwl ARG2(a,b), movzwl ARG2(a,b), movzx ARG2(b,a))501 #define MUL_L(a)CHOICE(mull a, mull a, _LTOG mul a)502 #define MUL_W(a)CHOICE(mulw a, mulw a, _WTOG mul a)503 #define MUL_B(a)CHOICE(mulb a, mulb a, mulb a)504 #define NEG_L(a)CHOICE(negl a, negl a, _LTOG neg a)505 #define NEG_W(a)CHOICE(negw a, negw a, _WTOG neg a)506 #define NEG_B(a)CHOICE(negb a, negb a, negb a)507 #define NOPCHOICE(nop, nop, nop)508 #define NOT_L(a)CHOICE(notl a, notl a, _LTOG not a)509 #define NOT_W(a)CHOICE(notw a, notw a, _WTOG not a)510 #define NOT_B(a)CHOICE(notb a, notb a, notb a)511 #define OR_L(a,b)CHOICE(orl ARG2(a,b), orl ARG2(a,b), _LTOG or ARG2(b,a))512 #define OR_W(a,b)CHOICE(orw ARG2(a,b), orw ARG2(a,b), _WTOG or ARG2(b,a))513 #define OR_B(a,b)CHOICE(orb ARG2(a,b), orb ARG2(a,b), orb ARG2(b,a))514 #define OUT_LCHOICE(outl (DX), outl ARG2(EAX,DX), _LTOG out DX)515 #define OUT_WCHOICE(outw (DX), outw ARG2(AX,DX), _WTOG out DX)516 #define OUT_BCHOICE(outb (DX), outb ARG2(AL,DX), outb DX)496 #define LTR(a) CHOICE(ltr a, ltr a, ltr a) 497 #define MOV_SR(a, b) CHOICE(movw ARG2(a,b), mov ARG2(a,b), mov ARG2(b,a)) 498 #define MOV_L(a, b) CHOICE(movl ARG2(a,b), movl ARG2(a,b), _LTOG mov ARG2(b,a)) 499 #define MOV_W(a, b) CHOICE(movw ARG2(a,b), movw ARG2(a,b), _WTOG mov ARG2(b,a)) 500 #define MOV_B(a, b) CHOICE(movb ARG2(a,b), movb ARG2(a,b), movb ARG2(b,a)) 501 #define MOVS_L CHOICE(movsl, movsl, _LTOG movs) 502 #define MOVS_W CHOICE(movsw, movsw, _WTOG movs) 503 #define MOVS_B CHOICE(movsb, movsb, movsb) 504 #define MOVSX_BL(a, b) CHOICE(movsbl ARG2(a,b), movsbl ARG2(a,b), movsx ARG2(b,a)) 505 #define MOVSX_BW(a, b) CHOICE(movsbw ARG2(a,b), movsbw ARG2(a,b), movsx ARG2(b,a)) 506 #define MOVSX_WL(a, b) CHOICE(movswl ARG2(a,b), movswl ARG2(a,b), movsx ARG2(b,a)) 507 #define MOVZX_BL(a, b) CHOICE(movzbl ARG2(a,b), movzbl ARG2(a,b), movzx ARG2(b,a)) 508 #define MOVZX_BW(a, b) CHOICE(movzbw ARG2(a,b), movzbw ARG2(a,b), movzx ARG2(b,a)) 509 #define MOVZX_WL(a, b) CHOICE(movzwl ARG2(a,b), movzwl ARG2(a,b), movzx ARG2(b,a)) 510 #define MUL_L(a) CHOICE(mull a, mull a, _LTOG mul a) 511 #define MUL_W(a) CHOICE(mulw a, mulw a, _WTOG mul a) 512 #define MUL_B(a) CHOICE(mulb a, mulb a, mulb a) 513 #define NEG_L(a) CHOICE(negl a, negl a, _LTOG neg a) 514 #define NEG_W(a) CHOICE(negw a, negw a, _WTOG neg a) 515 #define NEG_B(a) CHOICE(negb a, negb a, negb a) 516 #define NOP CHOICE(nop, nop, nop) 517 #define NOT_L(a) CHOICE(notl a, notl a, _LTOG not a) 518 #define NOT_W(a) CHOICE(notw a, notw a, _WTOG not a) 519 #define NOT_B(a) CHOICE(notb a, notb a, notb a) 520 #define OR_L(a,b) CHOICE(orl ARG2(a,b), orl ARG2(a,b), _LTOG or ARG2(b,a)) 521 #define OR_W(a,b) CHOICE(orw ARG2(a,b), orw ARG2(a,b), _WTOG or ARG2(b,a)) 522 #define OR_B(a,b) CHOICE(orb ARG2(a,b), orb ARG2(a,b), orb ARG2(b,a)) 523 #define OUT_L CHOICE(outl (DX), outl ARG2(EAX,DX), _LTOG out DX) 524 #define OUT_W CHOICE(outw (DX), outw ARG2(AX,DX), _WTOG out DX) 525 #define OUT_B CHOICE(outb (DX), outb ARG2(AL,DX), outb DX) 517 526 /* Please AS code writer: use the following ONLY, if you refer to ports<256 518 527 * directly, but not in OUT1_W(DX), for instance, even if OUT1_ looks nicer 519 528 */ 520 #define OUT1_L(a)CHOICE(outl (a), outl ARG2(EAX,a), _LTOG out a)521 #define OUT1_W(a)CHOICE(outw (a), outw ARG2(AX,a), _WTOG out a)522 #define OUT1_B(a)CHOICE(outb (a), outb ARG2(AL,a), outb a)523 #define OUTS_LCHOICE(outsl, outsl, _LTOG outs)524 #define OUTS_WCHOICE(outsw, outsw, _WTOG outs)525 #define OUTS_BCHOICE(outsb, outsb, outsb)526 #define POP_SR(a)CHOICE(pop a, pop a, pop a)527 #define POP_L(a)CHOICE(popl a, popl a, _LTOG pop a)528 #define POP_W(a)CHOICE(popw a, popw a, _WTOG pop a)529 #define POPA_LCHOICE(popal, popal, _LTOG popa)530 #define POPA_WCHOICE(popaw, popaw, _WTOG popa)531 #define POPF_LCHOICE(popfl, popfl, _LTOG popf)532 #define POPF_WCHOICE(popfw, popfw, _WTOG popf)533 #define PUSH_SR(a)CHOICE(push a, push a, push a)534 #define PUSH_L(a)CHOICE(pushl a, pushl a, _LTOG push a)535 #define PUSH_W(a)CHOICE(pushw a, pushw a, _WTOG push a)536 #define PUSH_B(a)CHOICE(push a, pushb a, push a)537 #define PUSHA_LCHOICE(pushal, pushal, _LTOG pusha)538 #define PUSHA_WCHOICE(pushaw, pushaw, _WTOG pusha)539 #define PUSHF_LCHOICE(pushfl, pushfl, _LTOG pushf)540 #define PUSHF_WCHOICE(pushfw, pushfw, _WTOG pushf)541 #define RCL_L(a, b)CHOICE(rcll ARG2(a,b), rcll ARG2(a,b), _LTOG rcl ARG2(b,a))542 #define RCL_W(a, b)CHOICE(rclw ARG2(a,b), rclw ARG2(a,b), _WTOG rcl ARG2(b,a))543 #define RCL_B(a, b)CHOICE(rclb ARG2(a,b), rclb ARG2(a,b), rclb ARG2(b,a))544 #define RCR_L(a, b)CHOICE(rcrl ARG2(a,b), rcrl ARG2(a,b), _LTOG rcr ARG2(b,a))545 #define RCR_W(a, b)CHOICE(rcrw ARG2(a,b), rcrw ARG2(a,b), _WTOG rcr ARG2(b,a))546 #define RCR_B(a, b)CHOICE(rcrb ARG2(a,b), rcrb ARG2(a,b), rcrb ARG2(b,a))547 #define ROL_L(a, b)CHOICE(roll ARG2(a,b), roll ARG2(a,b), _LTOG rol ARG2(b,a))548 #define ROL_W(a, b)CHOICE(rolw ARG2(a,b), rolw ARG2(a,b), _WTOG rol ARG2(b,a))549 #define ROL_B(a, b)CHOICE(rolb ARG2(a,b), rolb ARG2(a,b), rolb ARG2(b,a))550 #define ROR_L(a, b)CHOICE(rorl ARG2(a,b), rorl ARG2(a,b), _LTOG ror ARG2(b,a))551 #define ROR_W(a, b)CHOICE(rorw ARG2(a,b), rorw ARG2(a,b), _WTOG ror ARG2(b,a))552 #define ROR_B(a, b)CHOICE(rorb ARG2(a,b), rorb ARG2(a,b), rorb ARG2(b,a))553 #define REPCHOICE(rep ;, rep ;, repe)554 #define REPECHOICE(repz ;, repe ;, repe)555 #define REPNECHOICE(repnz ;, repne ;, repne)556 #define REPNZREPNE557 #define REPZREPE558 #define RETCHOICE(ret, ret, ret)559 #define SAHFCHOICE(sahf, sahf, sahf)560 #define SAL_L(a, b)CHOICE(sall ARG2(a,b), sall ARG2(a,b), _LTOG sal ARG2(b,a))561 #define SAL_W(a, b)CHOICE(salw ARG2(a,b), salw ARG2(a,b), _WTOG sal ARG2(b,a))562 #define SAL_B(a, b)CHOICE(salb ARG2(a,b), salb ARG2(a,b), salb ARG2(b,a))563 #define SAR_L(a, b)CHOICE(sarl ARG2(a,b), sarl ARG2(a,b), _LTOG sar ARG2(b,a))564 #define SAR_W(a, b)CHOICE(sarw ARG2(a,b), sarw ARG2(a,b), _WTOG sar ARG2(b,a))565 #define SAR_B(a, b)CHOICE(sarb ARG2(a,b), sarb ARG2(a,b), sarb ARG2(b,a))566 #define SBB_L(a, b)CHOICE(sbbl ARG2(a,b), sbbl ARG2(a,b), _LTOG sbb ARG2(b,a))567 #define SBB_W(a, b)CHOICE(sbbw ARG2(a,b), sbbw ARG2(a,b), _WTOG sbb ARG2(b,a))568 #define SBB_B(a, b)CHOICE(sbbb ARG2(a,b), sbbb ARG2(a,b), sbbb ARG2(b,a))569 #define SCAS_LCHOICE(scasl, scasl, _LTOG scas)570 #define SCAS_WCHOICE(scasw, scasw, _WTOG scas)571 #define SCAS_BCHOICE(scasb, scasb, scasb)572 #define SETA(a)CHOICE(seta a, seta a, seta a)573 #define SETAE(a)CHOICE(setae a, setae a, setae a)574 #define SETB(a)CHOICE(setb a, setb a, setb a)575 #define SETBE(a)CHOICE(setbe a, setbe a, setbe a)576 #define SETC(a)CHOICE(setc a, setb a, setb a)577 #define SETE(a)CHOICE(sete a, sete a, sete a)578 #define SETG(a)CHOICE(setg a, setg a, setg a)579 #define SETGE(a)CHOICE(setge a, setge a, setge a)580 #define SETL(a)CHOICE(setl a, setl a, setl a)581 #define SETLE(a)CHOICE(setle a, setle a, setle a)582 #define SETNA(a)CHOICE(setna a, setna a, setna a)583 #define SETNAE(a)CHOICE(setnae a, setnae a, setnae a)584 #define SETNB(a)CHOICE(setnb a, setnb a, setnb a)585 #define SETNBE(a)CHOICE(setnbe a, setnbe a, setnbe a)586 #define SETNC(a)CHOICE(setnc a, setnb a, setnb a)587 #define SETNE(a)CHOICE(setne a, setne a, setne a)588 #define SETNG(a)CHOICE(setng a, setng a, setng a)589 #define SETNGE(a)CHOICE(setnge a, setnge a, setnge a)590 #define SETNL(a)CHOICE(setnl a, setnl a, setnl a)591 #define SETNLE(a)CHOICE(setnle a, setnle a, setnle a)592 #define SETNO(a)CHOICE(setno a, setno a, setno a)593 #define SETNP(a)CHOICE(setnp a, setnp a, setnp a)594 #define SETNS(a)CHOICE(setns a, setns a, setna a)595 #define SETNZ(a)CHOICE(setnz a, setnz a, setnz a)596 #define SETO(a)CHOICE(seto a, seto a, seto a)597 #define SETP(a)CHOICE(setp a, setp a, setp a)598 #define SETPE(a)CHOICE(setpe a, setpe a, setpe a)599 #define SETPO(a)CHOICE(setpo a, setpo a, setpo a)600 #define SETS(a)CHOICE(sets a, sets a, seta a)601 #define SETZ(a)CHOICE(setz a, setz a, setz a)602 #define SGDT(a)CHOICE(sgdt a, sgdt a, sgdt a)603 #define SIDT(a)CHOICE(sidt a, sidt a, sidt a)604 #define SHL_L(a, b)CHOICE(shll ARG2(a,b), shll ARG2(a,b), _LTOG shl ARG2(b,a))605 #define SHL_W(a, b)CHOICE(shlw ARG2(a,b), shlw ARG2(a,b), _WTOG shl ARG2(b,a))606 #define SHL_B(a, b)CHOICE(shlb ARG2(a,b), shlb ARG2(a,b), shlb ARG2(b,a))607 #define SHLD_L(a,b,c)CHOICE(shldl ARG3(a,b,c), shldl ARG3(a,b,c), _LTOG shld ARG3(c,b,a))608 #define SHLD2_L(a,b)CHOICE(shldl ARG2(a,b), shldl ARG3(CL,a,b), _LTOG shld ARG3(b,a,CL))609 #define SHLD_W(a,b,c)CHOICE(shldw ARG3(a,b,c), shldw ARG3(a,b,c), _WTOG shld ARG3(c,b,a))610 #define SHLD2_W(a,b)CHOICE(shldw ARG2(a,b), shldw ARG3(CL,a,b), _WTOG shld ARG3(b,a,CL))611 #define SHR_L(a, b)CHOICE(shrl ARG2(a,b), shrl ARG2(a,b), _LTOG shr ARG2(b,a))612 #define SHR_W(a, b)CHOICE(shrw ARG2(a,b), shrw ARG2(a,b), _WTOG shr ARG2(b,a))613 #define SHR_B(a, b)CHOICE(shrb ARG2(a,b), shrb ARG2(a,b), shrb ARG2(b,a))614 #define SHRD_L(a,b,c)CHOICE(shrdl ARG3(a,b,c), shrdl ARG3(a,b,c), _LTOG shrd ARG3(c,b,a))615 #define SHRD2_L(a,b)CHOICE(shrdl ARG2(a,b), shrdl ARG3(CL,a,b), _LTOG shrd ARG3(b,a,CL))616 #define SHRD_W(a,b,c)CHOICE(shrdw ARG3(a,b,c), shrdw ARG3(a,b,c), _WTOG shrd ARG3(c,b,a))617 #define SHRD2_W(a,b)CHOICE(shrdw ARG2(a,b), shrdw ARG3(CL,a,b), _WTOG shrd ARG3(b,a,CL))618 #define SLDT(a)CHOICE(sldt a, sldt a, sldt a)619 #define SMSW(a)CHOICE(smsw a, smsw a, smsw a)620 #define STCCHOICE(stc, stc, stc)621 #define STDCHOICE(std, std, std)622 #define STICHOICE(sti, sti, sti)623 #define STOS_LCHOICE(stosl, stosl, _LTOG stos)624 #define STOS_WCHOICE(stosw, stosw, _WTOG stos)625 #define STOS_BCHOICE(stosb, stosb, stosb)626 #define STR(a)CHOICE(str a, str a, str a)627 #define SUB_L(a, b)CHOICE(subl ARG2(a,b), subl ARG2(a,b), _LTOG sub ARG2(b,a))628 #define SUB_W(a, b)CHOICE(subw ARG2(a,b), subw ARG2(a,b), _WTOG sub ARG2(b,a))629 #define SUB_B(a, b)CHOICE(subb ARG2(a,b), subb ARG2(a,b), subb ARG2(b,a))630 #define TEST_L(a, b)CHOICE(testl ARG2(a,b), testl ARG2(a,b), _LTOG test ARG2(b,a))631 #define TEST_W(a, b)CHOICE(testw ARG2(a,b), testw ARG2(a,b), _WTOG test ARG2(b,a))632 #define TEST_B(a, b)CHOICE(testb ARG2(a,b), testb ARG2(a,b), testb ARG2(b,a))633 #define VERR(a)CHOICE(verr a, verr a, verr a)634 #define VERW(a)CHOICE(verw a, verw a, verw a)635 #define WAITCHOICE(wait, wait, wait)636 #define XCHG_L(a, b)CHOICE(xchgl ARG2(a,b), xchgl ARG2(a,b), _LTOG xchg ARG2(b,a))637 #define XCHG_W(a, b)CHOICE(xchgw ARG2(a,b), xchgw ARG2(a,b), _WTOG xchg ARG2(b,a))638 #define XCHG_B(a, b)CHOICE(xchgb ARG2(a,b), xchgb ARG2(a,b), xchgb ARG2(b,a))639 #define XLATCHOICE(xlat, xlat, xlat)640 #define XOR_L(a, b)CHOICE(xorl ARG2(a,b), xorl ARG2(a,b), _LTOG xor ARG2(b,a))641 #define XOR_W(a, b)CHOICE(xorw ARG2(a,b), xorw ARG2(a,b), _WTOG xor ARG2(b,a))642 #define XOR_B(a, b)CHOICE(xorb ARG2(a,b), xorb ARG2(a,b), xorb ARG2(b,a))529 #define OUT1_L(a) CHOICE(outl (a), outl ARG2(EAX,a), _LTOG out a) 530 #define OUT1_W(a) CHOICE(outw (a), outw ARG2(AX,a), _WTOG out a) 531 #define OUT1_B(a) CHOICE(outb (a), outb ARG2(AL,a), outb a) 532 #define OUTS_L CHOICE(outsl, outsl, _LTOG outs) 533 #define OUTS_W CHOICE(outsw, outsw, _WTOG outs) 534 #define OUTS_B CHOICE(outsb, outsb, outsb) 535 #define POP_SR(a) CHOICE(pop a, pop a, pop a) 536 #define POP_L(a) CHOICE(popl a, popl a, _LTOG pop a) 537 #define POP_W(a) CHOICE(popw a, popw a, _WTOG pop a) 538 #define POPA_L CHOICE(popal, popal, _LTOG popa) 539 #define POPA_W CHOICE(popaw, popaw, _WTOG popa) 540 #define POPF_L CHOICE(popfl, popfl, _LTOG popf) 541 #define POPF_W CHOICE(popfw, popfw, _WTOG popf) 542 #define PUSH_SR(a) CHOICE(push a, push a, push a) 543 #define PUSH_L(a) CHOICE(pushl a, pushl a, _LTOG push a) 544 #define PUSH_W(a) CHOICE(pushw a, pushw a, _WTOG push a) 545 #define PUSH_B(a) CHOICE(push a, pushb a, push a) 546 #define PUSHA_L CHOICE(pushal, pushal, _LTOG pusha) 547 #define PUSHA_W CHOICE(pushaw, pushaw, _WTOG pusha) 548 #define PUSHF_L CHOICE(pushfl, pushfl, _LTOG pushf) 549 #define PUSHF_W CHOICE(pushfw, pushfw, _WTOG pushf) 550 #define RCL_L(a, b) CHOICE(rcll ARG2(a,b), rcll ARG2(a,b), _LTOG rcl ARG2(b,a)) 551 #define RCL_W(a, b) CHOICE(rclw ARG2(a,b), rclw ARG2(a,b), _WTOG rcl ARG2(b,a)) 552 #define RCL_B(a, b) CHOICE(rclb ARG2(a,b), rclb ARG2(a,b), rclb ARG2(b,a)) 553 #define RCR_L(a, b) CHOICE(rcrl ARG2(a,b), rcrl ARG2(a,b), _LTOG rcr ARG2(b,a)) 554 #define RCR_W(a, b) CHOICE(rcrw ARG2(a,b), rcrw ARG2(a,b), _WTOG rcr ARG2(b,a)) 555 #define RCR_B(a, b) CHOICE(rcrb ARG2(a,b), rcrb ARG2(a,b), rcrb ARG2(b,a)) 556 #define ROL_L(a, b) CHOICE(roll ARG2(a,b), roll ARG2(a,b), _LTOG rol ARG2(b,a)) 557 #define ROL_W(a, b) CHOICE(rolw ARG2(a,b), rolw ARG2(a,b), _WTOG rol ARG2(b,a)) 558 #define ROL_B(a, b) CHOICE(rolb ARG2(a,b), rolb ARG2(a,b), rolb ARG2(b,a)) 559 #define ROR_L(a, b) CHOICE(rorl ARG2(a,b), rorl ARG2(a,b), _LTOG ror ARG2(b,a)) 560 #define ROR_W(a, b) CHOICE(rorw ARG2(a,b), rorw ARG2(a,b), _WTOG ror ARG2(b,a)) 561 #define ROR_B(a, b) CHOICE(rorb ARG2(a,b), rorb ARG2(a,b), rorb ARG2(b,a)) 562 #define REP CHOICE(rep ;, rep ;, repe) 563 #define REPE CHOICE(repz ;, repe ;, repe) 564 #define REPNE CHOICE(repnz ;, repne ;, repne) 565 #define REPNZ REPNE 566 #define REPZ REPE 567 #define RET CHOICE(ret, ret, ret) 568 #define SAHF CHOICE(sahf, sahf, sahf) 569 #define SAL_L(a, b) CHOICE(sall ARG2(a,b), sall ARG2(a,b), _LTOG sal ARG2(b,a)) 570 #define SAL_W(a, b) CHOICE(salw ARG2(a,b), salw ARG2(a,b), _WTOG sal ARG2(b,a)) 571 #define SAL_B(a, b) CHOICE(salb ARG2(a,b), salb ARG2(a,b), salb ARG2(b,a)) 572 #define SAR_L(a, b) CHOICE(sarl ARG2(a,b), sarl ARG2(a,b), _LTOG sar ARG2(b,a)) 573 #define SAR_W(a, b) CHOICE(sarw ARG2(a,b), sarw ARG2(a,b), _WTOG sar ARG2(b,a)) 574 #define SAR_B(a, b) CHOICE(sarb ARG2(a,b), sarb ARG2(a,b), sarb ARG2(b,a)) 575 #define SBB_L(a, b) CHOICE(sbbl ARG2(a,b), sbbl ARG2(a,b), _LTOG sbb ARG2(b,a)) 576 #define SBB_W(a, b) CHOICE(sbbw ARG2(a,b), sbbw ARG2(a,b), _WTOG sbb ARG2(b,a)) 577 #define SBB_B(a, b) CHOICE(sbbb ARG2(a,b), sbbb ARG2(a,b), sbbb ARG2(b,a)) 578 #define SCAS_L CHOICE(scasl, scasl, _LTOG scas) 579 #define SCAS_W CHOICE(scasw, scasw, _WTOG scas) 580 #define SCAS_B CHOICE(scasb, scasb, scasb) 581 #define SETA(a) CHOICE(seta a, seta a, seta a) 582 #define SETAE(a) CHOICE(setae a, setae a, setae a) 583 #define SETB(a) CHOICE(setb a, setb a, setb a) 584 #define SETBE(a) CHOICE(setbe a, setbe a, setbe a) 585 #define SETC(a) CHOICE(setc a, setb a, setb a) 586 #define SETE(a) CHOICE(sete a, sete a, sete a) 587 #define SETG(a) CHOICE(setg a, setg a, setg a) 588 #define SETGE(a) CHOICE(setge a, setge a, setge a) 589 #define SETL(a) CHOICE(setl a, setl a, setl a) 590 #define SETLE(a) CHOICE(setle a, setle a, setle a) 591 #define SETNA(a) CHOICE(setna a, setna a, setna a) 592 #define SETNAE(a) CHOICE(setnae a, setnae a, setnae a) 593 #define SETNB(a) CHOICE(setnb a, setnb a, setnb a) 594 #define SETNBE(a) CHOICE(setnbe a, setnbe a, setnbe a) 595 #define SETNC(a) CHOICE(setnc a, setnb a, setnb a) 596 #define SETNE(a) CHOICE(setne a, setne a, setne a) 597 #define SETNG(a) CHOICE(setng a, setng a, setng a) 598 #define SETNGE(a) CHOICE(setnge a, setnge a, setnge a) 599 #define SETNL(a) CHOICE(setnl a, setnl a, setnl a) 600 #define SETNLE(a) CHOICE(setnle a, setnle a, setnle a) 601 #define SETNO(a) CHOICE(setno a, setno a, setno a) 602 #define SETNP(a) CHOICE(setnp a, setnp a, setnp a) 603 #define SETNS(a) CHOICE(setns a, setns a, setna a) 604 #define SETNZ(a) CHOICE(setnz a, setnz a, setnz a) 605 #define SETO(a) CHOICE(seto a, seto a, seto a) 606 #define SETP(a) CHOICE(setp a, setp a, setp a) 607 #define SETPE(a) CHOICE(setpe a, setpe a, setpe a) 608 #define SETPO(a) CHOICE(setpo a, setpo a, setpo a) 609 #define SETS(a) CHOICE(sets a, sets a, seta a) 610 #define SETZ(a) CHOICE(setz a, setz a, setz a) 611 #define SGDT(a) CHOICE(sgdt a, sgdt a, sgdt a) 612 #define SIDT(a) CHOICE(sidt a, sidt a, sidt a) 613 #define SHL_L(a, b) CHOICE(shll ARG2(a,b), shll ARG2(a,b), _LTOG shl ARG2(b,a)) 614 #define SHL_W(a, b) CHOICE(shlw ARG2(a,b), shlw ARG2(a,b), _WTOG shl ARG2(b,a)) 615 #define SHL_B(a, b) CHOICE(shlb ARG2(a,b), shlb ARG2(a,b), shlb ARG2(b,a)) 616 #define SHLD_L(a,b,c) CHOICE(shldl ARG3(a,b,c), shldl ARG3(a,b,c), _LTOG shld ARG3(c,b,a)) 617 #define SHLD2_L(a,b) CHOICE(shldl ARG2(a,b), shldl ARG3(CL,a,b), _LTOG shld ARG3(b,a,CL)) 618 #define SHLD_W(a,b,c) CHOICE(shldw ARG3(a,b,c), shldw ARG3(a,b,c), _WTOG shld ARG3(c,b,a)) 619 #define SHLD2_W(a,b) CHOICE(shldw ARG2(a,b), shldw ARG3(CL,a,b), _WTOG shld ARG3(b,a,CL)) 620 #define SHR_L(a, b) CHOICE(shrl ARG2(a,b), shrl ARG2(a,b), _LTOG shr ARG2(b,a)) 621 #define SHR_W(a, b) CHOICE(shrw ARG2(a,b), shrw ARG2(a,b), _WTOG shr ARG2(b,a)) 622 #define SHR_B(a, b) CHOICE(shrb ARG2(a,b), shrb ARG2(a,b), shrb ARG2(b,a)) 623 #define SHRD_L(a,b,c) CHOICE(shrdl ARG3(a,b,c), shrdl ARG3(a,b,c), _LTOG shrd ARG3(c,b,a)) 624 #define SHRD2_L(a,b) CHOICE(shrdl ARG2(a,b), shrdl ARG3(CL,a,b), _LTOG shrd ARG3(b,a,CL)) 625 #define SHRD_W(a,b,c) CHOICE(shrdw ARG3(a,b,c), shrdw ARG3(a,b,c), _WTOG shrd ARG3(c,b,a)) 626 #define SHRD2_W(a,b) CHOICE(shrdw ARG2(a,b), shrdw ARG3(CL,a,b), _WTOG shrd ARG3(b,a,CL)) 627 #define SLDT(a) CHOICE(sldt a, sldt a, sldt a) 628 #define SMSW(a) CHOICE(smsw a, smsw a, smsw a) 629 #define STC CHOICE(stc, stc, stc) 630 #define STD CHOICE(std, std, std) 631 #define STI CHOICE(sti, sti, sti) 632 #define STOS_L CHOICE(stosl, stosl, _LTOG stos) 633 #define STOS_W CHOICE(stosw, stosw, _WTOG stos) 634 #define STOS_B CHOICE(stosb, stosb, stosb) 635 #define STR(a) CHOICE(str a, str a, str a) 636 #define SUB_L(a, b) CHOICE(subl ARG2(a,b), subl ARG2(a,b), _LTOG sub ARG2(b,a)) 637 #define SUB_W(a, b) CHOICE(subw ARG2(a,b), subw ARG2(a,b), _WTOG sub ARG2(b,a)) 638 #define SUB_B(a, b) CHOICE(subb ARG2(a,b), subb ARG2(a,b), subb ARG2(b,a)) 639 #define TEST_L(a, b) CHOICE(testl ARG2(a,b), testl ARG2(a,b), _LTOG test ARG2(b,a)) 640 #define TEST_W(a, b) CHOICE(testw ARG2(a,b), testw ARG2(a,b), _WTOG test ARG2(b,a)) 641 #define TEST_B(a, b) CHOICE(testb ARG2(a,b), testb ARG2(a,b), testb ARG2(b,a)) 642 #define VERR(a) CHOICE(verr a, verr a, verr a) 643 #define VERW(a) CHOICE(verw a, verw a, verw a) 644 #define WAIT CHOICE(wait, wait, wait) 645 #define XCHG_L(a, b) CHOICE(xchgl ARG2(a,b), xchgl ARG2(a,b), _LTOG xchg ARG2(b,a)) 646 #define XCHG_W(a, b) CHOICE(xchgw ARG2(a,b), xchgw ARG2(a,b), _WTOG xchg ARG2(b,a)) 647 #define XCHG_B(a, b) CHOICE(xchgb ARG2(a,b), xchgb ARG2(a,b), xchgb ARG2(b,a)) 648 #define XLAT CHOICE(xlat, xlat, xlat) 649 #define XOR_L(a, b) CHOICE(xorl ARG2(a,b), xorl ARG2(a,b), _LTOG xor ARG2(b,a)) 650 #define XOR_W(a, b) CHOICE(xorw ARG2(a,b), xorw ARG2(a,b), _WTOG xor ARG2(b,a)) 651 #define XOR_B(a, b) CHOICE(xorb ARG2(a,b), xorb ARG2(a,b), xorb ARG2(b,a)) 643 652 644 653 645 654 /* Floating Point Instructions */ 646 #define F2XM1CHOICE(f2xm1, f2xm1, f2xm1)647 #define FABSCHOICE(fabs, fabs, fabs)648 #define FADD_D(a)CHOICE(faddl a, faddl a, faddd a)649 #define FADD_S(a)CHOICE(fadds a, fadds a, fadds a)650 #define FADD2(a, b)CHOICE(fadd ARG2(a,b), fadd ARG2(a,b), fadd ARG2(b,a))651 #define FADDP(a, b)CHOICE(faddp ARG2(a,b), faddp ARG2(a,b), faddp ARG2(b,a))652 #define FIADD_L(a)CHOICE(fiaddl a, fiaddl a, fiaddl a)653 #define FIADD_W(a)CHOICE(fiadd a, fiadds a, fiadds a)654 #define FBLD(a)CHOICE(fbld a, fbld a, fbld a)655 #define FBSTP(a)CHOICE(fbstp a, fbstp a, fbstp a)656 #define FCHSCHOICE(fchs, fchs, fchs)657 #define FCLEXCHOICE(fclex, wait; fnclex, wait; fclex)658 #define FNCLEXCHOICE(fnclex, fnclex, fclex)659 #define FCOM(a)CHOICE(fcom a, fcom a, fcom a)660 #define FCOM_D(a)CHOICE(fcoml a, fcoml a, fcomd a)661 #define FCOM_S(a)CHOICE(fcoms a, fcoms a, fcoms a)662 #define FCOMP(a)CHOICE(fcomp a, fcomp a, fcomp a)663 #define FCOMP_D(a)CHOICE(fcompl a, fcompl a, fcompd a)664 #define FCOMP_S(a)CHOICE(fcomps a, fcomps a, fcomps a)665 #define FCOMPPCHOICE(fcompp, fcompp, fcompp)666 #define FCOSCHOICE(fcos, fcos, fcos)667 #define FDECSTPCHOICE(fdecstp, fdecstp, fdecstp)668 #define FDIV_D(a)CHOICE(fdivl a, fdivl a, fdivd a)669 #define FDIV_S(a)CHOICE(fdivs a, fdivs a, fdivs a)670 #define FDIV2(a, b)CHOICE(fdiv ARG2(a,b), fdiv ARG2(a,b), fdiv ARG2(b,a))671 #define FDIVP(a, b)CHOICE(fdivp ARG2(a,b), fdivp ARG2(a,b), fdivp ARG2(b,a))672 #define FIDIV_L(a)CHOICE(fidivl a, fidivl a, fidivl a)673 #define FIDIV_W(a)CHOICE(fidiv a, fidivs a, fidivs a)674 #define FDIVR_D(a)CHOICE(fdivrl a, fdivrl a, fdivrd a)675 #define FDIVR_S(a)CHOICE(fdivrs a, fdivrs a, fdivrs a)676 #define FDIVR2(a, b)CHOICE(fdivr ARG2(a,b), fdivr ARG2(a,b), fdivr ARG2(b,a))677 #define FDIVRP(a, b)CHOICE(fdivrp ARG2(a,b), fdivrp ARG2(a,b), fdivrp ARG2(b,a))678 #define FIDIVR_L(a)CHOICE(fidivrl a, fidivrl a, fidivrl a)679 #define FIDIVR_W(a)CHOICE(fidivr a, fidivrs a, fidivrs a)680 #define FFREE(a)CHOICE(ffree a, ffree a, ffree a)681 #define FICOM_L(a)CHOICE(ficoml a, ficoml a, ficoml a)682 #define FICOM_W(a)CHOICE(ficom a, ficoms a, ficoms a)683 #define FICOMP_L(a)CHOICE(ficompl a, ficompl a, ficompl a)684 #define FICOMP_W(a)CHOICE(ficomp a, ficomps a, ficomps a)685 #define FILD_Q(a)CHOICE(fildll a, fildq a, fildq a)686 #define FILD_L(a)CHOICE(fildl a, fildl a, fildl a)687 #define FILD_W(a)CHOICE(fild a, filds a, filds a)688 #define FINCSTPCHOICE(fincstp, fincstp, fincstp)689 #define FINITCHOICE(finit, wait; fninit, wait; finit)690 #define FNINITCHOICE(fninit, fninit, finit)691 #define FIST_L(a)CHOICE(fistl a, fistl a, fistl a)692 #define FIST_W(a)CHOICE(fist a, fists a, fists a)693 #define FISTP_Q(a)CHOICE(fistpll a, fistpq a, fistpq a)694 #define FISTP_L(a)CHOICE(fistpl a, fistpl a, fistpl a)695 #define FISTP_W(a)CHOICE(fistp a, fistps a, fistps a)696 #define FLD_X(a)CHOICE(fldt a, fldt a, fldx a) /* 80 bit data type! */697 #define FLD_D(a)CHOICE(fldl a, fldl a, fldd a)698 #define FLD_S(a)CHOICE(flds a, flds a, flds a)699 #define FLD1CHOICE(fld1, fld1, fld1)700 #define FLDL2TCHOICE(fldl2t, fldl2t, fldl2t)701 #define FLDL2ECHOICE(fldl2e, fldl2e, fldl2e)702 #define FLDPICHOICE(fldpi, fldpi, fldpi)703 #define FLDLG2CHOICE(fldlg2, fldlg2, fldlg2)704 #define FLDLN2CHOICE(fldln2, fldln2, fldln2)705 #define FLDZCHOICE(fldz, fldz, fldz)706 #define FLDCW(a)CHOICE(fldcw a, fldcw a, fldcw a)707 #define FLDENV(a)CHOICE(fldenv a, fldenv a, fldenv a)708 #define FMUL_S(a)CHOICE(fmuls a, fmuls a, fmuls a)709 #define FMUL_D(a)CHOICE(fmull a, fmull a, fmuld a)710 #define FMUL2(a, b)CHOICE(fmul ARG2(a,b), fmul ARG2(a,b), fmul ARG2(b,a))711 #define FMULP(a, b)CHOICE(fmulp ARG2(a,b), fmulp ARG2(a,b), fmulp ARG2(b,a))712 #define FIMUL_L(a)CHOICE(fimull a, fimull a, fimull a)713 #define FIMUL_W(a)CHOICE(fimul a, fimuls a, fimuls a)714 #define FNOPCHOICE(fnop, fnop, fnop)715 #define FPATANCHOICE(fpatan, fpatan, fpatan)716 #define FPREMCHOICE(fprem, fprem, fprem)717 #define FPREM1CHOICE(fprem1, fprem1, fprem1)718 #define FPTANCHOICE(fptan, fptan, fptan)719 #define FRNDINTCHOICE(frndint, frndint, frndint)720 #define FRSTOR(a)CHOICE(frstor a, frstor a, frstor a)721 #define FSAVE(a)CHOICE(fsave a, wait; fnsave a, wait; fsave a)722 #define FNSAVE(a)CHOICE(fnsave a, fnsave a, fsave a)723 #define FSCALECHOICE(fscale, fscale, fscale)724 #define FSINCHOICE(fsin, fsin, fsin)725 #define FSINCOSCHOICE(fsincos, fsincos, fsincos)726 #define FSQRTCHOICE(fsqrt, fsqrt, fsqrt)727 #define FST_D(a)CHOICE(fstl a, fstl a, fstd a)728 #define FST_S(a)CHOICE(fsts a, fsts a, fsts a)729 #define FSTP_X(a)CHOICE(fstpt a, fstpt a, fstpx a)730 #define FSTP_D(a)CHOICE(fstpl a, fstpl a, fstpd a)731 #define FSTP_S(a)CHOICE(fstps a, fstps a, fstps a)732 #define FSTP(a)CHOICE(fstp a, fstp a, fstp a)733 #define FSTCW(a)CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a)734 #define FNSTCW(a)CHOICE(fnstcw a, fnstcw a, fstcw a)735 #define FSTENV(a)CHOICE(fstenv a, wait; fnstenv a, fstenv a)736 #define FNSTENV(a)CHOICE(fnstenv a, fnstenv a, fstenv a)737 #define FSTSW(a)CHOICE(fstsw a, wait; fnstsw a, wait; fstsw a)738 #define FNSTSW(a)CHOICE(fnstsw a, fnstsw a, fstsw a)739 #define FSUB_S(a)CHOICE(fsubs a, fsubs a, fsubs a)740 #define FSUB_D(a)CHOICE(fsubl a, fsubl a, fsubd a)741 #define FSUB2(a, b)CHOICE(fsub ARG2(a,b), fsub ARG2(a,b), fsub ARG2(b,a))742 #define FSUBP(a, b)CHOICE(fsubp ARG2(a,b), fsubp ARG2(a,b), fsubp ARG2(b,a))743 #define FISUB_L(a)CHOICE(fisubl a, fisubl a, fisubl a)744 #define FISUB_W(a)CHOICE(fisub a, fisubs a, fisubs a)745 #define FSUBR_S(a)CHOICE(fsubrs a, fsubrs a, fsubrs a)746 #define FSUBR_D(a)CHOICE(fsubrl a, fsubrl a, fsubrd a)747 #define FSUBR2(a, b)CHOICE(fsubr ARG2(a,b), fsubr ARG2(a,b), fsubr ARG2(b,a))748 #define FSUBRP(a, b)CHOICE(fsubrp ARG2(a,b), fsubrp ARG2(a,b), fsubrp ARG2(b,a))749 #define FISUBR_L(a)CHOICE(fisubrl a, fisubrl a, fisubrl a)750 #define FISUBR_W(a)CHOICE(fisubr a, fisubrs a, fisubrs a)751 #define FTSTCHOICE(ftst, ftst, ftst)752 #define FUCOM(a)CHOICE(fucom a, fucom a, fucom a)753 #define FUCOMP(a)CHOICE(fucomp a, fucomp a, fucomp a)754 #define FUCOMPPCHOICE(fucompp, fucompp, fucompp)755 #define FWAITCHOICE(wait, wait, wait)756 #define FXAMCHOICE(fxam, fxam, fxam)757 #define FXCH(a)CHOICE(fxch a, fxch a, fxch a)758 #define FXTRACTCHOICE(fxtract, fxtract, fxtract)759 #define FYL2XCHOICE(fyl2x, fyl2x, fyl2x)760 #define FYL2XP1CHOICE(fyl2xp1, fyl2xp1, fyl2xp1)655 #define F2XM1 CHOICE(f2xm1, f2xm1, f2xm1) 656 #define FABS CHOICE(fabs, fabs, fabs) 657 #define FADD_D(a) CHOICE(faddl a, faddl a, faddd a) 658 #define FADD_S(a) CHOICE(fadds a, fadds a, fadds a) 659 #define FADD2(a, b) CHOICE(fadd ARG2(a,b), fadd ARG2(a,b), fadd ARG2(b,a)) 660 #define FADDP(a, b) CHOICE(faddp ARG2(a,b), faddp ARG2(a,b), faddp ARG2(b,a)) 661 #define FIADD_L(a) CHOICE(fiaddl a, fiaddl a, fiaddl a) 662 #define FIADD_W(a) CHOICE(fiadd a, fiadds a, fiadds a) 663 #define FBLD(a) CHOICE(fbld a, fbld a, fbld a) 664 #define FBSTP(a) CHOICE(fbstp a, fbstp a, fbstp a) 665 #define FCHS CHOICE(fchs, fchs, fchs) 666 #define FCLEX CHOICE(fclex, wait; fnclex, wait; fclex) 667 #define FNCLEX CHOICE(fnclex, fnclex, fclex) 668 #define FCOM(a) CHOICE(fcom a, fcom a, fcom a) 669 #define FCOM_D(a) CHOICE(fcoml a, fcoml a, fcomd a) 670 #define FCOM_S(a) CHOICE(fcoms a, fcoms a, fcoms a) 671 #define FCOMP(a) CHOICE(fcomp a, fcomp a, fcomp a) 672 #define FCOMP_D(a) CHOICE(fcompl a, fcompl a, fcompd a) 673 #define FCOMP_S(a) CHOICE(fcomps a, fcomps a, fcomps a) 674 #define FCOMPP CHOICE(fcompp, fcompp, fcompp) 675 #define FCOS CHOICE(fcos, fcos, fcos) 676 #define FDECSTP CHOICE(fdecstp, fdecstp, fdecstp) 677 #define FDIV_D(a) CHOICE(fdivl a, fdivl a, fdivd a) 678 #define FDIV_S(a) CHOICE(fdivs a, fdivs a, fdivs a) 679 #define FDIV2(a, b) CHOICE(fdiv ARG2(a,b), fdiv ARG2(a,b), fdiv ARG2(b,a)) 680 #define FDIVP(a, b) CHOICE(fdivp ARG2(a,b), fdivp ARG2(a,b), fdivp ARG2(b,a)) 681 #define FIDIV_L(a) CHOICE(fidivl a, fidivl a, fidivl a) 682 #define FIDIV_W(a) CHOICE(fidiv a, fidivs a, fidivs a) 683 #define FDIVR_D(a) CHOICE(fdivrl a, fdivrl a, fdivrd a) 684 #define FDIVR_S(a) CHOICE(fdivrs a, fdivrs a, fdivrs a) 685 #define FDIVR2(a, b) CHOICE(fdivr ARG2(a,b), fdivr ARG2(a,b), fdivr ARG2(b,a)) 686 #define FDIVRP(a, b) CHOICE(fdivrp ARG2(a,b), fdivrp ARG2(a,b), fdivrp ARG2(b,a)) 687 #define FIDIVR_L(a) CHOICE(fidivrl a, fidivrl a, fidivrl a) 688 #define FIDIVR_W(a) CHOICE(fidivr a, fidivrs a, fidivrs a) 689 #define FFREE(a) CHOICE(ffree a, ffree a, ffree a) 690 #define FICOM_L(a) CHOICE(ficoml a, ficoml a, ficoml a) 691 #define FICOM_W(a) CHOICE(ficom a, ficoms a, ficoms a) 692 #define FICOMP_L(a) CHOICE(ficompl a, ficompl a, ficompl a) 693 #define FICOMP_W(a) CHOICE(ficomp a, ficomps a, ficomps a) 694 #define FILD_Q(a) CHOICE(fildll a, fildq a, fildq a) 695 #define FILD_L(a) CHOICE(fildl a, fildl a, fildl a) 696 #define FILD_W(a) CHOICE(fild a, filds a, filds a) 697 #define FINCSTP CHOICE(fincstp, fincstp, fincstp) 698 #define FINIT CHOICE(finit, wait; fninit, wait; finit) 699 #define FNINIT CHOICE(fninit, fninit, finit) 700 #define FIST_L(a) CHOICE(fistl a, fistl a, fistl a) 701 #define FIST_W(a) CHOICE(fist a, fists a, fists a) 702 #define FISTP_Q(a) CHOICE(fistpll a, fistpq a, fistpq a) 703 #define FISTP_L(a) CHOICE(fistpl a, fistpl a, fistpl a) 704 #define FISTP_W(a) CHOICE(fistp a, fistps a, fistps a) 705 #define FLD_X(a) CHOICE(fldt a, fldt a, fldx a) /* 80 bit data type! */ 706 #define FLD_D(a) CHOICE(fldl a, fldl a, fldd a) 707 #define FLD_S(a) CHOICE(flds a, flds a, flds a) 708 #define FLD1 CHOICE(fld1, fld1, fld1) 709 #define FLDL2T CHOICE(fldl2t, fldl2t, fldl2t) 710 #define FLDL2E CHOICE(fldl2e, fldl2e, fldl2e) 711 #define FLDPI CHOICE(fldpi, fldpi, fldpi) 712 #define FLDLG2 CHOICE(fldlg2, fldlg2, fldlg2) 713 #define FLDLN2 CHOICE(fldln2, fldln2, fldln2) 714 #define FLDZ CHOICE(fldz, fldz, fldz) 715 #define FLDCW(a) CHOICE(fldcw a, fldcw a, fldcw a) 716 #define FLDENV(a) CHOICE(fldenv a, fldenv a, fldenv a) 717 #define FMUL_S(a) CHOICE(fmuls a, fmuls a, fmuls a) 718 #define FMUL_D(a) CHOICE(fmull a, fmull a, fmuld a) 719 #define FMUL2(a, b) CHOICE(fmul ARG2(a,b), fmul ARG2(a,b), fmul ARG2(b,a)) 720 #define FMULP(a, b) CHOICE(fmulp ARG2(a,b), fmulp ARG2(a,b), fmulp ARG2(b,a)) 721 #define FIMUL_L(a) CHOICE(fimull a, fimull a, fimull a) 722 #define FIMUL_W(a) CHOICE(fimul a, fimuls a, fimuls a) 723 #define FNOP CHOICE(fnop, fnop, fnop) 724 #define FPATAN CHOICE(fpatan, fpatan, fpatan) 725 #define FPREM CHOICE(fprem, fprem, fprem) 726 #define FPREM1 CHOICE(fprem1, fprem1, fprem1) 727 #define FPTAN CHOICE(fptan, fptan, fptan) 728 #define FRNDINT CHOICE(frndint, frndint, frndint) 729 #define FRSTOR(a) CHOICE(frstor a, frstor a, frstor a) 730 #define FSAVE(a) CHOICE(fsave a, wait; fnsave a, wait; fsave a) 731 #define FNSAVE(a) CHOICE(fnsave a, fnsave a, fsave a) 732 #define FSCALE CHOICE(fscale, fscale, fscale) 733 #define FSIN CHOICE(fsin, fsin, fsin) 734 #define FSINCOS CHOICE(fsincos, fsincos, fsincos) 735 #define FSQRT CHOICE(fsqrt, fsqrt, fsqrt) 736 #define FST_D(a) CHOICE(fstl a, fstl a, fstd a) 737 #define FST_S(a) CHOICE(fsts a, fsts a, fsts a) 738 #define FSTP_X(a) CHOICE(fstpt a, fstpt a, fstpx a) 739 #define FSTP_D(a) CHOICE(fstpl a, fstpl a, fstpd a) 740 #define FSTP_S(a) CHOICE(fstps a, fstps a, fstps a) 741 #define FSTP(a) CHOICE(fstp a, fstp a, fstp a) 742 #define FSTCW(a) CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a) 743 #define FNSTCW(a) CHOICE(fnstcw a, fnstcw a, fstcw a) 744 #define FSTENV(a) CHOICE(fstenv a, wait; fnstenv a, fstenv a) 745 #define FNSTENV(a) CHOICE(fnstenv a, fnstenv a, fstenv a) 746 #define FSTSW(a) CHOICE(fstsw a, wait; fnstsw a, wait; fstsw a) 747 #define FNSTSW(a) CHOICE(fnstsw a, fnstsw a, fstsw a) 748 #define FSUB_S(a) CHOICE(fsubs a, fsubs a, fsubs a) 749 #define FSUB_D(a) CHOICE(fsubl a, fsubl a, fsubd a) 750 #define FSUB2(a, b) CHOICE(fsub ARG2(a,b), fsub ARG2(a,b), fsub ARG2(b,a)) 751 #define FSUBP(a, b) CHOICE(fsubp ARG2(a,b), fsubp ARG2(a,b), fsubp ARG2(b,a)) 752 #define FISUB_L(a) CHOICE(fisubl a, fisubl a, fisubl a) 753 #define FISUB_W(a) CHOICE(fisub a, fisubs a, fisubs a) 754 #define FSUBR_S(a) CHOICE(fsubrs a, fsubrs a, fsubrs a) 755 #define FSUBR_D(a) CHOICE(fsubrl a, fsubrl a, fsubrd a) 756 #define FSUBR2(a, b) CHOICE(fsubr ARG2(a,b), fsubr ARG2(a,b), fsubr ARG2(b,a)) 757 #define FSUBRP(a, b) CHOICE(fsubrp ARG2(a,b), fsubrp ARG2(a,b), fsubrp ARG2(b,a)) 758 #define FISUBR_L(a) CHOICE(fisubrl a, fisubrl a, fisubrl a) 759 #define FISUBR_W(a) CHOICE(fisubr a, fisubrs a, fisubrs a) 760 #define FTST CHOICE(ftst, ftst, ftst) 761 #define FUCOM(a) CHOICE(fucom a, fucom a, fucom a) 762 #define FUCOMP(a) CHOICE(fucomp a, fucomp a, fucomp a) 763 #define FUCOMPP CHOICE(fucompp, fucompp, fucompp) 764 #define FWAIT CHOICE(wait, wait, wait) 765 #define FXAM CHOICE(fxam, fxam, fxam) 766 #define FXCH(a) CHOICE(fxch a, fxch a, fxch a) 767 #define FXTRACT CHOICE(fxtract, fxtract, fxtract) 768 #define FYL2X CHOICE(fyl2x, fyl2x, fyl2x) 769 #define FYL2XP1 CHOICE(fyl2xp1, fyl2xp1, fyl2xp1) 761 770 762 771 /* New instructions */ 763 #define CPUIDCHOICE(D_BYTE ARG2(15, 162), cpuid, D_BYTE ARG2(15, 162))764 #define RDTSCCHOICE(D_BYTE ARG2(15, 49), rdtsc, D_BYTE ARG2(15, 49))772 #define CPUID CHOICE(D_BYTE ARG2(15, 162), cpuid, D_BYTE ARG2(15, 162)) 773 #define RDTSC CHOICE(D_BYTE ARG2(15, 49), rdtsc, D_BYTE ARG2(15, 49)) 765 774 766 775 #else /* NASM_ASSEMBLER || MASM_ASSEMBLER is defined */ 767 776 768 769 /**/770 /* Intel style assemblers.*/771 /* (NASM and MASM)*/772 /**/773 774 775 #define P_EAX 776 #define L_EAX 777 #define W_AX 778 #define B_AH 779 #define B_AL 780 781 #define P_EBX 782 #define L_EBX 783 #define W_BX 784 #define B_BH 785 #define B_BL 786 787 #define P_ECX 788 #define L_ECX 789 #define W_CX 790 #define B_CH 791 #define B_CL 792 793 #define P_EDX 794 #define L_EDX 795 #define W_DX 796 #define B_DH 797 #define B_DL 798 799 #define P_EBP 800 #define L_EBP 801 #define W_BP 802 803 #define P_ESI 804 #define L_ESI 805 #define W_SI 806 807 #define P_EDI 808 #define L_EDI 809 #define W_DI 810 811 #define P_ESP 812 #define L_ESP 813 #define W_SP 814 815 #define W_CS 816 #define W_SS 817 #define W_DS 818 #define W_ES 819 #define W_FS 820 #define W_GS 821 822 #define X_ST 823 #define D_ST 824 #define L_ST 825 826 #define P_MM0 827 #define P_MM1 828 #define P_MM2 829 #define P_MM3 830 #define P_MM4 831 #define P_MM5 832 #define P_MM6 833 #define P_MM7 834 835 #define P_XMM0 836 #define P_XMM1 837 #define P_XMM2 838 #define P_XMM3 839 #define P_XMM4 840 #define P_XMM5 841 #define P_XMM6 842 #define P_XMM7 777 /****************************************/ 778 /* */ 779 /* Intel style assemblers. */ 780 /* (NASM and MASM) */ 781 /* */ 782 /****************************************/ 783 784 #define P_EAX EAX 785 #define L_EAX EAX 786 #define W_AX AX 787 #define B_AH AH 788 #define B_AL AL 789 790 #define P_EBX EBX 791 #define L_EBX EBX 792 #define W_BX BX 793 #define B_BH BH 794 #define B_BL BL 795 796 #define P_ECX ECX 797 #define L_ECX ECX 798 #define W_CX CX 799 #define B_CH CH 800 #define B_CL CL 801 802 #define P_EDX EDX 803 #define L_EDX EDX 804 #define W_DX DX 805 #define B_DH DH 806 #define B_DL DL 807 808 #define P_EBP EBP 809 #define L_EBP EBP 810 #define W_BP BP 811 812 #define P_ESI ESI 813 #define L_ESI ESI 814 #define W_SI SI 815 816 #define P_EDI EDI 817 #define L_EDI EDI 818 #define W_DI DI 819 820 #define P_ESP ESP 821 #define L_ESP ESP 822 #define W_SP SP 823 824 #define W_CS CS 825 #define W_SS SS 826 #define W_DS DS 827 #define W_ES ES 828 #define W_FS FS 829 #define W_GS GS 830 831 #define X_ST ST 832 #define D_ST ST 833 #define L_ST ST 834 835 #define P_MM0 mm0 836 #define P_MM1 mm1 837 #define P_MM2 mm2 838 #define P_MM3 mm3 839 #define P_MM4 mm4 840 #define P_MM5 mm5 841 #define P_MM6 mm6 842 #define P_MM7 mm7 843 844 #define P_XMM0 xmm0 845 #define P_XMM1 xmm1 846 #define P_XMM2 xmm2 847 #define P_XMM3 xmm3 848 #define P_XMM4 xmm4 849 #define P_XMM5 xmm5 850 #define P_XMM6 xmm6 851 #define P_XMM7 xmm7 843 852 844 853 #if defined(NASM_ASSEMBLER) … … 876 885 /* #define SPACE */ 877 886 /* #define COMM */ 887 #if defined(__WATCOMC__) 888 SECTION _TEXT public align=16 class=CODE use32 flat 889 SECTION _DATA public align=16 class=DATA use32 flat 890 #define SEG_TEXT SECTION _TEXT 891 #define SEG_DATA SECTION _DATA 892 #define SEG_BSS SECTION .bss 893 #else 878 894 #define SEG_DATA SECTION .data 879 895 #define SEG_TEXT SECTION .text 880 896 #define SEG_BSS SECTION .bss 897 #endif 881 898 882 899 #define D_SPACE(n) db n REP 0 … … 884 901 #define AS_BEGIN 885 902 886 #define NEAR near 903 #define NEAR near /* Jcc's should be handled better than this... */ 887 904 888 905 #else /* MASM */ … … 930 947 #endif 931 948 932 #if defined(Lynx) || (defined(SYSV) || defined(SVR4)) || (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__) || defined(__FreeBSD__) && __FreeBSD__ >= 3 949 #if defined(Lynx) || (defined(SYSV) || defined(SVR4)) \ 950 || (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__) \ 951 || defined(__FreeBSD__) && __FreeBSD__ >= 3 933 952 #define GLNAME(a) a 934 953 #else … … 953 972 #define L_CONST(a) a 954 973 #define W_CONST(a) a 955 #define B_CONST(a) 974 #define B_CONST(a) a 956 975 957 976 /* Indirect Mode */ 958 #define P_CONTENT(a) 959 #define X_CONTENT(a) 960 #define D_CONTENT(a) 961 #define L_CONTENT(a) 962 #define W_CONTENT(a) 963 #define B_CONTENT(a) 977 #define P_CONTENT(a) a 978 #define X_CONTENT(a) TBYTE_PTR a 979 #define D_CONTENT(a) QWORD_PTR a 980 #define L_CONTENT(a) DWORD_PTR a 981 #define W_CONTENT(a) WORD_PTR a 982 #define B_CONTENT(a) BYTE_PTR a 964 983 965 984 /* Register a indirect */ 966 #define P_REGIND(a) 967 #define X_REGIND(a) 968 #define D_REGIND(a) 969 #define L_REGIND(a) 970 #define W_REGIND(a) 971 #define B_REGIND(a) 985 #define P_REGIND(a) [a] 986 #define X_REGIND(a) TBYTE_PTR [a] 987 #define D_REGIND(a) QWORD_PTR [a] 988 #define L_REGIND(a) DWORD_PTR [a] 989 #define W_REGIND(a) WORD_PTR [a] 990 #define B_REGIND(a) BYTE_PTR [a] 972 991 973 992 /* Register b indirect plus displacement a */ 974 #define P_REGOFF(a, b) 975 #define X_REGOFF(a, b) 976 #define D_REGOFF(a, b) 977 #define L_REGOFF(a, b) 978 #define W_REGOFF(a, b) 979 #define B_REGOFF(a, b) 993 #define P_REGOFF(a, b) [b + a] 994 #define X_REGOFF(a, b) TBYTE_PTR [b + a] 995 #define D_REGOFF(a, b) QWORD_PTR [b + a] 996 #define L_REGOFF(a, b) DWORD_PTR [b + a] 997 #define W_REGOFF(a, b) WORD_PTR [b + a] 998 #define B_REGOFF(a, b) BYTE_PTR [b + a] 980 999 981 1000 /* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode 982 1001 * which has no scaling 983 1002 */ 984 #define P_REGBID(b, i, d) 985 #define X_REGBID(b, i, d) 986 #define D_REGBID(b, i, d) 987 #define L_REGBID(b, i, d) 988 #define W_REGBID(b, i, d) 989 #define B_REGBID(b, i, d) 1003 #define P_REGBID(b, i, d) [b + i + d] 1004 #define X_REGBID(b, i, d) TBYTE_PTR [b + i + d] 1005 #define D_REGBID(b, i, d) QWORD_PTR [b + i + d] 1006 #define L_REGBID(b, i, d) DWORD_PTR [b + i + d] 1007 #define W_REGBID(b, i, d) WORD_PTR [b + i + d] 1008 #define B_REGBID(b, i, d) BYTE_PTR [b + i + d] 990 1009 991 1010 /* Reg indirect Base + (Index * Scale) + Displacement */ 992 #define P_REGBISD(b, i, s, d) 993 #define X_REGBISD(b, i, s, d) 994 #define D_REGBISD(b, i, s, d) 995 #define L_REGBISD(b, i, s, d) 996 #define W_REGBISD(b, i, s, d) 997 #define B_REGBISD(b, i, s, d) 1011 #define P_REGBISD(b, i, s, d) [b + i * s + d] 1012 #define X_REGBISD(b, i, s, d) TBYTE_PTR [b + i * s + d] 1013 #define D_REGBISD(b, i, s, d) QWORD_PTR [b + i * s + d] 1014 #define L_REGBISD(b, i, s, d) DWORD_PTR [b + i * s + d] 1015 #define W_REGBISD(b, i, s, d) WORD_PTR [b + i * s + d] 1016 #define B_REGBISD(b, i, s, d) BYTE_PTR [b + i * s + d] 998 1017 999 1018 /* Displaced Scaled Index: */ 1000 #define P_REGDIS(d, i, s) 1001 #define X_REGDIS(d, i, s) 1002 #define D_REGDIS(d, i, s) 1003 #define L_REGDIS(d, i, s) 1004 #define W_REGDIS(d, i, s) 1005 #define B_REGDIS(d, i, s) 1019 #define P_REGDIS(d, i, s) [i * s + d] 1020 #define X_REGDIS(d, i, s) TBYTE_PTR [i * s + d] 1021 #define D_REGDIS(d, i, s) QWORD_PTR [i * s + d] 1022 #define L_REGDIS(d, i, s) DWORD_PTR [i * s + d] 1023 #define W_REGDIS(d, i, s) WORD_PTR [i * s + d] 1024 #define B_REGDIS(d, i, s) BYTE_PTR [i * s + d] 1006 1025 1007 1026 /* Indexed Base: */ 1008 #define P_REGBI(b, i) 1009 #define X_REGBI(b, i) 1010 #define D_REGBI(b, i) 1011 #define L_REGBI(b, i) 1012 #define W_REGBI(b, i) 1013 #define B_REGBI(b, i) 1027 #define P_REGBI(b, i) [b + i] 1028 #define X_REGBI(b, i) TBYTE_PTR [b + i] 1029 #define D_REGBI(b, i) QWORD_PTR [b + i] 1030 #define L_REGBI(b, i) DWORD_PTR [b + i] 1031 #define W_REGBI(b, i) WORD_PTR [b + i] 1032 #define B_REGBI(b, i) BYTE_PTR [b + i] 1014 1033 1015 1034 /* Displaced Base: */ 1016 #define P_REGDB(d, b) 1017 #define X_REGDB(d, b) 1018 #define D_REGDB(d, b) 1019 #define L_REGDB(d, b) 1020 #define W_REGDB(d, b) 1021 #define B_REGDB(d, b) 1035 #define P_REGDB(d, b) [b + d] 1036 #define X_REGDB(d, b) TBYTE_PTR [b + d] 1037 #define D_REGDB(d, b) QWORD_PTR [b + d] 1038 #define L_REGDB(d, b) DWORD_PTR [b + d] 1039 #define W_REGDB(d, b) WORD_PTR [b + d] 1040 #define B_REGDB(d, b) BYTE_PTR [b + d] 1022 1041 1023 1042 /* Variable indirect: */ 1024 #define VARINDIRECT(var) [var]1043 #define VARINDIRECT(var) var 1025 1044 1026 1045 /* Use register contents as jump/call target: */ 1027 #define CODEPTR(reg) [reg]1046 #define CODEPTR(reg) reg 1028 1047 1029 1048 /* 1030 * 1049 * Redefine assembler commands 1031 1050 */ 1032 1051 1033 #define P_(a) 1034 #define X_(a) 1035 #define D_(a) 1036 #define S_(a) 1037 #define L_(a) 1038 #define W_(a) 1039 #define B_(a) 1040 1041 #define AAA aaa1042 #define AAD aad1043 #define AAM aam1044 #define AAS aas1045 #define ADC_L(a, b)adc L_(b), L_(a)1046 #define ADC_W(a, b)adc W_(b), W_(a)1047 #define ADC_B(a, b)adc B_(b), B_(a)1048 #define ADD_L(a, b)add L_(b), L_(a)1049 #define ADD_W(a, b)add W_(b), W_(a)1050 #define ADD_B(a, b)add B_(b), B_(a)1051 #define AND_L(a, b)and L_(b), L_(a)1052 #define AND_W(a, b)and W_(b), W_(a)1053 #define AND_B(a, b)and B_(b), B_(a)1054 #define ARPL(a,b)arpl W_(b), a1055 #define BOUND_L(a, b)bound L_(b), L_(a)1056 #define BOUND_W(a, b)bound W_(b), W_(a)1057 #define BSF_L(a, b)bsf L_(b), L_(a)1058 #define BSF_W(a, b)bsf W_(b), W_(a)1059 #define BSR_L(a, b)bsr L_(b), L_(a)1060 #define BSR_W(a, b)bsr W_(b), W_(a)1061 #define BT_L(a, b)bt L_(b), L_(a)1062 #define BT_W(a, b)bt W_(b), W_(a)1063 #define BTC_L(a, b)btc L_(b), L_(a)1064 #define BTC_W(a, b)btc W_(b), W_(a)1065 #define BTR_L(a, b)btr L_(b), L_(a)1066 #define BTR_W(a, b)btr W_(b), W_(a)1067 #define BTS_L(a, b)bts L_(b), L_(a)1068 #define BTS_W(a, b)bts W_(b), W_(a)1069 #define CALL(a)call a1070 #define CALLF(s,a)call far s:a1071 #define CBW cbw1072 #define CWDE cwde1073 #define CLC clc1074 #define CLD cld1075 #define CLI cli1076 #define CLTS clts1077 #define CMC cmc1078 #define CMP_L(a, b)cmp L_(b), L_(a)1079 #define CMP_W(a, b)cmp W_(b), W_(a)1080 #define CMP_B(a, b)cmp B_(b), B_(a)1081 #define CMPS_Lcmpsd1082 #define CMPS_Wcmpsw1083 #define CMPS_Bcmpsb1084 #define CWD cwd1085 #define CDQ cdq1086 #define DAA daa1087 #define DAS das1088 #define DEC_L(a)dec L_(a)1089 #define DEC_W(a)dec W_(a)1090 #define DEC_B(a)dec B_(a)1091 #define DIV_L(a)div L_(a)1092 #define DIV_W(a)div W_(a)1093 #define DIV_B(a)div B_(a)1094 #define ENTER(a,b)enter b, a1095 #define HLT hlt1096 #define IDIV_L(a)idiv L_(a)1097 #define IDIV_W(a)idiv W_(a)1098 #define IDIV_B(a)idiv B_(a)1099 #define IMUL_L(a, b)imul L_(b), L_(a)1100 #define IMUL_W(a, b)imul W_(b), W_(a)1101 #define IMUL_B(a)imul B_(a)1102 #define IN_Lin EAX, DX1103 #define IN_Win AX, DX1104 #define IN_Bin AL, DX1105 #define IN1_L(a)in1 L_(a)1106 #define IN1_W(a)in1 W_(a)1107 #define IN1_B(a)in1 B_(a)1108 #define INC_L(a)inc L_(a)1109 #define INC_W(a)inc W_(a)1110 #define INC_B(a)inc B_(a)1111 #define INS_Lins1112 #define INS_Wins1113 #define INS_Bins1114 #define INT(a)int B_(a)1115 #define INT3 int31116 #define INTO into1117 #define IRET iret1118 #define IRETD iretd1119 #define JA(a)ja NEAR a1120 #define JAE(a)jae NEAR a1121 #define JB(a)jb NEAR a1122 #define JBE(a)jbe NEAR a1123 #define JC(a)jc NEAR a1124 #define JE(a)je NEAR a1125 #define JG(a)jg NEAR a1126 #define JGE(a)jge NEAR a1127 #define JL(a)jl NEAR a1128 #define JLE(a)jle NEAR a1129 #define JNA(a)jna NEAR a1130 #define JNAE(a)jnae NEAR a1131 #define JNB(a)jnb NEAR a1132 #define JNBE(a)jnbe NEAR a1133 #define JNC(a)jnc NEAR a1134 #define JNE(a)jne NEAR a1135 #define JNG(a)jng NEAR a1136 #define JNGE(a)jnge NEAR a1137 #define JNL(a)jnl NEAR a1138 #define JNLE(a)jnle NEAR a1139 #define JNO(a)jno NEAR a1140 #define JNP(a)jnp NEAR a1141 #define JNS(a)jns NEAR a1142 #define JNZ(a)jnz NEAR a1143 #define JO(a)jo NEAR a1144 #define JP(a)jp NEAR a1145 #define JPE(a)jpe NEAR a1146 #define JPO(a)jpo NEAR a1147 #define JS(a)js NEAR a1148 #define JZ(a)jz NEAR a1149 #define JMP(a)jmp a1150 #define JMPF(s,a)jmpf1151 #define LAHF lahf1152 #define LAR(a, b)lar b, a1153 #define LEA_L(a, b)lea P_(b), P_(a)1154 #define LEA_W(a, b)lea P_(b), P_(a)1155 #define LEAVE leave1156 #define LGDT(a)lgdt a1157 #define LIDT(a)lidt a1158 #define LDS(a, b)lds b, a1159 #define LES(a, b)les b, a1160 #define LFS(a, b)lfs b, a1161 #define LGS(a, b)lgs b, a1162 #define LSS(a, b)lss b, a1163 #define LLDT(a)lldt a1164 #define LMSW(a)lmsw a1165 #define LOCK lock1166 #define LODS_Llodsd1167 #define LODS_Wlodsw1168 #define LODS_Blodsb1169 #define LOOP(a)loop a1170 #define LOOPE(a)loope a1171 #define LOOPZ(a)loopz a1172 #define LOOPNE(a)loopne a1173 #define LOOPNZ(a)loopnz a1174 #define LSL(a, b)lsl b, a1175 #define LTR(a)ltr a1176 #define MOV_SR(a, b)mov S_(b), S_(a)1177 #define MOV_L(a, b)mov L_(b), L_(a)1178 #define MOV_W(a, b)mov W_(b), W_(a)1179 #define MOV_B(a, b)mov B_(b), B_(a)1180 #define MOVS_Lmovsd1181 #define MOVS_Wmovsw1182 #define MOVS_Bmovsb1183 #define MOVSX_BL(a, b)movsx B_(b), B_(a)1184 #define MOVSX_BW(a, b)movsx B_(b), B_(a)1185 #define MOVSX_WL(a, b)movsx W_(b), W_(a)1186 #define MOVZX_BL(a, b)movzx B_(b), B_(a)1187 #define MOVZX_BW(a, b)movzx B_(b), B_(a)1188 #define MOVZX_WL(a, b)movzx W_(b), W_(a)1189 #define MUL_L(a)mul L_(a)1190 #define MUL_W(a)mul W_(a)1191 #define MUL_B(a)mul B_(a)1192 #define NEG_L(a)neg L_(a)1193 #define NEG_W(a)neg W_(a)1194 #define NEG_B(a)neg B_(a)1195 #define NOP nop1196 #define NOT_L(a)not L_(a)1197 #define NOT_W(a)not W_(a)1198 #define NOT_B(a)not B_(a)1199 #define OR_L(a,b)or L_(b), L_(a)1200 #define OR_W(a,b)or W_(b), W_(a)1201 #define OR_B(a,b)or B_(b), B_(a)1202 #define OUT_Lout DX, EAX1203 #define OUT_Wout DX, AX1204 #define OUT_Bout DX, AL1205 #define OUT1_L(a)out1 L_(a)1206 #define OUT1_W(a)out1 W_(a)1207 #define OUT1_B(a)out1 B_(a)1208 #define OUTS_Loutsd1209 #define OUTS_Woutsw1210 #define OUTS_Boutsb1211 #define POP_SR(a)pop S_(a)1212 #define POP_L(a)pop L_(a)1213 #define POP_W(a)pop W_(a)1214 #define POPA_Lpopad1215 #define POPA_Wpopa1216 #define POPF_Lpopfd1217 #define POPF_Wpopf1218 #define PUSH_SR(a)push S_(a)1219 #define PUSH_L(a)push L_(a)1220 #define PUSH_W(a)push W_(a)1221 #define PUSH_B(a)push B_(a)1222 #define PUSHA_Lpushad1223 #define PUSHA_Wpusha1224 #define PUSHF_Lpushfd1225 #define PUSHF_Wpushf1226 #define RCL_L(a, b)rcl L_(b), L_(a)1227 #define RCL_W(a, b)rcl W_(b), W_(a)1228 #define RCL_B(a, b)rcl B_(b), B_(a)1229 #define RCR_L(a, b)rcr L_(b), L_(a)1230 #define RCR_W(a, b)rcr W_(b), W_(a)1231 #define RCR_B(a, b)rcr B_(b), B_(a)1232 #define ROL_L(a, b)rol L_(b), L_(a)1233 #define ROL_W(a, b)rol W_(b), W_(a)1234 #define ROL_B(a, b)rol B_(b), B_(a)1235 #define ROR_L(a, b)ror L_(b), L_(a)1236 #define ROR_W(a, b)ror W_(b), W_(a)1237 #define ROR_B(a, b)ror B_(b), B_(a)1238 #define REP rep1239 #define REPE repe1240 #define REPNE repne1241 #define REPNZREPNE1242 #define REPZREPE1243 #define RET ret1244 #define SAHF sahf1245 #define SAL_L(a, b)sal L_(b), L_(a)1246 #define SAL_W(a, b)sal W_(b), W_(a)1247 #define SAL_B(a, b)sal B_(b), B_(a)1248 #define SAR_L(a, b)sar L_(b), L_(a)1249 #define SAR_W(a, b)sar W_(b), W_(a)1250 #define SAR_B(a, b)sar B_(b), B_(a)1251 #define SBB_L(a, b)sbb L_(b), L_(a)1252 #define SBB_W(a, b)sbb W_(b), W_(a)1253 #define SBB_B(a, b)sbb B_(b), B_(a)1254 #define SCAS_Lscas1255 #define SCAS_Wscas1256 #define SCAS_Bscas1257 #define SETA(a)seta a1258 #define SETAE(a)setae a1259 #define SETB(a)setb a1260 #define SETBE(a)setbe a1261 #define SETC(a)setc a1262 #define SETE(a)sete a1263 #define SETG(a)setg a1264 #define SETGE(a)setge a1265 #define SETL(a)setl a1266 #define SETLE(a)setle a1267 #define SETNA(a)setna a1268 #define SETNAE(a)setnae a1269 #define SETNB(a)setnb a1270 #define SETNBE(a)setnbe a1271 #define SETNC(a)setnc a1272 #define SETNE(a)setne a1273 #define SETNG(a)setng a1274 #define SETNGE(a)setnge a1275 #define SETNL(a)setnl a1276 #define SETNLE(a)setnle a1277 #define SETNO(a)setno a1278 #define SETNP(a)setnp a1279 #define SETNS(a)setns a1280 #define SETNZ(a)setnz a1281 #define SETO(a)seto a1282 #define SETP(a)setp a1283 #define SETPE(a)setpe a1284 #define SETPO(a)setpo a1285 #define SETS(a)sets a1286 #define SETZ(a)setz a1287 #define SGDT(a)sgdt a1288 #define SIDT(a)sidt a1289 #define SHL_L(a, b)shl L_(b), L_(a)1290 #define SHL_W(a, b)shl W_(b), W_(a)1291 #define SHL_B(a, b)shl B_(b), B_(a)1292 #define SHLD_L(a,b,c)shld1293 #define SHLD2_L(a,b)shld L_(b), L_(a)1294 #define SHLD_W(a,b,c)shld1295 #define SHLD2_W(a,b)shld W_(b), W_(a)1296 #define SHR_L(a, b)shr L_(b), L_(a)1297 #define SHR_W(a, b)shr W_(b), W_(a)1298 #define SHR_B(a, b)shr B_(b), B_(a)1299 #define SHRD_L(a,b,c)shrd1300 #define SHRD2_L(a,b)shrd L_(b), L_(a)1301 #define SHRD_W(a,b,c)shrd1302 #define SHRD2_W(a,b)shrd W_(b), W_(a)1303 #define SLDT(a)sldt a1304 #define SMSW(a)smsw a1305 #define STC stc1306 #define STD std1307 #define STI sti1308 #define STOS_Lstos1309 #define STOS_Wstos1310 #define STOS_Bstos1311 #define STR(a)str a1312 #define SUB_L(a, b)sub L_(b), L_(a)1313 #define SUB_W(a, b)sub W_(b), W_(a)1314 #define SUB_B(a, b)sub B_(b), B_(a)1315 #define TEST_L(a, b)test L_(b), L_(a)1316 #define TEST_W(a, b)test W_(b), W_(a)1317 #define TEST_B(a, b)test B_(b), B_(a)1318 #define VERR(a)verr a1319 #define VERW(a)verw a1320 #define WAIT wait1321 #define XCHG_L(a, b)xchg L_(b), L_(a)1322 #define XCHG_W(a, b)xchg W_(b), W_(a)1323 #define XCHG_B(a, b)xchg B_(b), B_(a)1324 #define XLAT xlat1325 #define XOR_L(a, b)xor L_(b), L_(a)1326 #define XOR_W(a, b)xor W_(b), W_(a)1327 #define XOR_B(a, b)xor B_(b), B_(a)1328 #define F2XM1 f2xm11329 #define FABS fabs1330 #define FADD_D(a)fadd D_(a)1331 #define FADD_S(a)fadd S_(a)1332 #define FADD2(a, b)fadd b, a1333 #define FADDP(a, b)faddp b, a1334 #define FIADD_L(a)fiadd L_(a)1335 #define FIADD_W(a)fiadd W_(a)1336 #define FBLD(a)fbld a1337 #define FBSTP(a)fbstp a1338 #define FCHS fchs1339 #define FCLEX fclex1340 #define FNCLEX fnclex1341 #define FCOM(a)fcom a1342 #define FCOM_D(a)fcom D_(a)1343 #define FCOM_S(a)fcom S_(a)1344 #define FCOMP(a)fcomp a1345 #define FCOMP_D(a)fcomp D_(a)1346 #define FCOMP_S(a)fcomp S_(a)1347 #define FCOMPP fcompp1348 #define FCOS fcos1349 #define FDECSTP fdecstp1350 #define FDIV_D(a)fdiv D_(a)1351 #define FDIV_S(a)fdiv S_(a)1352 #define FDIV2(a, b)fdiv b, a1353 #define FDIVP(a, b)fdivp b, a1354 #define FIDIV_L(a)fidiv L_(a)1355 #define FIDIV_W(a)fidiv W_(a)1356 #define FDIVR_D(a)fdivr D_(a)1357 #define FDIVR_S(a)fdivr S_(a)1358 #define FDIVR2(a, b)fdivr b, a1359 #define FDIVRP(a, b)fdivrp b, a1360 #define FIDIVR_L(a)fidivr L_(a)1361 #define FIDIVR_W(a)fidivr W_(a)1362 #define FFREE(a)ffree a1363 #define FICOM_L(a)ficom L_(a)1364 #define FICOM_W(a)ficom W_(a)1365 #define FICOMP_L(a)ficomp L_(a)1366 #define FICOMP_W(a)ficomp W_(a)1367 #define FILD_Q(a)fild D_(a)1368 #define FILD_L(a)fild L_(a)1369 #define FILD_W(a)fild W_(a)1370 #define FINCSTP fincstp1371 #define FINIT finit1372 #define FNINIT fninit1373 #define FIST_L(a)fist L_(a)1374 #define FIST_W(a)fist W_(a)1375 #define FISTP_Q(a)fistp D_(a)1376 #define FISTP_L(a)fistp L_(a)1377 #define FISTP_W(a)fistp W_(a)1378 #define FLD_X(a)fld X_(a)1379 #define FLD_D(a)fld D_(a)1380 #define FLD_S(a)fld S_(a)1381 #define FLD1 fld11382 #define FLDL2T fldl2t1383 #define FLDL2E fldl2e1384 #define FLDPI fldpi1385 #define FLDLG2 fldlg21386 #define FLDLN2 fldln21387 #define FLDZ fldz1388 #define FLDCW(a)fldcw a1389 #define FLDENV(a)fldenv a1390 #define FMUL_S(a)fmul S_(a)1391 #define FMUL_D(a)fmul D_(a)1392 #define FMUL2(a, b)fmul b, a1393 #define FMULP(a, b)fmulp b, a1394 #define FIMUL_L(a)fimul L_(a)1395 #define FIMUL_W(a)fimul W_(a)1396 #define FNOP fnop1397 #define FPATAN fpatan1398 #define FPREM fprem1399 #define FPREM1 fprem11400 #define FPTAN fptan1401 #define FRNDINT frndint1402 #define FRSTOR(a)frstor a1403 #define FSAVE(a)fsave a1404 #define FNSAVE(a)fnsave a1405 #define FSCALE fscale1406 #define FSIN fsin1407 #define FSINCOS fsincos1408 #define FSQRT fsqrt1409 #define FST_D(a)fst D_(a)1410 #define FST_S(a)fst S_(a)1411 #define FSTP_X(a)fstp X_(a)1412 #define FSTP_D(a)fstp D_(a)1413 #define FSTP_S(a)fstp S_(a)1414 #define FSTP(a)fstp a1415 #define FSTCW(a)fstcw a1416 #define FNSTCW(a)fnstcw a1417 #define FSTENV(a)fstenv a1418 #define FNSTENV(a)fnstenv a1419 #define FSTSW(a)fstsw a1420 #define FNSTSW(a)fnstsw a1421 #define FSUB_S(a)fsub S_(a)1422 #define FSUB_D(a)fsub D_(a)1423 #define FSUB2(a, b)fsub b, a1424 #define FSUBP(a, b)fsubp b, a1425 #define FISUB_L(a)fisub L_(a)1426 #define FISUB_W(a)fisub W_(a)1427 #define FSUBR_S(a)fsubr S_(a)1428 #define FSUBR_D(a)fsubr D_(a)1429 #define FSUBR2(a, b)fsubr b, a1430 #define FSUBRP(a, b)fsubrp b, a1431 #define FISUBR_L(a)fisubr L_(a)1432 #define FISUBR_W(a)fisubr W_(a)1433 #define FTST ftst1434 #define FUCOM(a)fucom a1435 #define FUCOMP(a)fucomp a1436 #define FUCOMPP fucompp1437 #define FWAIT fwait1438 #define FXAM fxam1439 #define FXCH(a)fxch a1440 #define FXTRACT fxtract1441 #define FYL2X fyl2x1442 #define FYL2XP1 fyl2xp11052 #define P_(a) P_ ## a 1053 #define X_(a) X_ ## a 1054 #define D_(a) D_ ## a 1055 #define S_(a) L_ ## a 1056 #define L_(a) L_ ## a 1057 #define W_(a) W_ ## a 1058 #define B_(a) B_ ## a 1059 1060 #define AAA aaa 1061 #define AAD aad 1062 #define AAM aam 1063 #define AAS aas 1064 #define ADC_L(a, b) adc L_(b), L_(a) 1065 #define ADC_W(a, b) adc W_(b), W_(a) 1066 #define ADC_B(a, b) adc B_(b), B_(a) 1067 #define ADD_L(a, b) add L_(b), L_(a) 1068 #define ADD_W(a, b) add W_(b), W_(a) 1069 #define ADD_B(a, b) add B_(b), B_(a) 1070 #define AND_L(a, b) and L_(b), L_(a) 1071 #define AND_W(a, b) and W_(b), W_(a) 1072 #define AND_B(a, b) and B_(b), B_(a) 1073 #define ARPL(a,b) arpl W_(b), a 1074 #define BOUND_L(a, b) bound L_(b), L_(a) 1075 #define BOUND_W(a, b) bound W_(b), W_(a) 1076 #define BSF_L(a, b) bsf L_(b), L_(a) 1077 #define BSF_W(a, b) bsf W_(b), W_(a) 1078 #define BSR_L(a, b) bsr L_(b), L_(a) 1079 #define BSR_W(a, b) bsr W_(b), W_(a) 1080 #define BT_L(a, b) bt L_(b), L_(a) 1081 #define BT_W(a, b) bt W_(b), W_(a) 1082 #define BTC_L(a, b) btc L_(b), L_(a) 1083 #define BTC_W(a, b) btc W_(b), W_(a) 1084 #define BTR_L(a, b) btr L_(b), L_(a) 1085 #define BTR_W(a, b) btr W_(b), W_(a) 1086 #define BTS_L(a, b) bts L_(b), L_(a) 1087 #define BTS_W(a, b) bts W_(b), W_(a) 1088 #define CALL(a) call a 1089 #define CALLF(s,a) call far s:a 1090 #define CBW cbw 1091 #define CWDE cwde 1092 #define CLC clc 1093 #define CLD cld 1094 #define CLI cli 1095 #define CLTS clts 1096 #define CMC cmc 1097 #define CMP_L(a, b) cmp L_(b), L_(a) 1098 #define CMP_W(a, b) cmp W_(b), W_(a) 1099 #define CMP_B(a, b) cmp B_(b), B_(a) 1100 #define CMPS_L cmpsd 1101 #define CMPS_W cmpsw 1102 #define CMPS_B cmpsb 1103 #define CWD cwd 1104 #define CDQ cdq 1105 #define DAA daa 1106 #define DAS das 1107 #define DEC_L(a) dec L_(a) 1108 #define DEC_W(a) dec W_(a) 1109 #define DEC_B(a) dec B_(a) 1110 #define DIV_L(a) div L_(a) 1111 #define DIV_W(a) div W_(a) 1112 #define DIV_B(a) div B_(a) 1113 #define ENTER(a,b) enter b, a 1114 #define HLT hlt 1115 #define IDIV_L(a) idiv L_(a) 1116 #define IDIV_W(a) idiv W_(a) 1117 #define IDIV_B(a) idiv B_(a) 1118 #define IMUL_L(a, b) imul L_(b), L_(a) 1119 #define IMUL_W(a, b) imul W_(b), W_(a) 1120 #define IMUL_B(a) imul B_(a) 1121 #define IN_L in EAX, DX 1122 #define IN_W in AX, DX 1123 #define IN_B in AL, DX 1124 #define IN1_L(a) in1 L_(a) 1125 #define IN1_W(a) in1 W_(a) 1126 #define IN1_B(a) in1 B_(a) 1127 #define INC_L(a) inc L_(a) 1128 #define INC_W(a) inc W_(a) 1129 #define INC_B(a) inc B_(a) 1130 #define INS_L ins 1131 #define INS_W ins 1132 #define INS_B ins 1133 #define INT(a) int B_(a) 1134 #define INT3 int3 1135 #define INTO into 1136 #define IRET iret 1137 #define IRETD iretd 1138 #define JA(a) ja NEAR a 1139 #define JAE(a) jae NEAR a 1140 #define JB(a) jb NEAR a 1141 #define JBE(a) jbe NEAR a 1142 #define JC(a) jc NEAR a 1143 #define JE(a) je NEAR a 1144 #define JG(a) jg NEAR a 1145 #define JGE(a) jge NEAR a 1146 #define JL(a) jl NEAR a 1147 #define JLE(a) jle NEAR a 1148 #define JNA(a) jna NEAR a 1149 #define JNAE(a) jnae NEAR a 1150 #define JNB(a) jnb NEAR a 1151 #define JNBE(a) jnbe NEAR a 1152 #define JNC(a) jnc NEAR a 1153 #define JNE(a) jne NEAR a 1154 #define JNG(a) jng NEAR a 1155 #define JNGE(a) jnge NEAR a 1156 #define JNL(a) jnl NEAR a 1157 #define JNLE(a) jnle NEAR a 1158 #define JNO(a) jno NEAR a 1159 #define JNP(a) jnp NEAR a 1160 #define JNS(a) jns NEAR a 1161 #define JNZ(a) jnz NEAR a 1162 #define JO(a) jo NEAR a 1163 #define JP(a) jp NEAR a 1164 #define JPE(a) jpe NEAR a 1165 #define JPO(a) jpo NEAR a 1166 #define JS(a) js NEAR a 1167 #define JZ(a) jz NEAR a 1168 #define JMP(a) jmp a 1169 #define JMPF(s,a) jmpf 1170 #define LAHF lahf 1171 #define LAR(a, b) lar b, a 1172 #define LEA_L(a, b) lea P_(b), P_(a) 1173 #define LEA_W(a, b) lea P_(b), P_(a) 1174 #define LEAVE leave 1175 #define LGDT(a) lgdt a 1176 #define LIDT(a) lidt a 1177 #define LDS(a, b) lds b, a 1178 #define LES(a, b) les b, a 1179 #define LFS(a, b) lfs b, a 1180 #define LGS(a, b) lgs b, a 1181 #define LSS(a, b) lss b, a 1182 #define LLDT(a) lldt a 1183 #define LMSW(a) lmsw a 1184 #define LOCK lock 1185 #define LODS_L lodsd 1186 #define LODS_W lodsw 1187 #define LODS_B lodsb 1188 #define LOOP(a) loop a 1189 #define LOOPE(a) loope a 1190 #define LOOPZ(a) loopz a 1191 #define LOOPNE(a) loopne a 1192 #define LOOPNZ(a) loopnz a 1193 #define LSL(a, b) lsl b, a 1194 #define LTR(a) ltr a 1195 #define MOV_SR(a, b) mov S_(b), S_(a) 1196 #define MOV_L(a, b) mov L_(b), L_(a) 1197 #define MOV_W(a, b) mov W_(b), W_(a) 1198 #define MOV_B(a, b) mov B_(b), B_(a) 1199 #define MOVS_L movsd 1200 #define MOVS_W movsw 1201 #define MOVS_B movsb 1202 #define MOVSX_BL(a, b) movsx B_(b), B_(a) 1203 #define MOVSX_BW(a, b) movsx B_(b), B_(a) 1204 #define MOVSX_WL(a, b) movsx W_(b), W_(a) 1205 #define MOVZX_BL(a, b) movzx B_(b), B_(a) 1206 #define MOVZX_BW(a, b) movzx B_(b), B_(a) 1207 #define MOVZX_WL(a, b) movzx W_(b), W_(a) 1208 #define MUL_L(a) mul L_(a) 1209 #define MUL_W(a) mul W_(a) 1210 #define MUL_B(a) mul B_(a) 1211 #define NEG_L(a) neg L_(a) 1212 #define NEG_W(a) neg W_(a) 1213 #define NEG_B(a) neg B_(a) 1214 #define NOP nop 1215 #define NOT_L(a) not L_(a) 1216 #define NOT_W(a) not W_(a) 1217 #define NOT_B(a) not B_(a) 1218 #define OR_L(a,b) or L_(b), L_(a) 1219 #define OR_W(a,b) or W_(b), W_(a) 1220 #define OR_B(a,b) or B_(b), B_(a) 1221 #define OUT_L out DX, EAX 1222 #define OUT_W out DX, AX 1223 #define OUT_B out DX, AL 1224 #define OUT1_L(a) out1 L_(a) 1225 #define OUT1_W(a) out1 W_(a) 1226 #define OUT1_B(a) out1 B_(a) 1227 #define OUTS_L outsd 1228 #define OUTS_W outsw 1229 #define OUTS_B outsb 1230 #define POP_SR(a) pop S_(a) 1231 #define POP_L(a) pop L_(a) 1232 #define POP_W(a) pop W_(a) 1233 #define POPA_L popad 1234 #define POPA_W popa 1235 #define POPF_L popfd 1236 #define POPF_W popf 1237 #define PUSH_SR(a) push S_(a) 1238 #define PUSH_L(a) push L_(a) 1239 #define PUSH_W(a) push W_(a) 1240 #define PUSH_B(a) push B_(a) 1241 #define PUSHA_L pushad 1242 #define PUSHA_W pusha 1243 #define PUSHF_L pushfd 1244 #define PUSHF_W pushf 1245 #define RCL_L(a, b) rcl L_(b), L_(a) 1246 #define RCL_W(a, b) rcl W_(b), W_(a) 1247 #define RCL_B(a, b) rcl B_(b), B_(a) 1248 #define RCR_L(a, b) rcr L_(b), L_(a) 1249 #define RCR_W(a, b) rcr W_(b), W_(a) 1250 #define RCR_B(a, b) rcr B_(b), B_(a) 1251 #define ROL_L(a, b) rol L_(b), L_(a) 1252 #define ROL_W(a, b) rol W_(b), W_(a) 1253 #define ROL_B(a, b) rol B_(b), B_(a) 1254 #define ROR_L(a, b) ror L_(b), L_(a) 1255 #define ROR_W(a, b) ror W_(b), W_(a) 1256 #define ROR_B(a, b) ror B_(b), B_(a) 1257 #define REP rep 1258 #define REPE repe 1259 #define REPNE repne 1260 #define REPNZ REPNE 1261 #define REPZ REPE 1262 #define RET ret 1263 #define SAHF sahf 1264 #define SAL_L(a, b) sal L_(b), L_(a) 1265 #define SAL_W(a, b) sal W_(b), W_(a) 1266 #define SAL_B(a, b) sal B_(b), B_(a) 1267 #define SAR_L(a, b) sar L_(b), L_(a) 1268 #define SAR_W(a, b) sar W_(b), W_(a) 1269 #define SAR_B(a, b) sar B_(b), B_(a) 1270 #define SBB_L(a, b) sbb L_(b), L_(a) 1271 #define SBB_W(a, b) sbb W_(b), W_(a) 1272 #define SBB_B(a, b) sbb B_(b), B_(a) 1273 #define SCAS_L scas 1274 #define SCAS_W scas 1275 #define SCAS_B scas 1276 #define SETA(a) seta a 1277 #define SETAE(a) setae a 1278 #define SETB(a) setb a 1279 #define SETBE(a) setbe a 1280 #define SETC(a) setc a 1281 #define SETE(a) sete a 1282 #define SETG(a) setg a 1283 #define SETGE(a) setge a 1284 #define SETL(a) setl a 1285 #define SETLE(a) setle a 1286 #define SETNA(a) setna a 1287 #define SETNAE(a) setnae a 1288 #define SETNB(a) setnb a 1289 #define SETNBE(a) setnbe a 1290 #define SETNC(a) setnc a 1291 #define SETNE(a) setne a 1292 #define SETNG(a) setng a 1293 #define SETNGE(a) setnge a 1294 #define SETNL(a) setnl a 1295 #define SETNLE(a) setnle a 1296 #define SETNO(a) setno a 1297 #define SETNP(a) setnp a 1298 #define SETNS(a) setns a 1299 #define SETNZ(a) setnz a 1300 #define SETO(a) seto a 1301 #define SETP(a) setp a 1302 #define SETPE(a) setpe a 1303 #define SETPO(a) setpo a 1304 #define SETS(a) sets a 1305 #define SETZ(a) setz a 1306 #define SGDT(a) sgdt a 1307 #define SIDT(a) sidt a 1308 #define SHL_L(a, b) shl L_(b), L_(a) 1309 #define SHL_W(a, b) shl W_(b), W_(a) 1310 #define SHL_B(a, b) shl B_(b), B_(a) 1311 #define SHLD_L(a,b,c) shld 1312 #define SHLD2_L(a,b) shld L_(b), L_(a) 1313 #define SHLD_W(a,b,c) shld 1314 #define SHLD2_W(a,b) shld W_(b), W_(a) 1315 #define SHR_L(a, b) shr L_(b), L_(a) 1316 #define SHR_W(a, b) shr W_(b), W_(a) 1317 #define SHR_B(a, b) shr B_(b), B_(a) 1318 #define SHRD_L(a,b,c) shrd 1319 #define SHRD2_L(a,b) shrd L_(b), L_(a) 1320 #define SHRD_W(a,b,c) shrd 1321 #define SHRD2_W(a,b) shrd W_(b), W_(a) 1322 #define SLDT(a) sldt a 1323 #define SMSW(a) smsw a 1324 #define STC stc 1325 #define STD std 1326 #define STI sti 1327 #define STOS_L stos 1328 #define STOS_W stos 1329 #define STOS_B stos 1330 #define STR(a) str a 1331 #define SUB_L(a, b) sub L_(b), L_(a) 1332 #define SUB_W(a, b) sub W_(b), W_(a) 1333 #define SUB_B(a, b) sub B_(b), B_(a) 1334 #define TEST_L(a, b) test L_(b), L_(a) 1335 #define TEST_W(a, b) test W_(b), W_(a) 1336 #define TEST_B(a, b) test B_(b), B_(a) 1337 #define VERR(a) verr a 1338 #define VERW(a) verw a 1339 #define WAIT wait 1340 #define XCHG_L(a, b) xchg L_(b), L_(a) 1341 #define XCHG_W(a, b) xchg W_(b), W_(a) 1342 #define XCHG_B(a, b) xchg B_(b), B_(a) 1343 #define XLAT xlat 1344 #define XOR_L(a, b) xor L_(b), L_(a) 1345 #define XOR_W(a, b) xor W_(b), W_(a) 1346 #define XOR_B(a, b) xor B_(b), B_(a) 1347 #define F2XM1 f2xm1 1348 #define FABS fabs 1349 #define FADD_D(a) fadd D_(a) 1350 #define FADD_S(a) fadd S_(a) 1351 #define FADD2(a, b) fadd b, a 1352 #define FADDP(a, b) faddp b, a 1353 #define FIADD_L(a) fiadd L_(a) 1354 #define FIADD_W(a) fiadd W_(a) 1355 #define FBLD(a) fbld a 1356 #define FBSTP(a) fbstp a 1357 #define FCHS fchs 1358 #define FCLEX fclex 1359 #define FNCLEX fnclex 1360 #define FCOM(a) fcom a 1361 #define FCOM_D(a) fcom D_(a) 1362 #define FCOM_S(a) fcom S_(a) 1363 #define FCOMP(a) fcomp a 1364 #define FCOMP_D(a) fcomp D_(a) 1365 #define FCOMP_S(a) fcomp S_(a) 1366 #define FCOMPP fcompp 1367 #define FCOS fcos 1368 #define FDECSTP fdecstp 1369 #define FDIV_D(a) fdiv D_(a) 1370 #define FDIV_S(a) fdiv S_(a) 1371 #define FDIV2(a, b) fdiv b, a 1372 #define FDIVP(a, b) fdivp b, a 1373 #define FIDIV_L(a) fidiv L_(a) 1374 #define FIDIV_W(a) fidiv W_(a) 1375 #define FDIVR_D(a) fdivr D_(a) 1376 #define FDIVR_S(a) fdivr S_(a) 1377 #define FDIVR2(a, b) fdivr b, a 1378 #define FDIVRP(a, b) fdivrp b, a 1379 #define FIDIVR_L(a) fidivr L_(a) 1380 #define FIDIVR_W(a) fidivr W_(a) 1381 #define FFREE(a) ffree a 1382 #define FICOM_L(a) ficom L_(a) 1383 #define FICOM_W(a) ficom W_(a) 1384 #define FICOMP_L(a) ficomp L_(a) 1385 #define FICOMP_W(a) ficomp W_(a) 1386 #define FILD_Q(a) fild D_(a) 1387 #define FILD_L(a) fild L_(a) 1388 #define FILD_W(a) fild W_(a) 1389 #define FINCSTP fincstp 1390 #define FINIT finit 1391 #define FNINIT fninit 1392 #define FIST_L(a) fist L_(a) 1393 #define FIST_W(a) fist W_(a) 1394 #define FISTP_Q(a) fistp D_(a) 1395 #define FISTP_L(a) fistp L_(a) 1396 #define FISTP_W(a) fistp W_(a) 1397 #define FLD_X(a) fld X_(a) 1398 #define FLD_D(a) fld D_(a) 1399 #define FLD_S(a) fld S_(a) 1400 #define FLD1 fld1 1401 #define FLDL2T fldl2t 1402 #define FLDL2E fldl2e 1403 #define FLDPI fldpi 1404 #define FLDLG2 fldlg2 1405 #define FLDLN2 fldln2 1406 #define FLDZ fldz 1407 #define FLDCW(a) fldcw a 1408 #define FLDENV(a) fldenv a 1409 #define FMUL_S(a) fmul S_(a) 1410 #define FMUL_D(a) fmul D_(a) 1411 #define FMUL2(a, b) fmul b, a 1412 #define FMULP(a, b) fmulp b, a 1413 #define FIMUL_L(a) fimul L_(a) 1414 #define FIMUL_W(a) fimul W_(a) 1415 #define FNOP fnop 1416 #define FPATAN fpatan 1417 #define FPREM fprem 1418 #define FPREM1 fprem1 1419 #define FPTAN fptan 1420 #define FRNDINT frndint 1421 #define FRSTOR(a) frstor a 1422 #define FSAVE(a) fsave a 1423 #define FNSAVE(a) fnsave a 1424 #define FSCALE fscale 1425 #define FSIN fsin 1426 #define FSINCOS fsincos 1427 #define FSQRT fsqrt 1428 #define FST_D(a) fst D_(a) 1429 #define FST_S(a) fst S_(a) 1430 #define FSTP_X(a) fstp X_(a) 1431 #define FSTP_D(a) fstp D_(a) 1432 #define FSTP_S(a) fstp S_(a) 1433 #define FSTP(a) fstp a 1434 #define FSTCW(a) fstcw a 1435 #define FNSTCW(a) fnstcw a 1436 #define FSTENV(a) fstenv a 1437 #define FNSTENV(a) fnstenv a 1438 #define FSTSW(a) fstsw a 1439 #define FNSTSW(a) fnstsw a 1440 #define FSUB_S(a) fsub S_(a) 1441 #define FSUB_D(a) fsub D_(a) 1442 #define FSUB2(a, b) fsub b, a 1443 #define FSUBP(a, b) fsubp b, a 1444 #define FISUB_L(a) fisub L_(a) 1445 #define FISUB_W(a) fisub W_(a) 1446 #define FSUBR_S(a) fsubr S_(a) 1447 #define FSUBR_D(a) fsubr D_(a) 1448 #define FSUBR2(a, b) fsubr b, a 1449 #define FSUBRP(a, b) fsubrp b, a 1450 #define FISUBR_L(a) fisubr L_(a) 1451 #define FISUBR_W(a) fisubr W_(a) 1452 #define FTST ftst 1453 #define FUCOM(a) fucom a 1454 #define FUCOMP(a) fucomp a 1455 #define FUCOMPP fucompp 1456 #define FWAIT fwait 1457 #define FXAM fxam 1458 #define FXCH(a) fxch a 1459 #define FXTRACT fxtract 1460 #define FYL2X fyl2x 1461 #define FYL2XP1 fyl2xp1 1443 1462 1444 1463 /* New instructions */ 1445 #define CPUIDD_BYTE 15, 1621446 #define RDTSCD_BYTE 15, 491464 #define CPUID D_BYTE 15, 162 1465 #define RDTSC D_BYTE 15, 49 1447 1466 1448 1467 #endif /* NASM_ASSEMBLER, MASM_ASSEMBLER */ 1449 1468 1450 1451 /**/1452 /* Extensions to x86 insn set -*/1453 /* MMX, 3DNow!*/1454 /**/1455 1469 /****************************************/ 1470 /* */ 1471 /* Extensions to x86 insn set - */ 1472 /* MMX, 3DNow! */ 1473 /* */ 1474 /****************************************/ 1456 1475 1457 1476 #if defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER) 1458 #define P_ARG1(a) 1459 #define P_ARG2(a, b) 1460 #define P_ARG3(a, b, c) 1477 #define P_ARG1(a) P_ ## a 1478 #define P_ARG2(a, b) P_ ## b, P_ ## a 1479 #define P_ARG3(a, b, c) P_ ## c, P_ ## b, P_ ## a 1461 1480 #else 1462 #define P_ARG1(a) 1463 #define P_ARG2(a, b) 1464 #define P_ARG3(a, b, c) 1481 #define P_ARG1(a) a 1482 #define P_ARG2(a, b) a, b 1483 #define P_ARG3(a, b, c) a, b, c 1465 1484 #endif 1466 1485 1467 1486 /* MMX */ 1468 #define MOVD(a, b) 1469 #define MOVQ(a, b) 1470 1471 #define PADDB(a, b) 1472 #define PADDW(a, b) 1473 #define PADDD(a, b) 1474 1475 #define PADDSB(a, b) 1476 #define PADDSW(a, b) 1477 1478 #define PADDUSB(a, b) 1479 #define PADDUSW(a, b) 1480 1481 #define PSUBB(a, b) 1482 #define PSUBW(a, b) 1483 #define PSUBD(a, b) 1484 1485 #define PSUBSB(a, b) 1486 #define PSUBSW(a, b) 1487 1488 #define PSUBUSB(a, b) 1489 #define PSUBUSW(a, b) 1490 1491 #define PCMPEQB(a, b) 1492 #define PCMPEQW(a, b) 1493 #define PCMPEQD(a, b) 1494 1495 #define PCMPGTB(a, b) 1496 #define PCMPGTW(a, b) 1497 #define PCMPGTD(a, b) 1498 1499 #define PMULHW(a, b) 1500 #define PMULLW(a, b) 1501 1502 #define PMADDWD(a, b) 1503 1504 #define PAND(a, b) 1505 1506 #define PANDN(a, b) 1507 1508 #define POR(a, b) 1509 1510 #define PXOR(a, b) 1511 1512 #define PSRAW(a, b) 1513 #define PSRAD(a, b) 1514 1515 #define PSRLW(a, b) 1516 #define PSRLD(a, b) 1517 #define PSRLQ(a, b) 1518 1519 #define PSLLW(a, b) 1520 #define PSLLD(a, b) 1521 #define PSLLQ(a, b) 1522 1523 #define PACKSSWB(a, b) 1524 #define PACKSSDW(a, b) 1525 #define PACKUSWB(a, b) 1526 1527 #define PUNPCKHBW(a, b) 1528 #define PUNPCKHWD(a, b) 1529 #define PUNPCKHDQ(a, b) 1530 #define PUNPCKLBW(a, b) 1531 #define PUNPCKLWD(a, b) 1532 #define PUNPCKLDQ(a, b) 1533 1534 #define EMMS 1487 #define MOVD(a, b) movd P_ARG2(a, b) 1488 #define MOVQ(a, b) movq P_ARG2(a, b) 1489 1490 #define PADDB(a, b) paddb P_ARG2(a, b) 1491 #define PADDW(a, b) paddw P_ARG2(a, b) 1492 #define PADDD(a, b) paddd P_ARG2(a, b) 1493 1494 #define PADDSB(a, b) paddsb P_ARG2(a, b) 1495 #define PADDSW(a, b) paddsw P_ARG2(a, b) 1496 1497 #define PADDUSB(a, b) paddusb P_ARG2(a, b) 1498 #define PADDUSW(a, b) paddusw P_ARG2(a, b) 1499 1500 #define PSUBB(a, b) psubb P_ARG2(a, b) 1501 #define PSUBW(a, b) psubw P_ARG2(a, b) 1502 #define PSUBD(a, b) psubd P_ARG2(a, b) 1503 1504 #define PSUBSB(a, b) psubsb P_ARG2(a, b) 1505 #define PSUBSW(a, b) psubsw P_ARG2(a, b) 1506 1507 #define PSUBUSB(a, b) psubusb P_ARG2(a, b) 1508 #define PSUBUSW(a, b) psubusw P_ARG2(a, b) 1509 1510 #define PCMPEQB(a, b) pcmpeqb P_ARG2(a, b) 1511 #define PCMPEQW(a, b) pcmpeqw P_ARG2(a, b) 1512 #define PCMPEQD(a, b) pcmpeqd P_ARG2(a, b) 1513 1514 #define PCMPGTB(a, b) pcmpgtb P_ARG2(a, b) 1515 #define PCMPGTW(a, b) pcmpgtw P_ARG2(a, b) 1516 #define PCMPGTD(a, b) pcmpgtd P_ARG2(a, b) 1517 1518 #define PMULHW(a, b) pmulhw P_ARG2(a, b) 1519 #define PMULLW(a, b) pmullw P_ARG2(a, b) 1520 1521 #define PMADDWD(a, b) pmaddwd P_ARG2(a, b) 1522 1523 #define PAND(a, b) pand P_ARG2(a, b) 1524 1525 #define PANDN(a, b) pandn P_ARG2(a, b) 1526 1527 #define POR(a, b) por P_ARG2(a, b) 1528 1529 #define PXOR(a, b) pxor P_ARG2(a, b) 1530 1531 #define PSRAW(a, b) psraw P_ARG2(a, b) 1532 #define PSRAD(a, b) psrad P_ARG2(a, b) 1533 1534 #define PSRLW(a, b) psrlw P_ARG2(a, b) 1535 #define PSRLD(a, b) psrld P_ARG2(a, b) 1536 #define PSRLQ(a, b) psrlq P_ARG2(a, b) 1537 1538 #define PSLLW(a, b) psllw P_ARG2(a, b) 1539 #define PSLLD(a, b) pslld P_ARG2(a, b) 1540 #define PSLLQ(a, b) psllq P_ARG2(a, b) 1541 1542 #define PACKSSWB(a, b) packsswb P_ARG2(a, b) 1543 #define PACKSSDW(a, b) packssdw P_ARG2(a, b) 1544 #define PACKUSWB(a, b) packuswb P_ARG2(a, b) 1545 1546 #define PUNPCKHBW(a, b) punpckhbw P_ARG2(a, b) 1547 #define PUNPCKHWD(a, b) punpckhwd P_ARG2(a, b) 1548 #define PUNPCKHDQ(a, b) punpckhdq P_ARG2(a, b) 1549 #define PUNPCKLBW(a, b) punpcklbw P_ARG2(a, b) 1550 #define PUNPCKLWD(a, b) punpcklwd P_ARG2(a, b) 1551 #define PUNPCKLDQ(a, b) punpckldq P_ARG2(a, b) 1552 1553 #define EMMS emms 1535 1554 1536 1555 /* AMD 3DNow! */ 1537 #define PAVGUSB(a, b) pavgusb P_ARG2(a, b) 1538 #define PFADD(a, b) pfadd P_ARG2(a, b) 1539 #define PFSUB(a, b) pfsub P_ARG2(a, b) 1540 #define PFSUBR(a, b) pfsubr P_ARG2(a, b) 1541 #define PFACC(a, b) pfacc P_ARG2(a, b) 1542 #define PFCMPGE(a, b) pfcmpge P_ARG2(a, b) 1543 #define PFCMPGT(a, b) pfcmpgt P_ARG2(a, b) 1544 #define PFCMPEQ(a, b) pfcmpeq P_ARG2(a, b) 1545 #define PFMIN(a, b) pfmin P_ARG2(a, b) 1546 #define PFMAX(a, b) pfmax P_ARG2(a, b) 1547 #define PI2FD(a, b) pi2fd P_ARG2(a, b) 1548 #define PF2ID(a, b) pf2id P_ARG2(a, b) 1549 #define PFRCP(a, b) pfrcp P_ARG2(a, b) 1550 #define PFRSQRT(a, b) pfrsqrt P_ARG2(a, b) 1551 #define PFMUL(a, b) pfmul P_ARG2(a, b) 1552 #define PFRCPIT1(a, b) pfrcpit1 P_ARG2(a, b) 1553 #define PFRSQIT1(a, b) pfrsqit1 P_ARG2(a, b) 1554 #define PFRCPIT2(a, b) pfrcpit2 P_ARG2(a, b) 1555 #define PMULHRW(a, b) pmulhrw P_ARG2(a, b) 1556 1557 #define FEMMS femms 1558 #define PREFETCH(a) prefetch P_ARG1(a) 1556 #define PAVGUSB(a, b) pavgusb P_ARG2(a, b) 1557 #define PFADD(a, b) pfadd P_ARG2(a, b) 1558 #define PFSUB(a, b) pfsub P_ARG2(a, b) 1559 #define PFSUBR(a, b) pfsubr P_ARG2(a, b) 1560 #define PFACC(a, b) pfacc P_ARG2(a, b) 1561 #define PFCMPGE(a, b) pfcmpge P_ARG2(a, b) 1562 #define PFCMPGT(a, b) pfcmpgt P_ARG2(a, b) 1563 #define PFCMPEQ(a, b) pfcmpeq P_ARG2(a, b) 1564 #define PFMIN(a, b) pfmin P_ARG2(a, b) 1565 #define PFMAX(a, b) pfmax P_ARG2(a, b) 1566 #define PI2FD(a, b) pi2fd P_ARG2(a, b) 1567 #define PF2ID(a, b) pf2id P_ARG2(a, b) 1568 #define PFRCP(a, b) pfrcp P_ARG2(a, b) 1569 #define PFRSQRT(a, b) pfrsqrt P_ARG2(a, b) 1570 #define PFMUL(a, b) pfmul P_ARG2(a, b) 1571 #define PFRCPIT1(a, b) pfrcpit1 P_ARG2(a, b) 1572 #define PFRSQIT1(a, b) pfrsqit1 P_ARG2(a, b) 1573 #define PFRCPIT2(a, b) pfrcpit2 P_ARG2(a, b) 1574 #define PMULHRW(a, b) pmulhrw P_ARG2(a, b) 1575 1576 #define FEMMS femms 1577 #define PREFETCH(a) prefetch P_ARG1(a) 1578 #define PREFETCHW(a) prefetchw P_ARG1(a) 1559 1579 1560 1580 /* Intel SSE */ 1561 #define ADDPS(a, b) 1562 #define ADDSS(a, b) 1563 #define ANDNPS(a, b) 1564 #define ANDPS(a, b) 1581 #define ADDPS(a, b) addps P_ARG2(a, b) 1582 #define ADDSS(a, b) addss P_ARG2(a, b) 1583 #define ANDNPS(a, b) andnps P_ARG2(a, b) 1584 #define ANDPS(a, b) andps P_ARG2(a, b) 1565 1585 /* 1566 1586 NASM only knows the pseudo ops for these. 1567 #define CMPPS(a, b, c)cmpps P_ARG3(a, b, c)1568 #define CMPSS(a, b, c)cmpss P_ARG3(a, b, c)1587 #define CMPPS(a, b, c) cmpps P_ARG3(a, b, c) 1588 #define CMPSS(a, b, c) cmpss P_ARG3(a, b, c) 1569 1589 */ 1570 #define CMPEQPS(a, b) 1571 #define CMPLTPS(a, b) 1572 #define CMPLEPS(a, b) 1573 #define CMPUNORDPS(a, b) 1574 #define CMPNEQPS(a, b) 1575 #define CMPNLTPS(a, b) 1576 #define CMPNLEPS(a, b) 1577 #define CMPORDPS(a, b) 1578 #define CMPEQSS(a, b) 1579 #define CMPLTSS(a, b) 1580 #define CMPLESS(a, b) 1581 #define CMPUNORDSS(a, b) 1582 #define CMPNEQSS(a, b) 1583 #define CMPNLTSS(a, b) 1584 #define CMPNLESS(a, b) 1585 #define CMPORDSS(a, b) 1586 #define COMISS(a, b) 1587 #define CVTPI2PS(a, b) 1588 #define CVTPS2PI(a, b) 1589 #define CVTSI2SS(a, b) 1590 #define CVTSS2SI(a, b) 1591 #define CVTTPS2PI(a, b) 1592 #define CVTTSS2SI(a, b) 1593 #define DIVPS(a, b) 1594 #define DIVSS(a, b) 1595 #define FXRSTOR(a) 1596 #define FXSAVE(a) 1597 #define LDMXCSR(a) 1598 #define MAXPS(a, b) 1599 #define MAXSS(a, b) 1600 #define MINPS(a, b) 1601 #define MINSS(a, b) 1602 #define MOVAPS(a, b) 1603 #define MOVHLPS(a, b) 1604 #define MOVHPS(a, b) 1605 #define MOVLHPS(a, b) 1606 #define MOVLPS(a, b) 1607 #define MOVMSKPS(a, b) 1608 #define MOVSS(a, b) 1609 #define MOVUPS(a, b) 1610 #define MULPS(a, b) 1611 #define MULSS(a, b) 1612 #define ORPS(a, b) 1613 #define RCPPS(a, b) 1614 #define RCPSS(a, b) 1615 #define RSQRTPS(a, b) 1616 #define RSQRTSS(a, b) 1617 #define SHUFPS(a, b, c) 1618 #define SQRTPS(a, b) 1619 #define SQRTSS(a, b) 1620 #define STMXCSR(a) 1621 #define SUBPS(a, b) 1622 #define UCOMISS(a, b) 1623 #define UNPCKHPS(a, b) 1624 #define UNPCKLPS(a, b) 1625 #define XORPS(a, b) 1590 #define CMPEQPS(a, b) cmpeqps P_ARG2(a, b) 1591 #define CMPLTPS(a, b) cmpltps P_ARG2(a, b) 1592 #define CMPLEPS(a, b) cmpleps P_ARG2(a, b) 1593 #define CMPUNORDPS(a, b) cmpunordps P_ARG2(a, b) 1594 #define CMPNEQPS(a, b) cmpneqps P_ARG2(a, b) 1595 #define CMPNLTPS(a, b) cmpnltps P_ARG2(a, b) 1596 #define CMPNLEPS(a, b) cmpnleps P_ARG2(a, b) 1597 #define CMPORDPS(a, b) cmpordps P_ARG2(a, b) 1598 #define CMPEQSS(a, b) cmpeqss P_ARG2(a, b) 1599 #define CMPLTSS(a, b) cmpltss P_ARG2(a, b) 1600 #define CMPLESS(a, b) cmpless P_ARG2(a, b) 1601 #define CMPUNORDSS(a, b) cmpunordss P_ARG2(a, b) 1602 #define CMPNEQSS(a, b) cmpneqss P_ARG2(a, b) 1603 #define CMPNLTSS(a, b) cmpnltss P_ARG2(a, b) 1604 #define CMPNLESS(a, b) cmpnless P_ARG2(a, b) 1605 #define CMPORDSS(a, b) cmpordss P_ARG2(a, b) 1606 #define COMISS(a, b) comiss P_ARG2(a, b) 1607 #define CVTPI2PS(a, b) cvtpi2ps P_ARG2(a, b) 1608 #define CVTPS2PI(a, b) cvtps2pi P_ARG2(a, b) 1609 #define CVTSI2SS(a, b) cvtsi2ss P_ARG2(a, b) 1610 #define CVTSS2SI(a, b) cvtss2si P_ARG2(a, b) 1611 #define CVTTPS2PI(a, b) cvttps2pi P_ARG2(a, b) 1612 #define CVTTSS2SI(a, b) cvttss2si P_ARG2(a, b) 1613 #define DIVPS(a, b) divps P_ARG2(a, b) 1614 #define DIVSS(a, b) divss P_ARG2(a, b) 1615 #define FXRSTOR(a) fxrstor P_ARG1(a) 1616 #define FXSAVE(a) fxsave P_ARG1(a) 1617 #define LDMXCSR(a) ldmxcsr P_ARG1(a) 1618 #define MAXPS(a, b) maxps P_ARG2(a, b) 1619 #define MAXSS(a, b) maxss P_ARG2(a, b) 1620 #define MINPS(a, b) minps P_ARG2(a, b) 1621 #define MINSS(a, b) minss P_ARG2(a, b) 1622 #define MOVAPS(a, b) movaps P_ARG2(a, b) 1623 #define MOVHLPS(a, b) movhlps P_ARG2(a, b) 1624 #define MOVHPS(a, b) movhps P_ARG2(a, b) 1625 #define MOVLHPS(a, b) movlhps P_ARG2(a, b) 1626 #define MOVLPS(a, b) movlps P_ARG2(a, b) 1627 #define MOVMSKPS(a, b) movmskps P_ARG2(a, b) 1628 #define MOVSS(a, b) movss P_ARG2(a, b) 1629 #define MOVUPS(a, b) movups P_ARG2(a, b) 1630 #define MULPS(a, b) mulps P_ARG2(a, b) 1631 #define MULSS(a, b) mulss P_ARG2(a, b) 1632 #define ORPS(a, b) orps P_ARG2(a, b) 1633 #define RCPPS(a, b) rcpps P_ARG2(a, b) 1634 #define RCPSS(a, b) rcpss P_ARG2(a, b) 1635 #define RSQRTPS(a, b) rsqrtps P_ARG2(a, b) 1636 #define RSQRTSS(a, b) rsqrtss P_ARG2(a, b) 1637 #define SHUFPS(a, b, c) shufps P_ARG3(a, b, c) 1638 #define SQRTPS(a, b) sqrtps P_ARG2(a, b) 1639 #define SQRTSS(a, b) sqrtss P_ARG2(a, b) 1640 #define STMXCSR(a) stmxcsr P_ARG1(a) 1641 #define SUBPS(a, b) subps P_ARG2(a, b) 1642 #define UCOMISS(a, b) ucomiss P_ARG2(a, b) 1643 #define UNPCKHPS(a, b) unpckhps P_ARG2(a, b) 1644 #define UNPCKLPS(a, b) unpcklps P_ARG2(a, b) 1645 #define XORPS(a, b) xorps P_ARG2(a, b) 1626 1646 1627 1647 -
trunk/src/opengl/mesa/attrib.h
r2938 r3582 1 /* $Id: attrib.h,v 1. 1 2000-02-29 00:48:25 sandervlExp $ */1 /* $Id: attrib.h,v 1.2 2000-05-21 20:06:32 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_PushAttrib( GLcontext* ctx, GLbitfield mask ); 38 extern void 39 _mesa_PushAttrib( GLbitfield mask ); 39 40 40 extern void gl_PopAttrib( GLcontext* ctx ); 41 extern void 42 _mesa_PopAttrib( void ); 41 43 42 extern void gl_PushClientAttrib( GLcontext *ctx, GLbitfield mask ); 44 extern void 45 _mesa_PushClientAttrib( GLbitfield mask ); 43 46 44 extern void gl_PopClientAttrib( GLcontext *ctx ); 47 extern void 48 _mesa_PopClientAttrib( void ); 45 49 46 50 -
trunk/src/opengl/mesa/bitmap.h
r2938 r3582 1 /* $Id: bitmap.h,v 1. 1 2000-02-29 00:48:25 sandervlExp $ */1 /* $Id: bitmap.h,v 1.2 2000-05-21 20:08:12 jeroen Exp $ */ 2 2 3 3 /* … … 33 33 34 34 35 extern void gl_Bitmap( GLcontext *ctx, 36 GLsizei width, GLsizei height, 37 GLfloat xorig, GLfloat yorig, 38 GLfloat xmove, GLfloat ymove, 39 const GLubyte *bitmap, 40 const struct gl_pixelstore_attrib *packing ); 35 36 extern void 37 _mesa_Bitmap( GLsizei width, GLsizei height, 38 GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, 39 const GLubyte *bitmap ); 41 40 42 41 -
trunk/src/opengl/mesa/blend.h
r2938 r3582 1 /* $Id: blend.h,v 1. 1 2000-02-29 00:48:25 sandervlExp $ */1 /* $Id: blend.h,v 1.2 2000-05-21 20:10:29 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 38 38 39 39 extern void 40 gl_blend_span( GLcontext *ctx, GLuint n, GLint x, GLint y,41 GLubyte rgba[][4], const GLubyte mask[] );40 _mesa_blend_span( GLcontext *ctx, GLuint n, GLint x, GLint y, 41 GLubyte rgba[][4], const GLubyte mask[] ); 42 42 43 43 44 44 extern void 45 gl_blend_pixels( GLcontext *ctx,46 GLuint n, const GLint x[], const GLint y[],47 GLubyte rgba[][4], const GLubyte mask[] );45 _mesa_blend_pixels( GLcontext *ctx, 46 GLuint n, const GLint x[], const GLint y[], 47 GLubyte rgba[][4], const GLubyte mask[] ); 48 48 49 49 50 50 extern void 51 gl_BlendFunc( GLcontext *ctx,GLenum sfactor, GLenum dfactor );51 _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ); 52 52 53 53 54 54 extern void 55 gl_BlendFuncSeparate( GLcontext *ctx,GLenum sfactorRGB, GLenum dfactorRGB,56 GLenum sfactorA, GLenum dfactorA );55 _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, 56 GLenum sfactorA, GLenum dfactorA ); 57 57 58 58 59 59 extern void 60 gl_BlendEquation( GLcontext *ctx,GLenum mode );60 _mesa_BlendEquation( GLenum mode ); 61 61 62 62 63 63 extern void 64 gl_BlendColor( GLcontext *ctx, GLclampf red, GLclampf green, 65 GLclampf blue, GLclampf alpha ); 64 _mesa_BlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); 66 65 67 66 -
trunk/src/opengl/mesa/clip.h
r2938 r3582 1 /* $Id: clip.h,v 1. 1 2000-02-29 00:48:26 sandervlExp $ */1 /* $Id: clip.h,v 1.2 2000-05-21 20:14:08 jeroen Exp $ */ 2 2 3 3 /* … … 40 40 # define GL_VIEWCLIP_POINT( V ) gl_viewclip_point( V ) 41 41 #else 42 # define GL_VIEWCLIP_POINT( V ) 43 ( (V)[0] <= (V)[3] && (V)[0] >= -(V)[3] 44 && (V)[1] <= (V)[3] && (V)[1] >= -(V)[3] 42 # define GL_VIEWCLIP_POINT( V ) \ 43 ( (V)[0] <= (V)[3] && (V)[0] >= -(V)[3] \ 44 && (V)[1] <= (V)[3] && (V)[1] >= -(V)[3] \ 45 45 && (V)[2] <= (V)[3] && (V)[2] >= -(V)[3] ) 46 46 #endif … … 64 64 65 65 66 extern void gl_ClipPlane( GLcontext* ctx, 67 GLenum plane, const GLfloat *equation ); 66 extern void _mesa_ClipPlane( GLenum plane, const GLdouble *equation ); 68 67 69 extern void gl_GetClipPlane( GLcontext* ctx, 70 GLenum plane, GLdouble *equation ); 68 extern void _mesa_GetClipPlane( GLenum plane, GLdouble *equation ); 71 69 72 70 -
trunk/src/opengl/mesa/clip_funcs.h
r2938 r3582 1 /* $Id: clip_funcs.h,v 1. 1 2000-02-29 00:48:26 sandervlExp $ */1 /* $Id: clip_funcs.h,v 1.2 2000-05-21 20:15:38 jeroen Exp $ */ 2 2 3 3 /* … … 30 30 31 31 static GLuint TAG(userclip_line)( struct vertex_buffer *VB, 32 32 GLuint *i, GLuint *j ); 33 33 static GLuint TAG(userclip_polygon)( struct vertex_buffer *VB, 34 34 GLuint n, GLuint vlist[] ); 35 35 36 36 … … 39 39 */ 40 40 static GLuint TAG(viewclip_line)( struct vertex_buffer *VB, 41 42 41 GLuint *i, GLuint *j, 42 GLubyte mask ) 43 43 { 44 44 GLfloat (*coord)[4] = VB->ClipPtr->data; … … 55 55 * macros apprpriately. 56 56 */ 57 #define GENERAL_CLIP 58 if (mask & PLANE) { 59 GLuint flagI = INSIDE( ii ); 60 GLuint flagJ = INSIDE( jj ); 61 62 if (!(flagI|flagJ)) 63 return 0;\64 65 if (flagI ^ flagJ) { 66 COMPUTE_INTERSECTION( jj, ii, vb_free );\67 interp( VB, vb_free, t, jj, ii);\68 69 if (flagI) {\70 VB->ClipMask[jj] |= PLANE; 71 jj = vb_free;\72 } else {\73 VB->ClipMask[ii] |= PLANE; 74 ii = vb_free;\75 }\76 77 VB->ClipMask[vb_free++] = 0; 78 } 57 #define GENERAL_CLIP \ 58 if (mask & PLANE) { \ 59 GLuint flagI = INSIDE( ii ); \ 60 GLuint flagJ = INSIDE( jj ); \ 61 \ 62 if (!(flagI|flagJ)) \ 63 return 0; \ 64 \ 65 if (flagI ^ flagJ) { \ 66 COMPUTE_INTERSECTION( jj, ii, vb_free ); \ 67 interp( VB, vb_free, t, jj, ii); \ 68 \ 69 if (flagI) { \ 70 VB->ClipMask[jj] |= PLANE; \ 71 jj = vb_free; \ 72 } else { \ 73 VB->ClipMask[ii] |= PLANE; \ 74 ii = vb_free; \ 75 } \ 76 \ 77 VB->ClipMask[vb_free++] = 0; \ 78 } \ 79 79 } 80 80 … … 85 85 if (mask & CLIP_USER_BIT) { 86 86 if ( TAG(userclip_line)( VB, &ii, &jj ) == 0 ) 87 87 return 0; 88 88 } 89 89 … … 107 107 108 108 for (i = 0; i < n; i++) { 109 110 111 112 113 114 115 116 117 118 119 120 121 109 j = vlist[i]; 110 if (j >= start) { 111 if (W(j) != 0.0F) { 112 GLfloat wInv = 1.0F / W(j); 113 win[j][0] = X(j) * wInv * sx + tx; 114 win[j][1] = Y(j) * wInv * sy + ty; 115 win[j][2] = Z(j) * wInv * sz + tz; 116 win[j][3] = wInv; 117 } else { 118 win[j][0] = win[j][1] = win[j][2] = 0.0F; 119 win[j][3] = 1.0F; 120 } 121 } 122 122 } 123 123 } … … 138 138 */ 139 139 static GLuint TAG(viewclip_polygon)( struct vertex_buffer *VB, 140 141 140 GLuint n, GLuint vlist[], 141 GLubyte mask ) 142 142 { 143 143 GLfloat (*coord)[4] = VB->ClipPtr->data; … … 151 151 if (mask & CLIP_ALL_BITS) { 152 152 153 #define GENERAL_CLIP \ 154 if (mask & PLANE) { \ 155 GLuint prevj = inlist[n-1]; \ 156 GLuint prevflag = INSIDE(prevj); \ 157 GLuint outcount = 0; \ 158 GLuint ef_state = 3; \ 159 GLuint i; \ 160 \ 161 \ 162 for (i = 0; i < n; i++) { \ 163 GLuint j = inlist[i]; \ 164 GLuint flag = INSIDE(j); \ 165 \ 166 if (flag ^ prevflag) { \ 167 if (flag) { \ 168 /* Coming back in \ 169 */ \ 170 COMPUTE_INTERSECTION( j, prevj, vb_free ); \ 171 interp( VB, vb_free, t, j, prevj ); \ 172 \ 173 if (IND&CLIP_TAB_EDGEFLAG) \ 174 VB->EdgeFlagPtr->data[vb_free] = \ 175 VB->EdgeFlagPtr->data[prevj] & ef_state; \ 176 \ 177 \ 178 } else { \ 179 /* Going out of bounds \ 180 */ \ 181 COMPUTE_INTERSECTION( prevj, j, vb_free ); \ 182 interp( VB, vb_free, t, prevj, j ); \ 183 \ 184 if (IND&CLIP_TAB_EDGEFLAG) \ 185 VB->EdgeFlagPtr->data[vb_free] = 1; \ 186 } \ 187 \ 188 outlist[outcount++] = vb_free; \ 189 VB->ClipMask[vb_free++] = 0; \ 190 } \ 191 \ 192 if (flag) { \ 193 outlist[outcount++] = j; \ 194 } else { \ 195 VB->ClipMask[j] |= (PLANE&CLIP_ALL_BITS); /* don't setup */ \ 196 } \ 197 prevj = j; \ 198 prevflag = flag; \ 199 ef_state = 1; \ 200 } \ 201 \ 202 if (outcount < 3) \ 203 return 0; \ 204 else { \ 205 GLuint *tmp = inlist; \ 206 inlist = outlist; \ 207 outlist = tmp; \ 208 n = outcount; \ 209 } \ 153 #define GENERAL_CLIP \ 154 if (mask & PLANE) { \ 155 GLuint prevj = inlist[0]; \ 156 GLuint prevflag = INSIDE(prevj); \ 157 GLuint outcount = 0; \ 158 GLuint i; \ 159 \ 160 inlist[n] = inlist[0]; \ 161 \ 162 for (i = 1; i < n+1; i++) { \ 163 GLuint j = inlist[i]; \ 164 GLuint flag = INSIDE(j); \ 165 \ 166 if (prevflag) { \ 167 outlist[outcount++] = prevj; \ 168 } else { \ 169 VB->ClipMask[prevj] |= (PLANE&CLIP_ALL_BITS); \ 170 } \ 171 \ 172 if (flag ^ prevflag) { \ 173 if (flag) { \ 174 /* Coming back in \ 175 */ \ 176 COMPUTE_INTERSECTION( j, prevj, vb_free ); \ 177 interp( VB, vb_free, t, j, prevj ); \ 178 \ 179 if (IND&CLIP_TAB_EDGEFLAG) \ 180 VB->EdgeFlagPtr->data[vb_free] = \ 181 VB->EdgeFlagPtr->data[prevj]; \ 182 \ 183 \ 184 } else { \ 185 /* Going out of bounds \ 186 */ \ 187 COMPUTE_INTERSECTION( prevj, j, vb_free ); \ 188 interp( VB, vb_free, t, prevj, j ); \ 189 \ 190 if (IND&CLIP_TAB_EDGEFLAG) { \ 191 VB->EdgeFlagPtr->data[vb_free] = 3; \ 192 } \ 193 } \ 194 \ 195 if (IND&CLIP_TAB_EDGEFLAG) { \ 196 /* Demote trailing edge to internal edge. \ 197 */ \ 198 if (outcount && \ 199 (VB->EdgeFlagPtr->data[outlist[outcount-1]] & 0x2)) \ 200 VB->EdgeFlagPtr->data[outlist[outcount-1]] = 1; \ 201 } \ 202 \ 203 outlist[outcount++] = vb_free; \ 204 VB->ClipMask[vb_free++] = 0; \ 205 } \ 206 \ 207 prevj = j; \ 208 prevflag = flag; \ 209 } \ 210 \ 211 if (outcount < 3) \ 212 return 0; \ 213 else { \ 214 GLuint *tmp = inlist; \ 215 inlist = outlist; \ 216 outlist = tmp; \ 217 n = outcount; \ 218 } \ 210 219 } 211 220 … … 214 223 215 224 if (inlist != vlist) 216 217 225 for (i = 0 ; i < n ; i++) 226 vlist[i] = inlist[i]; 218 227 } 219 228 … … 241 250 242 251 for (i = 0; i < n; i++) { 243 244 245 246 247 248 249 250 251 252 253 254 255 252 GLuint j = vlist[i]; 253 if (j >= first) { 254 if (W(j) != 0.0F) { 255 GLfloat wInv = 1.0F / W(j); 256 win[j][0] = X(j) * wInv * sx + tx; 257 win[j][1] = Y(j) * wInv * sy + ty; 258 win[j][2] = Z(j) * wInv * sz + tz; 259 win[j][3] = wInv; 260 } else { 261 win[j][0] = win[j][1] = win[j][2] = 0.0; 262 win[j][3] = 1.0F; 263 } 264 } 256 265 } 257 266 } … … 271 280 272 281 static GLuint TAG(userclip_line)( struct vertex_buffer *VB, 273 282 GLuint *i, GLuint *j ) 274 283 { 275 284 GLcontext *ctx = VB->ctx; … … 283 292 for (p=0;p<MAX_CLIP_PLANES;p++) { 284 293 if (ctx->Transform.ClipEnabled[p]) { 285 286 287 288 289 290 291 294 GLfloat a = ctx->Transform.ClipUserPlane[p][0]; 295 GLfloat b = ctx->Transform.ClipUserPlane[p][1]; 296 GLfloat c = ctx->Transform.ClipUserPlane[p][2]; 297 GLfloat d = ctx->Transform.ClipUserPlane[p][3]; 298 299 GLfloat dpI = d*W(ii) + c*Z(ii) + b*Y(ii) + a*X(ii); 300 GLfloat dpJ = d*W(jj) + c*Z(jj) + b*Y(jj) + a*X(jj); 292 301 293 302 GLuint flagI = OUTSIDE( dpI ); 294 303 GLuint flagJ = OUTSIDE( dpJ ); 295 304 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 305 if (flagI & flagJ) 306 return 0; 307 308 if (flagI ^ flagJ) { 309 GLfloat t = -dpI/(dpJ-dpI); 310 311 INTERP_SZ( t, coord, vb_free, ii, jj, SIZE ); 312 interp( VB, vb_free, t, ii, jj ); 313 314 if (flagI) { 315 VB->ClipMask[ii] |= CLIP_USER_BIT; 316 ii = vb_free; 317 } else { 318 VB->ClipMask[jj] |= CLIP_USER_BIT; 319 jj = vb_free; 320 } 321 322 VB->ClipMask[vb_free++] = 0; 314 323 } 315 324 } … … 324 333 325 334 static GLuint TAG(userclip_polygon)( struct vertex_buffer *VB, 326 335 GLuint n, GLuint vlist[] ) 327 336 { 328 337 GLcontext *ctx = VB->ctx; … … 336 345 for (p=0;p<MAX_CLIP_PLANES;p++) { 337 346 if (ctx->Transform.ClipEnabled[p]) { 338 register float a = ctx->Transform.ClipUserPlane[p][0]; 339 register float b = ctx->Transform.ClipUserPlane[p][1]; 340 register float c = ctx->Transform.ClipUserPlane[p][2]; 341 register float d = ctx->Transform.ClipUserPlane[p][3]; 342 343 /* initialize prev to be last in the input list */ 344 GLuint prevj = inlist[n - 1]; 345 GLfloat dpJ = d*W(prevj) + c*Z(prevj) + b*Y(prevj) + a*X(prevj); 346 GLuint flagJ = INSIDE(dpJ); 347 GLuint outcount = 0; 348 GLuint curri; 349 350 for (curri=0;curri<n;curri++) { 351 GLuint currj = inlist[curri]; 352 GLfloat dpI = d*W(currj) + c*Z(currj) + b*Y(currj) + a*X(currj); 347 register float a = ctx->Transform.ClipUserPlane[p][0]; 348 register float b = ctx->Transform.ClipUserPlane[p][1]; 349 register float c = ctx->Transform.ClipUserPlane[p][2]; 350 register float d = ctx->Transform.ClipUserPlane[p][3]; 351 352 /* initialize prev to be last in the input list */ 353 GLuint prevj = inlist[0]; 354 GLfloat dpJ = d*W(prevj) + c*Z(prevj) + b*Y(prevj) + a*X(prevj); 355 GLuint flagJ = INSIDE(dpJ); 356 GLuint outcount = 0; 357 GLuint curri; 358 359 inlist[n] = inlist[0]; 360 361 362 for (curri=1;curri<n+1;curri++) { 363 GLuint currj = inlist[curri]; 364 GLfloat dpI = d*W(currj) + c*Z(currj) + b*Y(currj) + a*X(currj); 353 365 GLuint flagI = INSIDE(dpI); 354 366 355 if (flagI ^ flagJ) { 356 GLfloat t; 357 GLuint in; 358 GLuint out; 359 360 if (flagI) { 361 out = prevj; 367 if (flagJ) { 368 outlist[outcount++] = prevj; 369 } else { 370 VB->ClipMask[prevj] |= CLIP_USER_BIT; 371 } 372 373 if (flagI ^ flagJ) { 374 GLfloat t; 375 GLuint in; 376 GLuint out; 377 378 if (flagI) { 379 out = prevj; 362 380 in = currj; 363 381 t = dpI/(dpI-dpJ); 364 382 365 366 367 368 369 383 if (IND&CLIP_TAB_EDGEFLAG) 384 VB->EdgeFlagPtr->data[vb_free] = 385 VB->EdgeFlagPtr->data[prevj]; 386 } else { 387 in = prevj; 370 388 out = currj; 371 389 t = dpJ/(dpJ-dpI); 372 390 373 if (IND&CLIP_TAB_EDGEFLAG) 374 VB->EdgeFlagPtr->data[vb_free] = 1; 375 } 376 377 INTERP_SZ( t, coord, vb_free, in, out, SIZE ); 378 interp( VB, vb_free, t, in, out); 379 outlist[outcount++] = vb_free; 380 VB->ClipMask[vb_free++] = 0; 391 if (IND&CLIP_TAB_EDGEFLAG) 392 VB->EdgeFlagPtr->data[vb_free] = 1; 393 } 394 395 if (IND&CLIP_TAB_EDGEFLAG) { 396 /* Demote trailing edge to internal edge. 397 */ 398 if (outcount && 399 (VB->EdgeFlagPtr->data[outlist[outcount-1]] & 0x2)) 400 VB->EdgeFlagPtr->data[outlist[outcount-1]] = 1; 401 } 402 403 INTERP_SZ( t, coord, vb_free, in, out, SIZE ); 404 interp( VB, vb_free, t, in, out); 405 outlist[outcount++] = vb_free; 406 VB->ClipMask[vb_free++] = 0; 381 407 } 382 408 383 if (flagI) { 384 outlist[outcount++] = currj; 385 } else { 386 VB->ClipMask[currj] |= CLIP_USER_BIT; 387 } 388 389 prevj = currj; 390 flagJ = flagI; 391 dpJ = dpI; 409 prevj = currj; 410 flagJ = flagI; 411 dpJ = dpI; 392 412 } 393 413 394 395 396 414 if (outcount < 3) 415 return 0; 416 else { 397 417 GLuint *tmp; 398 418 tmp = inlist; … … 408 428 GLuint i; 409 429 for (i = 0 ; i < n ; i++) 410 430 vlist[i] = inlist[i]; 411 431 } 412 432 -
trunk/src/opengl/mesa/clip_tmp.h
r2962 r3582 1 /* $Id: clip_tmp.h,v 1. 2 2000-03-01 18:49:24jeroen Exp $ */1 /* $Id: clip_tmp.h,v 1.3 2000-05-21 20:17:32 jeroen Exp $ */ 2 2 3 3 /* … … 36 36 * and an asm implementation needn't replicate that behaviour. 37 37 */ 38 static GLvector4f * _ _cdeclTAG(cliptest_points4)( GLvector4f *clip_vec,38 static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec, 39 39 GLvector4f *proj_vec, 40 40 GLubyte clipMask[], … … 101 101 } 102 102 103 static GLvector4f * _ _cdeclTAG(cliptest_points3)( GLvector4f *clip_vec,103 static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec, 104 104 GLvector4f *proj_vec, 105 105 GLubyte clipMask[], … … 135 135 } 136 136 137 static GLvector4f * _ _cdeclTAG(cliptest_points2)( GLvector4f *clip_vec,137 static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec, 138 138 GLvector4f *proj_vec, 139 139 GLubyte clipMask[], -
trunk/src/opengl/mesa/colortab.h
r2938 r3582 1 /* $Id: colortab.h,v 1. 1 2000-02-29 00:48:26 sandervlExp $ */1 /* $Id: colortab.h,v 1.2 2000-05-21 20:19:06 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_ColorTable( GLcontext *ctx, GLenum target, 39 GLenum internalformat, 40 struct gl_image *table ); 38 extern void 39 _mesa_ColorTable( GLenum target, GLenum internalformat, 40 GLsizei width, GLenum format, GLenum type, 41 const GLvoid *table ); 41 42 42 extern void gl_ColorSubTable( GLcontext *ctx, GLenum target, 43 GLsizei start, struct gl_image *data ); 43 extern void 44 _mesa_ColorSubTable( GLenum target, GLsizei start, 45 GLsizei count, GLenum format, GLenum type, 46 const GLvoid *table ); 44 47 45 extern void gl_GetColorTable( GLcontext *ctx, GLenum target, GLenum format, 46 GLenum type, GLvoid *table ); 48 extern void 49 _mesa_GetColorTable( GLenum target, GLenum format, 50 GLenum type, GLvoid *table ); 47 51 48 extern void gl_GetColorTableParameterfv( GLcontext *ctx, GLenum target,49 52 extern void 53 _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ); 50 54 51 extern void gl_GetColorTableParameteriv( GLcontext *ctx, GLenum target, 52 GLenum pname, GLint *params ); 55 extern void 56 _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ); 57 53 58 54 59 -
trunk/src/opengl/mesa/common_x86asm.h
r2938 r3582 1 /* $Id: common_x86asm.h,v 1. 1 2000-02-29 00:48:26 sandervlExp $ */1 /* $Id: common_x86asm.h,v 1.2 2000-05-21 20:20:44 jeroen Exp $ */ 2 2 3 3 /* … … 31 31 * 32 32 * Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de> 33 * Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the 34 * new Katmai functions 33 35 */ 34 36 #ifndef _common_3dnow_h … … 38 40 #define GL_CPU_MMX 2 39 41 #define GL_CPU_3Dnow 4 40 #define GL_CPU_AnyX86 8 /* set if x86 asm allowed */ 42 #define GL_CPU_Katmai 8 /* set if the katmai-instructions are available */ 43 #define GL_CPU_AnyX86 16 /* set if x86 asm allowed */ 41 44 42 45 #ifdef HAVE_CONFIG_H … … 46 49 #ifdef USE_X86_ASM 47 50 #include "x86.h" 48 #if defined(USE_3DNOW_ASM)51 #ifdef USE_3DNOW_ASM 49 52 #include "3dnow.h" 53 #endif 54 #ifdef USE_KATMAI_ASM 55 #include "katmai.h" 50 56 #endif 51 57 #endif -
trunk/src/opengl/mesa/config.h
r2962 r3582 1 /* $Id: config.h,v 1. 2 2000-03-01 18:49:24jeroen Exp $ */1 /* $Id: config.h,v 1.3 2000-05-21 20:24:21 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 98 98 #define MIN_LINE_WIDTH 1.0 99 99 #define MAX_LINE_WIDTH 10.0 100 #define LINE_WIDTH_GRANULARITY 1.0100 #define LINE_WIDTH_GRANULARITY 0.1 101 101 102 102 /* Max texture palette size */ … … 116 116 #define MAX_ARRAY_LOCK_SIZE 3000 117 117 118 119 /* 120 * 118 /* Subpixel precision for antialiasing, window coordinate snapping */ 119 #define SUB_PIXEL_BITS 4 120 121 122 123 /* 121 124 * Mesa-specific parameters 122 *123 125 */ 124 126 … … 130 132 131 133 132 #ifdef MESAD3D 133 /* Mesa / Direct3D driver only */ 134 extern float g_DepthScale, g_MaxDepth; 135 # define DEPTH_BITS 32 136 # define DEPTH_SCALE g_DepthScale 137 # define MAX_DEPTH g_MaxDepth 138 #else 139 /* 140 * Bits per depth buffer value: 16 or 32 141 */ 142 # define DEPTH_BITS 16 143 # if DEPTH_BITS==16 144 # define MAX_DEPTH 0xffff 145 # define DEPTH_SCALE 65535.0F 146 # elif DEPTH_BITS==32 147 # define MAX_DEPTH 0x3fffffff 148 # define DEPTH_SCALE ((GLfloat) MAX_DEPTH) 149 # else 150 # error "illegal number of depth bits" 151 # endif 152 #endif 134 /* 135 * Bits per depth buffer value: 16 or 32 (GLushort or GLuint) 136 * gl_create_visual() can select any depth in [0, 32]. 137 */ 138 #define DEFAULT_SOFTWARE_DEPTH_BITS 16 139 #define DEFAULT_SOFTWARE_DEPTH_TYPE GLushort 140 153 141 154 142 … … 163 151 */ 164 152 #define CHAN_BITS 8 165 153 #define CHAN_MAX ((1 << CHAN_BITS) - 1) 154 #define CHAN_MAXF ((GLfloat) CHAN_MAX) 166 155 167 156 … … 181 170 * value of 12n + 3. 182 171 */ 183 184 172 #define VB_START 3 185 173 186 #if defined(FX) && !defined(MITS) 187 # define VB_MAX 72 + VB_START /* better performance */ 188 #else 189 # define VB_MAX 480 + VB_START 190 #endif 174 #define VB_MAX (216 + VB_START) 175 176 191 177 192 178 /* … … 198 184 * sharing the vb). 199 185 */ 200 #define VB_MAX_CLIPPED_VERTS ( 2 * (6 + MAX_CLIP_PLANES))186 #define VB_MAX_CLIPPED_VERTS ((2 * (6 + MAX_CLIP_PLANES))+1) 201 187 #define VB_SIZE (VB_MAX + VB_MAX_CLIPPED_VERTS) 202 188 203 189 204 /*205 *206 * For X11 driver only:207 *208 */209 210 /*211 * When defined, use 6x6x6 dithering instead of 5x9x5.212 * 5x9x5 better for general colors, 6x6x6 better for grayscale.213 */214 /*#define DITHER666*/215 216 217 190 218 191 typedef struct gl_context GLcontext; 219 typedef struct gl_visual GLvisual; 220 typedef struct gl_frame_buffer GLframebuffer; 221 222 extern void gl_read_config_file( struct gl_context *ctx ); 192 /* typedef struct gl_visual GLvisual;*/ 193 /* typedef struct gl_frame_buffer GLframebuffer;*/ 194 195 extern void 196 gl_read_config_file( struct gl_context *ctx ); 197 198 extern void 199 gl_register_config_var(const char *name, void (*notify)( const char *, int )); 223 200 224 201 #endif -
trunk/src/opengl/mesa/context.h
r2970 r3582 1 /* $Id: context.h,v 1. 3 2000-03-02 13:27:30 sandervlExp $ */1 /* $Id: context.h,v 1.4 2000-05-21 20:26:33 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 34 34 35 35 #include "types.h" 36 37 #ifdef THREADS 38 /* 39 * A seperate GLcontext for each thread 40 */ 41 extern GLcontext *gl_get_thread_context( void ); 42 #else 43 /* 44 * All threads use same pointer to current context. 45 */ 46 extern GLcontext *CC; 47 extern struct immediate *CURRENT_INPUT; 48 #endif 49 50 36 #include "glapi.h" 51 37 52 38 /* … … 91 77 92 78 /* 79 * Create/destroy a GLframebuffer. A GLframebuffer is like a GLX drawable. 80 * It bundles up the depth buffer, stencil buffer and accum buffers into a 81 * single entity. 82 */ 83 extern GLframebuffer *gl_create_framebuffer( GLvisual *visual, 84 GLboolean softwareDepth, 85 GLboolean softwareStencil, 86 GLboolean softwareAccum, 87 GLboolean softwareAlpha ); 88 89 extern void gl_destroy_framebuffer( GLframebuffer *buffer ); 90 91 92 93 /* 93 94 * Create/destroy a GLcontext. A GLcontext is like a GLX context. It 94 95 * contains the rendering state. … … 99 100 GLboolean direct); 100 101 102 extern GLboolean gl_initialize_context_data( GLcontext *ctx, 103 GLvisual *visual, 104 GLcontext *share_list, 105 void *driver_ctx, 106 GLboolean direct ); 107 108 extern void gl_free_context_data( GLcontext *ctx ); 109 101 110 extern void gl_destroy_context( GLcontext *ctx ); 102 111 103 /* Called by the driver after both the context and driver are fully 104 * initialized. Currently just reads the config file. 105 */ 112 106 113 extern void gl_context_initialize( GLcontext *ctx ); 107 114 108 /* 109 * Create/destroy a GLframebuffer. A GLframebuffer is like a GLX drawable. 110 * It bundles up the depth buffer, stencil buffer and accum buffers into a 111 * single entity. 112 */ 113 extern GLframebuffer *gl_create_framebuffer( GLvisual *visual ); 114 115 extern void gl_destroy_framebuffer( GLframebuffer *buffer ); 116 115 116 extern void gl_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask); 117 117 118 118 119 119 extern void gl_make_current( GLcontext *ctx, GLframebuffer *buffer ); 120 120 121 122 extern void gl_make_current2( GLcontext *ctx, GLframebuffer *drawBuffer, 123 GLframebuffer *readBuffer ); 124 125 121 126 extern GLcontext *gl_get_current_context(void); 122 127 123 extern void gl_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask); 124 125 extern void gl_set_api_table( GLcontext *ctx, const struct gl_api_table *api ); 126 127 128 129 /* 130 * GL_MESA_resize_buffers extension 131 */ 132 extern void gl_ResizeBuffersMESA( GLcontext *ctx ); 128 129 /* 130 * Macros for fetching current context, input buffer, etc. 131 */ 132 #ifdef THREADS 133 134 #define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context()) 135 136 #define GET_IMMEDIATE struct immediate *IM = ((GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context()))->input 137 138 #define SET_IMMEDIATE(ctx, im) \ 139 do { \ 140 ctx->input = im; \ 141 } while (0) 142 143 #else 144 145 extern struct immediate *_mesa_CurrentInput; 146 147 #define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_Context 148 149 #define GET_IMMEDIATE struct immediate *IM = _mesa_CurrentInput 150 151 #define SET_IMMEDIATE(ctx, im) \ 152 do { \ 153 ctx->input = im; \ 154 _mesa_CurrentInput = im; \ 155 } while (0) 156 157 #endif 158 159 160 161 extern void 162 _mesa_swapbuffers(GLcontext *ctx); 163 164 165 extern struct _glapi_table * 166 _mesa_get_dispatch(GLcontext *ctx); 133 167 134 168 … … 143 177 144 178 extern void gl_error( GLcontext *ctx, GLenum error, const char *s ); 179 145 180 extern void gl_compile_error( GLcontext *ctx, GLenum error, const char *s ); 146 181 147 extern GLenum gl_GetError( GLcontext *ctx ); 148 149 150 extern void gl_update_state( GLcontext *ctx ); 151 152 153 /* for debugging */ 154 extern void gl_print_state( const char *msg, GLuint state ); 155 156 /* for debugging */ 157 extern void gl_print_enable_flags( const char *msg, GLuint flags ); 182 183 184 extern void 185 _mesa_Finish( void ); 186 187 extern void 188 _mesa_Flush( void ); 189 190 191 192 extern void 193 _mesa_init_no_op_table(struct _glapi_table *exec); 194 195 extern void 196 _mesa_init_exec_table(struct _glapi_table *exec); 197 158 198 159 199 -
trunk/src/opengl/mesa/copypix.h
r2938 r3582 1 /* $Id: copypix.h,v 1. 1 2000-02-29 00:48:27 sandervlExp $ */1 /* $Id: copypix.h,v 1.2 2000-05-21 20:27:55 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_CopyPixels( GLcontext* ctx, 39 GLint srcx, GLint srcy, 40 GLsizei width, GLsizei height, 41 GLenum type ); 38 extern void 39 _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, 40 GLenum type ); 42 41 43 42 -
trunk/src/opengl/mesa/cva.h
r2938 r3582 1 /* $Id: cva.h,v 1. 1 2000-02-29 00:48:28 sandervlExp $ */1 /* $Id: cva.h,v 1.2 2000-05-21 20:29:06 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 35 35 36 36 extern void gl_merge_cva( struct vertex_buffer *VB, 37 37 struct vertex_buffer *cvaVB ); 38 38 39 39 extern void gl_prepare_arrays_cva( struct vertex_buffer *cvaVB ); … … 50 50 extern void gl_cva_force_precalc( GLcontext *ctx ); 51 51 52 extern void gl_LockArrays( GLcontext *ctx, GLuint first, GLuint count );53 extern void gl_UnlockArrays( GLcontext *ctx );54 52 53 extern void 54 _mesa_LockArraysEXT(GLint first, GLsizei count); 55 55 56 extern void 57 _mesa_UnlockArraysEXT( void ); 56 58 57 59 #endif -
trunk/src/opengl/mesa/dd.h
r2938 r3582 1 /* $Id: dd.h,v 1. 1 2000-02-29 00:48:28 sandervlExp $ */1 /* $Id: dd.h,v 1.2 2000-05-21 20:30:06 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 119 119 120 120 121 /* Mask bits sent to the driver Clear() function */ 122 #define DD_FRONT_LEFT_BIT FRONT_LEFT_BIT /* 1 */ 123 #define DD_FRONT_RIGHT_BIT FRONT_RIGHT_BIT /* 2 */ 124 #define DD_BACK_LEFT_BIT BACK_LEFT_BIT /* 4 */ 125 #define DD_BACK_RIGHT_BIT BACK_RIGHT_BIT /* 8 */ 126 #define DD_DEPTH_BIT GL_DEPTH_BUFFER_BIT /* 0x00000100 */ 127 #define DD_STENCIL_BIT GL_STENCIL_BUFFER_BIT /* 0x00000400 */ 128 #define DD_ACCUM_BIT GL_ACCUM_BUFFER_BIT /* 0x00000200 */ 129 121 130 122 131 … … 131 140 **********************************************************************/ 132 141 133 const char * (*RendererString)(void); 134 /* 135 * Return a string which uniquely identifies this device driver. 136 * The string should contain no whitespace. Examples: "X11", "OffScreen", 137 * "MSWindows", "SVGA". 138 * NOTE: This function will be obsolete in favor of GetString in the future! 142 const GLubyte * (*GetString)( GLcontext *ctx, GLenum name ); 143 /* Return a string as needed by glGetString(). 144 * Only the GL_RENDERER token must be implemented. Otherwise, 145 * NULL can be returned. 139 146 */ 140 147 … … 162 169 GLint x, GLint y, GLint width, GLint height ); 163 170 /* Clear the color/depth/stencil/accum buffer(s). 164 * 'mask' indicates which buffers need to be cleared. Return a bitmask 165 * indicating which buffers weren't cleared by the driver function. 166 * If 'all' is true then the clear the whole buffer, else clear the 167 * region defined by (x,y,width,height). 171 * 'mask' is a bitmask of the DD_*_BIT values defined above that indicates 172 * which buffers need to be cleared. The driver should clear those 173 * buffers then return a new bitmask indicating which buffers should be 174 * cleared by software Mesa. 175 * If 'all' is true then the clear the whole buffer, else clear only the 176 * region defined by (x,y,width,height). 177 * This function must obey the glColorMask, glIndexMask and glStencilMask 178 * settings! Software Mesa can do masked clears if the device driver can't. 168 179 */ 169 180 … … 181 192 */ 182 193 183 GLboolean (*Set Buffer)( GLcontext *ctx, GLenum buffer );184 /* 185 * S elects the color buffer(s) for reading andwriting.194 GLboolean (*SetDrawBuffer)( GLcontext *ctx, GLenum buffer ); 195 /* 196 * Specifies the current buffer for writing. 186 197 * The following values must be accepted when applicable: 187 198 * GL_FRONT_LEFT - this buffer always exists … … 201 212 */ 202 213 214 void (*SetReadBuffer)( GLcontext *ctx, GLframebuffer *colorBuffer, 215 GLenum buffer ); 216 /* 217 * Specifies the current buffer for reading. 218 * colorBuffer will be one of: 219 * GL_FRONT_LEFT - this buffer always exists 220 * GL_BACK_LEFT - when double buffering 221 * GL_FRONT_RIGHT - when using stereo 222 * GL_BACK_RIGHT - when using stereo and double buffering 223 */ 224 203 225 void (*GetBufferSize)( GLcontext *ctx, GLuint *width, GLuint *height ); 204 226 /* … … 217 239 GLuint n, GLint x, GLint y, 218 240 CONST GLubyte rgb[][3], const GLubyte mask[] ); 219 /* Write a horizontal run of RGB[A] pixels. The later version is only 220 * used to accelerate GL_RGB, GL_UNSIGNED_BYTE glDrawPixels() calls. 241 /* Write a horizontal run of RGBA or RGB pixels. 221 242 * If mask is NULL, draw all pixels. 222 243 * If mask is not null, only draw pixel [i] when mask [i] is true. … … 305 326 *** fall-back function. *** 306 327 **********************************************************************/ 307 308 const char * (*ExtensionString)( GLcontext *ctx );309 /* Return a space-separated list of extensions for this driver.310 * NOTE: This function will be obsolete in favor of GetString in the future!311 */312 313 const GLubyte * (*GetString)( GLcontext *ctx, GLenum name );314 /* Return a string as needed by glGetString().315 * NOTE: This will replace the ExtensionString and RendererString316 * functions in the future!317 */318 328 319 329 void (*Finish)( GLcontext *ctx ); … … 381 391 /*** 382 392 *** For supporting hardware Z buffers: 393 *** Either ALL or NONE of these functions must be implemented! 394 *** NOTE that Each depth value is a 32-bit GLuint. If the depth 395 *** buffer is less than 32 bits deep then the extra upperbits are zero. 383 396 ***/ 384 397 385 void (*AllocDepthBuffer)( GLcontext *ctx ); 386 /* 387 * Called when the depth buffer must be allocated or possibly resized. 388 */ 389 390 GLuint (*DepthTestSpan)( GLcontext *ctx, 391 GLuint n, GLint x, GLint y, const GLdepth z[], 392 GLubyte mask[] ); 393 void (*DepthTestPixels)( GLcontext *ctx, 394 GLuint n, const GLint x[], const GLint y[], 395 const GLdepth z[], GLubyte mask[] ); 396 /* 397 * Apply the depth buffer test to an span/array of pixels and return 398 * an updated pixel mask. This function is not used when accelerated 399 * point, line, polygon functions are used. 400 */ 401 402 void (*ReadDepthSpanFloat)( GLcontext *ctx, 403 GLuint n, GLint x, GLint y, GLfloat depth[]); 404 void (*ReadDepthSpanInt)( GLcontext *ctx, 405 GLuint n, GLint x, GLint y, GLdepth depth[] ); 406 /* 407 * Return depth values as integers for glReadPixels. 408 * Floats should be returned in the range [0,1]. 409 * Ints (GLdepth) values should be in the range [0,MAXDEPTH]. 410 */ 398 void (*WriteDepthSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y, 399 const GLdepth depth[], const GLubyte mask[] ); 400 /* Write a horizontal span of values into the depth buffer. Only write 401 * depth[i] value if mask[i] is nonzero. 402 */ 403 404 void (*ReadDepthSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y, 405 GLdepth depth[] ); 406 /* Read a horizontal span of values from the depth buffer. 407 */ 408 409 410 void (*WriteDepthPixels)( GLcontext *ctx, GLuint n, 411 const GLint x[], const GLint y[], 412 const GLdepth depth[], const GLubyte mask[] ); 413 /* Write an array of randomly positioned depth values into the 414 * depth buffer. Only write depth[i] value if mask[i] is nonzero. 415 */ 416 417 void (*ReadDepthPixels)( GLcontext *ctx, GLuint n, 418 const GLint x[], const GLint y[], 419 GLdepth depth[] ); 420 /* Read an array of randomly positioned depth values from the depth buffer. 421 */ 422 411 423 412 424 413 425 /*** 414 *** Accelerated point, line, polygon, glDrawPixels and glBitmap functions: 426 *** For supporting hardware stencil buffers: 427 *** Either ALL or NONE of these functions must be implemented! 415 428 ***/ 416 429 417 points_func PointsFunc; 418 line_func LineFunc; 419 triangle_func TriangleFunc; 420 quad_func QuadFunc; 421 rect_func RectFunc; 422 430 void (*WriteStencilSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y, 431 const GLstencil stencil[], const GLubyte mask[] ); 432 /* Write a horizontal span of stencil values into the stencil buffer. 433 * If mask is NULL, write all stencil values. 434 * Else, only write stencil[i] if mask[i] is non-zero. 435 */ 436 437 void (*ReadStencilSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y, 438 GLstencil stencil[] ); 439 /* Read a horizontal span of stencil values from the stencil buffer. 440 */ 441 442 void (*WriteStencilPixels)( GLcontext *ctx, GLuint n, 443 const GLint x[], const GLint y[], 444 const GLstencil stencil[], 445 const GLubyte mask[] ); 446 /* Write an array of stencil values into the stencil buffer. 447 * If mask is NULL, write all stencil values. 448 * Else, only write stencil[i] if mask[i] is non-zero. 449 */ 450 451 void (*ReadStencilPixels)( GLcontext *ctx, GLuint n, 452 const GLint x[], const GLint y[], 453 GLstencil stencil[] ); 454 /* Read an array of stencil values from the stencil buffer. 455 */ 456 457 458 /*** 459 *** glDraw/Read/CopyPixels and glBitmap functions: 460 ***/ 423 461 424 462 GLboolean (*DrawPixels)( GLcontext *ctx, … … 433 471 */ 434 472 473 GLboolean (*ReadPixels)( GLcontext *ctx, 474 GLint x, GLint y, GLsizei width, GLsizei height, 475 GLenum format, GLenum type, 476 const struct gl_pixelstore_attrib *unpack, 477 GLvoid *dest ); 478 /* Called by glReadPixels. 479 * Return GL_TRUE if operation completed, else return GL_FALSE. 480 * This function must respect all glPixelTransfer settings. 481 */ 482 483 GLboolean (*CopyPixels)( GLcontext *ctx, 484 GLint srcx, GLint srcy, 485 GLsizei width, GLsizei height, 486 GLint dstx, GLint dsty, GLenum type ); 487 /* Do a glCopyPixels. Return GL_TRUE if operation completed, else 488 * return GL_FALSE. This function must respect all rasterization 489 * state, glPixelTransfer, glPixelZoom, etc. 490 */ 491 435 492 GLboolean (*Bitmap)( GLcontext *ctx, 436 493 GLint x, GLint y, GLsizei width, GLsizei height, … … 439 496 /* This is called by glBitmap. Works the same as DrawPixels, above. 440 497 */ 498 499 500 /*** 501 *** Texture mapping functions: 502 ***/ 503 504 void (*TexImage)( GLcontext *ctx, GLenum target, 505 struct gl_texture_object *tObj, GLint level, 506 GLint internalFormat, 507 const struct gl_texture_image *image ); 508 /* XXX this function is obsolete */ 509 /* Called whenever a texture object's image is changed. 510 * texObject is the number of the texture object being changed. 511 * level indicates the mipmap level. 512 * internalFormat is the format in which the texture is to be stored. 513 * image is a pointer to a gl_texture_image struct which contains 514 * the actual image data. 515 */ 516 517 void (*TexSubImage)( GLcontext *ctx, GLenum target, 518 struct gl_texture_object *tObj, GLint level, 519 GLint xoffset, GLint yoffset, 520 GLsizei width, GLsizei height, 521 GLint internalFormat, 522 const struct gl_texture_image *image ); 523 /* XXX this function is obsolete */ 524 /* Called from glTexSubImage() to define a sub-region of a texture. 525 */ 526 527 528 GLboolean (*TexImage1D)( GLcontext *ctx, GLenum target, GLint level, 529 GLenum format, GLenum type, const GLvoid *pixels, 530 const struct gl_pixelstore_attrib *packing, 531 struct gl_texture_object *texObj, 532 struct gl_texture_image *texImage, 533 GLboolean *retainInternalCopy ); 534 GLboolean (*TexImage2D)( GLcontext *ctx, GLenum target, GLint level, 535 GLenum format, GLenum type, const GLvoid *pixels, 536 const struct gl_pixelstore_attrib *packing, 537 struct gl_texture_object *texObj, 538 struct gl_texture_image *texImage, 539 GLboolean *retainInternalCopy ); 540 GLboolean (*TexImage3D)( GLcontext *ctx, GLenum target, GLint level, 541 GLenum format, GLenum type, const GLvoid *pixels, 542 const struct gl_pixelstore_attrib *packing, 543 struct gl_texture_object *texObj, 544 struct gl_texture_image *texImage, 545 GLboolean *retainInternalCopy ); 546 /* Called by glTexImage1/2/3D. 547 * Will not be called if any glPixelTransfer operations are enabled. 548 * Arguments: 549 * <target>, <level>, <format>, <type> and <pixels> are user specified. 550 * <packing> indicates the image packing of pixels. 551 * <texObj> is the target texture object. 552 * <texImage> is the target texture image. It will have the texture 553 * width, height, depth, border and internalFormat information. 554 * <retainInternalCopy> is returned by this function and indicates whether 555 * core Mesa should keep an internal copy of the texture image. 556 * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa 557 * should do the job. If GL_FALSE is returned, this function will be 558 * called a second time after the texture image has been unpacked into 559 * GLubytes. It may be easier for the driver to handle then. 560 */ 561 562 GLboolean (*TexSubImage1D)( GLcontext *ctx, GLenum target, GLint level, 563 GLint xoffset, GLsizei width, 564 GLenum format, GLenum type, 565 const GLvoid *pixels, 566 const struct gl_pixelstore_attrib *packing, 567 struct gl_texture_object *texObj, 568 struct gl_texture_image *texImage ); 569 GLboolean (*TexSubImage2D)( GLcontext *ctx, GLenum target, GLint level, 570 GLint xoffset, GLint yoffset, 571 GLsizei width, GLsizei height, 572 GLenum format, GLenum type, 573 const GLvoid *pixels, 574 const struct gl_pixelstore_attrib *packing, 575 struct gl_texture_object *texObj, 576 struct gl_texture_image *texImage ); 577 GLboolean (*TexSubImage3D)( GLcontext *ctx, GLenum target, GLint level, 578 GLint xoffset, GLint yoffset, GLint zoffset, 579 GLsizei width, GLsizei height, GLint depth, 580 GLenum format, GLenum type, 581 const GLvoid *pixels, 582 const struct gl_pixelstore_attrib *packing, 583 struct gl_texture_object *texObj, 584 struct gl_texture_image *texImage ); 585 /* Called by glTexSubImage1/2/3D. 586 * Will not be called if any glPixelTransfer operations are enabled. 587 * Arguments: 588 * <target>, <level>, <xoffset>, <yoffset>, <zoffset>, <width>, <height>, 589 * <depth>, <format>, <type> and <pixels> are user specified. 590 * <packing> indicates the image packing of pixels. 591 * <texObj> is the target texture object. 592 * <texImage> is the target texture image. It will have the texture 593 * width, height, border and internalFormat information. 594 * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa 595 * should do the job. If GL_FALSE is returned, then TexImage1/2/3D will 596 * be called with the complete texture image. 597 */ 598 599 GLboolean (*CopyTexImage1D)( GLcontext *ctx, GLenum target, GLint level, 600 GLenum internalFormat, GLint x, GLint y, 601 GLsizei width, GLint border ); 602 GLboolean (*CopyTexImage2D)( GLcontext *ctx, GLenum target, GLint level, 603 GLenum internalFormat, GLint x, GLint y, 604 GLsizei width, GLsizei height, GLint border ); 605 /* Called by glCopyTexImage1D and glCopyTexImage2D. 606 * Will not be called if any glPixelTransfer operations are enabled. 607 * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa 608 * should do the job. 609 */ 610 611 GLboolean (*CopyTexSubImage1D)( GLcontext *ctx, GLenum target, GLint level, 612 GLint xoffset, 613 GLint x, GLint y, GLsizei width ); 614 GLboolean (*CopyTexSubImage2D)( GLcontext *ctx, GLenum target, GLint level, 615 GLint xoffset, GLint yoffset, 616 GLint x, GLint y, 617 GLsizei width, GLsizei height ); 618 GLboolean (*CopyTexSubImage3D)( GLcontext *ctx, GLenum target, GLint level, 619 GLint xoffset, GLint yoffset, GLint zoffset, 620 GLint x, GLint y, 621 GLsizei width, GLsizei height ); 622 /* Called by glCopyTexSubImage1/2/3D. 623 * Will not be called if any glPixelTransfer operations are enabled. 624 * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa 625 * should do the job. 626 */ 627 628 GLvoid *(*GetTexImage)( GLcontext *ctx, GLenum target, GLint level, 629 GLenum *formatOut, GLenum *typeOut, 630 GLboolean *freeImageOut ); 631 /* Called by glGetTexImage or by core Mesa when a texture image 632 * is needed for software fallback rendering. 633 * Return the address of the texture image or NULL if failure. 634 * The image must be tightly packed (i.e. row stride = image width) 635 * Return the image's format and type in formatOut and typeOut. 636 * The format and type must be values which are accepted by glTexImage. 637 * Set the freeImageOut flag if the returned image should be deallocated 638 * with FREE() when finished. 639 * The size of the image can be deduced from the target and level. 640 * Core Mesa will perform any image format/type conversions that are needed. 641 */ 642 643 void (*TexEnv)( GLcontext *ctx, GLenum target, GLenum pname, 644 const GLfloat *param ); 645 /* Called by glTexEnv*(). 646 */ 647 648 void (*TexParameter)( GLcontext *ctx, GLenum target, 649 struct gl_texture_object *texObj, 650 GLenum pname, const GLfloat *params ); 651 /* Called by glTexParameter*(). 652 * <target> is user specified 653 * <texObj> the texture object to modify 654 * <pname> is one of GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER, 655 * GL_TEXTURE_WRAP_[STR], or GL_TEXTURE_BORDER_COLOR. 656 * <params> is user specified. 657 */ 658 659 void (*BindTexture)( GLcontext *ctx, GLenum target, 660 struct gl_texture_object *tObj ); 661 /* Called by glBindTexture(). 662 */ 663 664 void (*DeleteTexture)( GLcontext *ctx, struct gl_texture_object *tObj ); 665 /* Called when a texture object is about to be deallocated. Driver 666 * should free anything attached to the DriverData pointers. 667 */ 668 669 GLboolean (*IsTextureResident)( GLcontext *ctx, 670 struct gl_texture_object *t ); 671 /* Called by glAreTextureResident(). 672 */ 673 674 void (*PrioritizeTexture)( GLcontext *ctx, struct gl_texture_object *t, 675 GLclampf priority ); 676 /* Called by glPrioritizeTextures(). 677 */ 678 679 void (*ActiveTexture)( GLcontext *ctx, GLuint texUnitNumber ); 680 /* Called by glActiveTextureARB to set current texture unit. 681 */ 682 683 void (*UpdateTexturePalette)( GLcontext *ctx, 684 struct gl_texture_object *tObj ); 685 /* Called when the texture's color lookup table is changed. 686 * If tObj is NULL then the shared texture palette ctx->Texture.Palette 687 * is to be updated. 688 */ 689 690 691 692 /*** 693 *** Accelerated point, line, polygon, glDrawPixels and glBitmap functions: 694 ***/ 695 696 points_func PointsFunc; 697 line_func LineFunc; 698 triangle_func TriangleFunc; 699 quad_func QuadFunc; 700 rect_func RectFunc; 701 702 703 /*** 704 *** Transformation/Rendering functions 705 ***/ 441 706 442 707 void (*RenderStart)( GLcontext *ctx ); … … 459 724 */ 460 725 461 462 726 render_func *RenderVBClippedTab; 463 727 render_func *RenderVBCulledTab; … … 468 732 */ 469 733 470 471 734 void (*ReducedPrimitiveChange)( GLcontext *ctx, GLenum primitive ); 472 735 /* If registered, this will be called when rendering transitions between … … 482 745 * implement DD_TRI_OFFSET. 483 746 */ 484 485 747 486 748 GLboolean (*MultipassFunc)( struct vertex_buffer *VB, GLuint passno ); … … 493 755 * This function will be first invoked with passno == 1. 494 756 */ 495 496 /***497 *** Texture mapping functions:498 ***/499 500 void (*TexEnv)( GLcontext *ctx, GLenum pname, const GLfloat *param );501 /*502 * Called whenever glTexEnv*() is called.503 * Pname will be one of GL_TEXTURE_ENV_MODE or GL_TEXTURE_ENV_COLOR.504 * If pname is GL_TEXTURE_ENV_MODE then param will be one505 * of GL_MODULATE, GL_BLEND, GL_DECAL, or GL_REPLACE.506 */507 508 void (*TexImage)( GLcontext *ctx, GLenum target,509 struct gl_texture_object *tObj, GLint level,510 GLint internalFormat,511 const struct gl_texture_image *image );512 /*513 * Called whenever a texture object's image is changed.514 * texObject is the number of the texture object being changed.515 * level indicates the mipmap level.516 * internalFormat is the format in which the texture is to be stored.517 * image is a pointer to a gl_texture_image struct which contains518 * the actual image data.519 */520 521 void (*TexSubImage)( GLcontext *ctx, GLenum target,522 struct gl_texture_object *tObj, GLint level,523 GLint xoffset, GLint yoffset,524 GLsizei width, GLsizei height,525 GLint internalFormat,526 const struct gl_texture_image *image );527 /*528 * Called from glTexSubImage() to define a sub-region of a texture.529 */530 531 void (*TexParameter)( GLcontext *ctx, GLenum target,532 struct gl_texture_object *tObj,533 GLenum pname, const GLfloat *params );534 /*535 * Called whenever glTexParameter*() is called.536 * target is GL_TEXTURE_1D or GL_TEXTURE_2D537 * texObject is the texture object to modify538 * pname is one of GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER,539 * GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, or GL_TEXTURE_BORDER_COLOR.540 * params is dependant on pname. See man glTexParameter.541 */542 543 void (*BindTexture)( GLcontext *ctx, GLenum target,544 struct gl_texture_object *tObj );545 /*546 * Called whenever glBindTexture() is called. This specifies which547 * texture is to be the current one. No dirty flags will be set.548 */549 550 void (*DeleteTexture)( GLcontext *ctx, struct gl_texture_object *tObj );551 /*552 * Called when a texture object is about to be deallocated. Driver553 * should free anything attached to the DriverData pointers.554 */555 556 void (*UpdateTexturePalette)( GLcontext *ctx,557 struct gl_texture_object *tObj );558 /*559 * Called when the texture's color lookup table is changed.560 * If tObj is NULL then the shared texture palette ctx->Texture.Palette561 * was changed.562 */563 564 void (*UseGlobalTexturePalette)( GLcontext *ctx, GLboolean state );565 /*566 * Called via glEnable/Disable(GL_SHARED_TEXTURE_PALETTE_EXT)567 */568 569 void (*ActiveTexture)( GLcontext *ctx, GLuint texUnitNumber );570 /*571 * Called by glActiveTextureARB to set current texture unit.572 */573 574 575 GLboolean (*IsTextureResident)( GLcontext *ctx,576 struct gl_texture_object *t );577 /*578 * Allows the driver to implement the AreTexturesResident tests without579 * knowing about Mesa's internal hash tables for textures.580 */581 582 void (*PrioritizeTexture)( GLcontext *ctx,583 struct gl_texture_object *t,584 GLclampf priority );585 /*586 * Notify driver of priority change for a texture.587 */588 589 590 591 757 592 758 /*** … … 658 824 void (*Hint)(GLcontext *ctx, GLenum target, GLenum mode); 659 825 void (*Lightfv)(GLcontext *ctx, GLenum light, 660 826 GLenum pname, const GLfloat *params, GLint nparams ); 661 827 void (*LightModelfv)(GLcontext *ctx, GLenum pname, const GLfloat *params); 828 void (*LineStipple)(GLcontext *ctx, GLint factor, GLushort pattern ); 829 void (*LineWidth)(GLcontext *ctx, GLfloat width); 662 830 void (*LogicOpcode)(GLcontext *ctx, GLenum opcode); 663 831 void (*PolygonMode)(GLcontext *ctx, GLenum face, GLenum mode); 832 void (*PolygonStipple)(GLcontext *ctx, const GLubyte *mask ); 664 833 void (*Scissor)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); 665 834 void (*ShadeModel)(GLcontext *ctx, GLenum mode); -
trunk/src/opengl/mesa/depth.h
r2938 r3582 1 /* $Id: depth.h,v 1. 1 2000-02-29 00:48:29 sandervlExp $ */1 /* $Id: depth.h,v 1.2 2000-05-21 20:31:11 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 37 37 38 38 /* 39 * Return the address of the Z-buffer value for window coordinate (x,y):39 * Immediate-mode API entrpoints 40 40 */ 41 #define Z_ADDRESS( CTX, X, Y ) \ 42 ((CTX)->Buffer->Depth + (CTX)->Buffer->Width * (Y) + (X)) 41 42 extern void 43 _mesa_ClearDepth( GLclampd depth ); 44 45 46 extern void 47 _mesa_DepthFunc( GLenum func ); 48 49 50 extern void 51 _mesa_DepthMask( GLboolean flag ); 52 53 54 55 /* 56 * Internal functions 57 */ 58 59 extern GLvoid * 60 _mesa_zbuffer_address(GLcontext *ctx, GLint x, GLint y); 61 62 63 extern GLuint 64 _mesa_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y, 65 const GLdepth z[], GLubyte mask[] ); 66 67 extern void 68 _mesa_depth_test_pixels( GLcontext *ctx, 69 GLuint n, const GLint x[], const GLint y[], 70 const GLdepth z[], GLubyte mask[] ); 71 72 73 extern void 74 _mesa_read_depth_span_float( GLcontext *ctx, GLuint n, GLint x, GLint y, 75 GLfloat depth[] ); 76 77 78 extern void 79 _mesa_alloc_depth_buffer( GLcontext* ctx ); 80 81 82 extern void 83 _mesa_clear_depth_buffer( GLcontext* ctx ); 43 84 44 85 45 86 46 87 47 extern GLuint48 gl_depth_test_span_generic( GLcontext* ctx, GLuint n, GLint x, GLint y,49 const GLdepth z[], GLubyte mask[] );50 51 extern GLuint52 gl_depth_test_span_less( GLcontext* ctx, GLuint n, GLint x, GLint y,53 const GLdepth z[], GLubyte mask[] );54 55 extern GLuint56 gl_depth_test_span_greater( GLcontext* ctx, GLuint n, GLint x, GLint y,57 const GLdepth z[], GLubyte mask[] );58 59 60 61 extern void62 gl_depth_test_pixels_generic( GLcontext* ctx,63 GLuint n, const GLint x[], const GLint y[],64 const GLdepth z[], GLubyte mask[] );65 66 extern void67 gl_depth_test_pixels_less( GLcontext* ctx,68 GLuint n, const GLint x[], const GLint y[],69 const GLdepth z[], GLubyte mask[] );70 71 extern void72 gl_depth_test_pixels_greater( GLcontext* ctx,73 GLuint n, const GLint x[], const GLint y[],74 const GLdepth z[], GLubyte mask[] );75 76 77 extern void gl_read_depth_span_float( GLcontext* ctx,78 GLuint n, GLint x, GLint y,79 GLfloat depth[] );80 81 82 extern void gl_read_depth_span_int( GLcontext* ctx, GLuint n, GLint x, GLint y,83 GLdepth depth[] );84 85 86 extern void gl_alloc_depth_buffer( GLcontext* ctx );87 88 89 extern void gl_clear_depth_buffer( GLcontext* ctx );90 91 92 extern void gl_ClearDepth( GLcontext* ctx, GLclampd depth );93 94 extern void gl_DepthFunc( GLcontext* ctx, GLenum func );95 96 extern void gl_DepthMask( GLcontext* ctx, GLboolean flag );97 98 88 #endif -
trunk/src/opengl/mesa/dlist.h
r2938 r3582 1 /* $Id: dlist.h,v 1. 1 2000-02-29 00:48:29 sandervlExp $ */1 /* $Id: dlist.h,v 1.2 2000-05-21 20:32:16 jeroen Exp $ */ 2 2 3 3 /* … … 36 36 37 37 struct display_list { 38 union node *nodes; 38 union node *nodes; 39 39 GLuint OrFlag; 40 40 struct gl_current_attrib outputs; … … 52 52 extern void gl_destroy_list( GLcontext *ctx, GLuint list ); 53 53 54 extern void gl_CallList( GLcontext *ctx,GLuint list );54 extern void _mesa_CallList( GLuint list ); 55 55 56 extern void gl_CallLists( GLcontext *ctx, 57 GLsizei n, GLenum type, const GLvoid *lists ); 56 extern void _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); 58 57 59 extern void gl_DeleteLists( GLcontext *ctx,GLuint list, GLsizei range );58 extern void _mesa_DeleteLists( GLuint list, GLsizei range ); 60 59 61 extern void gl_EndList( GLcontext *ctx);60 extern void _mesa_EndList( void ); 62 61 63 extern GLuint gl_GenLists( GLcontext *ctx,GLsizei range );62 extern GLuint _mesa_GenLists( GLsizei range ); 64 63 65 extern GLboolean gl_IsList( GLcontext *ctx,GLuint list );64 extern GLboolean _mesa_IsList( GLuint list ); 66 65 67 extern void gl_ListBase( GLcontext *ctx,GLuint base );66 extern void _mesa_ListBase( GLuint base ); 68 67 69 extern void gl_NewList( GLcontext *ctx,GLuint list, GLenum mode );68 extern void _mesa_NewList( GLuint list, GLenum mode ); 70 69 71 extern void gl_init_dlist_pointers( struct gl_api_table *table );70 extern void _mesa_init_dlist_table( struct _glapi_table *table ); 72 71 73 72 -
trunk/src/opengl/mesa/drawpix.h
r2938 r3582 1 /* $Id: drawpix.h,v 1. 1 2000-02-29 00:48:29 sandervlExp $ */1 /* $Id: drawpix.h,v 1.2 2000-05-21 20:33:34 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 37 37 38 38 extern GLboolean 39 gl_direct_DrawPixels(GLcontext *ctx,40 const struct gl_pixelstore_attrib *unpack,41 GLsizei width, GLsizeiheight,42 GLenum format, GLenum type, const GLvoid *pixels);39 _mesa_clip_pixelrect(const GLcontext *ctx, 40 GLint *destX, GLint *destY, 41 GLsizei *width, GLsizei *height, 42 GLint *skipPixels, GLint *skipRows); 43 43 44 44 45 #if 000 46 extern void gl_DrawPixels( GLcontext *ctx, GLsizei width, GLsizei height, 47 GLenum format, GLenum type, const GLvoid *pixels ); 48 #endif 49 50 51 extern void gl_DrawPixels( GLcontext *ctx, struct gl_image *image ); 52 45 extern void 46 _mesa_DrawPixels( GLsizei width, GLsizei height, 47 GLenum format, GLenum type, const GLvoid *pixels ); 53 48 54 49 #endif -
trunk/src/opengl/mesa/enable.h
r2938 r3582 1 /* $Id: enable.h,v 1. 1 2000-02-29 00:48:30 sandervlExp $ */1 /* $Id: enable.h,v 1.2 2000-05-21 20:35:04 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_set_enable( GLcontext* ctx, GLenum cap, GLboolean state ); 38 extern void 39 _mesa_set_enable( GLcontext* ctx, GLenum cap, GLboolean state ); 39 40 40 extern void gl_Disable( GLcontext* ctx, GLenum cap ); 41 extern void 42 _mesa_Disable( GLenum cap ); 41 43 42 extern void gl_Enable( GLcontext* ctx, GLenum cap ); 44 extern void 45 _mesa_Enable( GLenum cap ); 43 46 44 extern GLboolean gl_IsEnabled( GLcontext* ctx, GLenum cap ); 47 extern GLboolean 48 _mesa_IsEnabled( GLenum cap ); 45 49 46 extern void gl_EnableClientState( GLcontext *ctx, GLenum cap ); 50 extern void 51 _mesa_EnableClientState( GLenum cap ); 47 52 48 extern void gl_DisableClientState( GLcontext *ctx, GLenum cap ); 53 extern void 54 _mesa_DisableClientState( GLenum cap ); 49 55 50 56 -
trunk/src/opengl/mesa/eval.h
r2938 r3582 1 /* $Id: eval.h,v 1. 1 2000-02-29 00:48:30 sandervlExp $ */1 /* $Id: eval.h,v 1.2 2000-05-21 20:36:38 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern GLuint _mesa_evaluator_components( GLenum target ); 39 40 38 41 extern void gl_free_control_points( GLcontext *ctx, 39 42 GLenum target, GLfloat *data ); … … 59 62 60 63 61 extern void gl_Map1f( GLcontext* ctx,62 GLenum target, GLfloat u1, GLfloat u2, GLint stride,63 GLint order, const GLfloat *points, GLboolean retain );64 65 extern void gl_Map2f( GLcontext* ctx, GLenum target,66 GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,67 GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,68 const GLfloat *points, GLboolean retain );69 70 71 72 extern void gl_MapGrid1f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2 );73 74 extern void gl_MapGrid2f( GLcontext* ctx,75 GLint un, GLfloat u1, GLfloat u2,76 GLint vn, GLfloat v1, GLfloat v2 );77 78 extern void gl_GetMapdv( GLcontext* ctx,79 GLenum target, GLenum query, GLdouble *v );80 81 extern void gl_GetMapfv( GLcontext* ctx,82 GLenum target, GLenum query, GLfloat *v );83 84 extern void gl_GetMapiv( GLcontext* ctx,85 GLenum target, GLenum query, GLint *v );86 87 extern void gl_EvalMesh1( GLcontext* ctx, GLenum mode, GLint i1, GLint i2 );88 89 extern void gl_EvalMesh2( GLcontext* ctx, GLenum mode,90 GLint i1, GLint i2, GLint j1, GLint j2 );91 92 64 extern void gl_eval_vb( struct vertex_buffer *VB ); 93 65 94 66 67 extern void 68 _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, 69 GLint order, const GLfloat *points ); 70 71 extern void 72 _mesa_Map2f( GLenum target, 73 GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, 74 GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, 75 const GLfloat *points ); 76 77 extern void 78 _mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, 79 GLint order, const GLdouble *points ); 80 81 extern void 82 _mesa_Map2d( GLenum target, 83 GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, 84 GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, 85 const GLdouble *points ); 86 87 extern void 88 _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); 89 90 extern void 91 _mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); 92 93 extern void 94 _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, 95 GLint vn, GLfloat v1, GLfloat v2 ); 96 97 extern void 98 _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, 99 GLint vn, GLdouble v1, GLdouble v2 ); 100 101 extern void 102 _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ); 103 104 extern void 105 _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ); 106 107 extern void 108 _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ); 109 110 extern void 111 _mesa_EvalMesh1( GLenum mode, GLint i1, GLint i2 ); 112 113 extern void 114 _mesa_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); 115 116 extern void 117 _mesa_EvalCoord1d( GLdouble u ); 118 119 extern void 120 _mesa_EvalCoord1f( GLfloat u ); 121 122 extern void 123 _mesa_EvalCoord1dv( const GLdouble *u ); 124 125 extern void 126 _mesa_EvalCoord1fv( const GLfloat *u ); 127 128 extern void 129 _mesa_EvalCoord2d( GLdouble u, GLdouble v ); 130 131 extern void 132 _mesa_EvalCoord2f( GLfloat u, GLfloat v ); 133 134 extern void 135 _mesa_EvalCoord2dv( const GLdouble *u ); 136 137 extern void 138 _mesa_EvalCoord2fv( const GLfloat *u ); 139 140 extern void 141 _mesa_EvalPoint1( GLint i ); 142 143 extern void 144 _mesa_EvalPoint2( GLint i, GLint j ); 145 146 95 147 #endif -
trunk/src/opengl/mesa/extensions.h
r2938 r3582 1 /* $Id: extensions.h,v 1. 1 2000-02-29 00:48:30 sandervlExp $ */1 /* $Id: extensions.h,v 1.2 2000-05-21 20:38:11 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 38 38 /* Return 0 on success. 39 39 */ 40 extern int gl_extensions_add( struct gl_context *ctx, int state, 41 const char *name, void (*notify)( void ) ); 40 extern int gl_extensions_add( GLcontext *ctx, int state, 41 const char *name, void (*notify)( void ) ); 42 43 extern int gl_extensions_enable( GLcontext *ctx, const char *name ); 44 extern int gl_extensions_disable( GLcontext *ctx, const char *name ); 42 45 extern GLboolean gl_extension_is_enabled( GLcontext *ctx, const char *name); 43 extern int gl_extensions_enable( struct gl_context *ctx, const char *name ); 44 extern int gl_extensions_disable( struct gl_context *ctx, const char *name ); 45 extern void gl_extensions_dtr( struct gl_context *ctx ); 46 extern void gl_extensions_ctr( struct gl_context *ctx ); 47 extern const char *gl_extensions_get_string( struct gl_context *ctx ); 48 49 extern void (*gl_get_proc_address( const GLubyte *procName ))(); 46 extern void gl_extensions_dtr( GLcontext *ctx ); 47 extern void gl_extensions_ctr( GLcontext *ctx ); 48 extern const char *gl_extensions_get_string( GLcontext *ctx ); 50 49 51 50 #endif -
trunk/src/opengl/mesa/feedback.h
r2938 r3582 1 /* $Id: feedback.h,v 1. 1 2000-02-29 00:48:30 sandervlExp $ */1 /* $Id: feedback.h,v 1.2 2000-05-21 20:39:40 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 #define FEEDBACK_TOKEN( CTX, T ) 39 if (CTX->Feedback.Count < CTX->Feedback.BufferSize) {\40 41 }\42 38 #define FEEDBACK_TOKEN( CTX, T ) \ 39 if (CTX->Feedback.Count < CTX->Feedback.BufferSize) { \ 40 CTX->Feedback.Buffer[CTX->Feedback.Count] = (GLfloat) (T); \ 41 } \ 42 CTX->Feedback.Count++; 43 43 44 44 … … 46 46 const GLfloat win[4], 47 47 const GLfloat color[4], 48 48 GLuint index, 49 49 const GLfloat texcoord[4] ); 50 50 … … 53 53 54 54 55 extern void gl_PassThrough( GLcontext *ctx, GLfloat token ); 55 extern void 56 _mesa_PassThrough( GLfloat token ); 56 57 57 extern void gl_FeedbackBuffer( GLcontext *ctx, GLsizei size,58 58 extern void 59 _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); 59 60 60 extern void gl_SelectBuffer( GLcontext *ctx, GLsizei size, GLuint *buffer ); 61 extern void 62 _mesa_SelectBuffer( GLsizei size, GLuint *buffer ); 61 63 62 extern void gl_InitNames( GLcontext *ctx ); 64 extern void 65 _mesa_InitNames( void ); 63 66 64 extern void gl_LoadName( GLcontext *ctx, GLuint name ); 67 extern void 68 _mesa_LoadName( GLuint name ); 65 69 66 extern void gl_PushName( GLcontext *ctx, GLuint name ); 70 extern void 71 _mesa_PushName( GLuint name ); 67 72 68 extern void gl_PopName( GLcontext *ctx ); 73 extern void 74 _mesa_PopName( void ); 69 75 70 extern GLint gl_RenderMode( GLcontext *ctx, GLenum mode ); 76 extern GLint 77 _mesa_RenderMode( GLenum mode ); 78 71 79 72 80 extern void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last ); 73 81 extern void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ); 74 82 extern void gl_feedback_triangle( GLcontext *ctx, GLuint v0, GLuint v1, 75 83 GLuint v2, GLuint pv ); 76 84 77 85 extern void gl_select_points( GLcontext *ctx, GLuint first, GLuint last ); 78 86 extern void gl_select_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ); 79 87 extern void gl_select_triangle( GLcontext *ctx, GLuint v0, GLuint v1, 80 88 GLuint v2, GLuint pv ); 81 89 82 90 #endif -
trunk/src/opengl/mesa/fixed.h
r2938 r3582 1 /* $Id: fixed.h,v 1. 1 2000-02-29 00:48:30 sandervlExp $ */1 /* $Id: fixed.h,v 1.2 2000-05-21 20:41:16 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 54 54 55 55 56 #if DEPTH_BITS==1657 /* use fixed-point interpolation */58 #define FixedToDepth(I) ((I) >> FIXED_SHIFT)59 #else60 /* don't really use fixed-point */61 #define FixedToDepth(I) (I)62 56 #endif 63 64 65 #endif -
trunk/src/opengl/mesa/fog.h
r2938 r3582 1 /* $Id: fog.h,v 1. 1 2000-02-29 00:48:30 sandervlExp $ */1 /* $Id: fog.h,v 1.2 2000-05-21 20:43:13 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 34 34 35 35 36 extern void gl_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ); 36 extern void 37 _mesa_Fogf(GLenum pname, GLfloat param); 37 38 38 39 39 extern void gl_fog_vertices( struct vertex_buffer *VB ); 40 extern void 41 _mesa_Fogi(GLenum pname, GLint param ); 40 42 41 extern void gl_fog_rgba_pixels( const GLcontext *ctx,42 GLuint n, const GLdepth z[],43 GLubyte rgba[][4] );44 43 45 extern void gl_fog_ci_pixels( const GLcontext *ctx,46 GLuint n, const GLdepth z[], GLuint indx[]);44 extern void 45 _mesa_Fogfv(GLenum pname, const GLfloat *params ); 47 46 48 extern void gl_make_fog_coords( struct vertex_buffer *VB );49 47 50 extern struct gl_pipeline_stage gl_fog_coord_stage; 48 extern void 49 _mesa_Fogiv(GLenum pname, const GLint *params ); 51 50 52 extern void gl_init_fog( void ); 51 52 53 extern void 54 _mesa_fog_vertices( struct vertex_buffer *VB ); 55 56 extern void 57 _mesa_fog_rgba_pixels( const GLcontext *ctx, 58 GLuint n, const GLdepth z[], 59 GLubyte rgba[][4] ); 60 61 extern void 62 _mesa_fog_ci_pixels( const GLcontext *ctx, 63 GLuint n, const GLdepth z[], GLuint indx[] ); 64 65 66 extern void 67 _mesa_init_fog( void ); 68 53 69 54 70 -
trunk/src/opengl/mesa/fog_tmp.h
r2938 r3582 1 /* $Id: fog_tmp.h,v 1. 1 2000-02-29 00:48:30 sandervlExp $ */1 /* $Id: fog_tmp.h,v 1.2 2000-05-21 20:46:23 jeroen Exp $ */ 2 2 3 3 /* … … 29 29 */ 30 30 static void TAG(make_fog_coord)( struct vertex_buffer *VB, 31 32 31 const GLvector4f *eye, 32 GLubyte flag) 33 33 { 34 34 const GLcontext *ctx = VB->ctx; … … 38 38 GLuint stride = eye->stride; 39 39 GLuint n = VB->Count - VB->Start; 40 GLubyte (*out)[4]; 40 GLubyte (*out)[4]; 41 41 GLfloat d; 42 42 GLuint i; … … 52 52 switch (ctx->Fog.Mode) { 53 53 case GL_LINEAR: 54 55 56 57 58 59 60 61 54 d = 1.0F / (ctx->Fog.End - ctx->Fog.Start); 55 for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) { 56 CULLCHECK { 57 GLfloat f = (end - ABSF(v[2])) * d; 58 FLOAT_COLOR_TO_UBYTE_COLOR(out[i][3], f); 59 } 60 } 61 break; 62 62 case GL_EXP: 63 64 65 66 67 68 69 70 63 d = -ctx->Fog.Density; 64 for ( i = 0 ; i < n ; i++, STRIDE_F(v,stride)) { 65 CULLCHECK { 66 GLfloat f = exp( d*ABSF(v[2]) ); /* already clamped */ 67 FLOAT_COLOR_TO_UBYTE_COLOR(out[i][3], f); 68 } 69 } 70 break; 71 71 case GL_EXP2: 72 73 74 75 76 77 78 79 80 72 d = -(ctx->Fog.Density*ctx->Fog.Density); 73 for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) { 74 CULLCHECK { 75 GLfloat z = v[2]; 76 GLfloat f = exp( d*z*z ); /* already clamped */ 77 FLOAT_COLOR_TO_UBYTE_COLOR(out[i][3], f); 78 } 79 } 80 break; 81 81 default: 82 83 82 gl_problem(ctx, "Bad fog mode in make_fog_coord"); 83 return; 84 84 } 85 85 } … … 89 89 90 90 if (ctx->Fog.Mode == GL_LINEAR) { 91 92 93 94 91 GLfloat f = ctx->Fog.End * (ctx->Fog.End - ctx->Fog.Start); 92 CLAMP_FLOAT_COLOR( f ); 93 f = 1.0 - f; 94 FLOAT_COLOR_TO_UBYTE_COLOR(r, f); 95 95 } 96 96 97 97 for (i = 0 ; i < n ; i++) 98 98 out[i][3] = r; 99 99 } 100 100 } … … 105 105 106 106 #if 0 107 /* For 3.3: use fog coordinates as intermediate step in all fog107 /* TODO : use fog coordinates as intermediate step in all fog 108 108 * calculations. 109 109 */ 110 110 111 111 static void TAG(fog_rgba_vertices)( struct vertex_buffer *VB, 112 113 112 GLuint side, 113 GLubyte flag) 114 114 { 115 115 const GLcontext *ctx = VB->ctx; … … 143 143 for ( i = 0 ; i < n ; i++, STRIDE_F(spec, sp_stride), in += in_stride) { 144 144 CULLCHECK { 145 146 147 148 149 145 GLint fc = (GLint) spec[3], ifc = 255 - fc; 146 147 out[i][0] = (fc * in[0] + ifc * rFog) >> 8; 148 out[i][1] = (fc * in[1] + ifc * gFog) >> 8; 149 out[i][2] = (fc * in[2] + ifc * bFog) >> 8; 150 150 } 151 151 } … … 155 155 156 156 static void TAG(fog_ci_vertices)( struct vertex_buffer *VB, 157 158 157 GLuint side, 158 GLubyte flag ) 159 159 { 160 160 GLcontext *ctx = VB->ctx; … … 182 182 183 183 184 /* NOTE: the extensiveuse of casts generates better/faster code for MIPS */184 /* NOTE: the use of casts generates better/faster code for MIPS */ 185 185 for ( i = 0; i < n ; i++, STRIDE_F(v,stride), STRIDE_UI(in,in_stride)) 186 186 CULLCHECK { … … 200 200 201 201 static void TAG(fog_rgba_vertices)( struct vertex_buffer *VB, 202 203 202 GLuint side, 203 GLubyte flag) 204 204 { 205 205 const GLcontext *ctx = VB->ctx; … … 233 233 switch (ctx->Fog.Mode) { 234 234 case GL_LINEAR: 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 235 d = 1.0F / (ctx->Fog.End - ctx->Fog.Start); 236 for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride), in += in_stride) { 237 CULLCHECK { 238 GLfloat f = (end - ABSF(v[2])) * d; 239 if (f >= 1.0) continue; 240 if (f < 0) { 241 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][0], rFog); 242 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][1], gFog); 243 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][2], bFog); 244 } else { 245 t = f * UBYTE_COLOR_TO_FLOAT_COLOR(in[0]) + (1.0F-f)*rFog; 246 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][0], t); 247 248 t = f * UBYTE_COLOR_TO_FLOAT_COLOR(in[1]) + (1.0F-f)*gFog; 249 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][1], t); 250 251 t = f * UBYTE_COLOR_TO_FLOAT_COLOR(in[2]) + (1.0F-f)*bFog; 252 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][2], t); 253 254 } 255 } 256 } 257 break; 258 258 case GL_EXP: 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 259 d = -ctx->Fog.Density; 260 for ( i = 0 ; i < n ; i++, STRIDE_F(v,stride), in += in_stride) { 261 CULLCHECK { 262 GLfloat f = exp( d*ABSF(v[2]) ); /* already clamped */ 263 264 t = f * UBYTE_COLOR_TO_FLOAT_COLOR(in[0]) + (1.0F-f)*rFog; 265 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][0], t); 266 267 t = f * UBYTE_COLOR_TO_FLOAT_COLOR(in[1]) + (1.0F-f)*gFog; 268 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][1], t); 269 270 t = f * UBYTE_COLOR_TO_FLOAT_COLOR(in[2]) + (1.0F-f)*bFog; 271 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][2], t); 272 } 273 } 274 break; 275 275 case GL_EXP2: 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 276 d = -(ctx->Fog.Density*ctx->Fog.Density); 277 for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride), in += in_stride) { 278 CULLCHECK { 279 GLfloat z = v[2]; 280 GLfloat f = exp( d*z*z ); /* already clamped */ 281 282 t = f * UBYTE_COLOR_TO_FLOAT_COLOR(in[0]) + (1.0F-f)*rFog; 283 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][0], t); 284 285 t = f * UBYTE_COLOR_TO_FLOAT_COLOR(in[1]) + (1.0F-f)*gFog; 286 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][1], t); 287 288 t = f * UBYTE_COLOR_TO_FLOAT_COLOR(in[2]) + (1.0F-f)*bFog; 289 CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(out[i][2], t); 290 } 291 } 292 break; 293 default: 294 gl_problem(ctx, "Bad fog mode in gl_fog_rgba_vertices"); 295 return; 296 296 } 297 297 } … … 312 312 313 313 for (i = 0 ; i < n ; i++) { 314 315 316 317 318 314 /* CULLCHECK */ { 315 out[i][0] = r; 316 out[i][1] = g; 317 out[i][2] = b; 318 } 319 319 } 320 320 } … … 330 330 */ 331 331 static void TAG(fog_ci_vertices)( struct vertex_buffer *VB, 332 333 332 GLuint side, 333 GLubyte flag ) 334 334 { 335 335 GLcontext *ctx = VB->ctx; … … 362 362 case GL_LINEAR: 363 363 { 364 365 366 367 368 369 370 371 372 373 374 375 376 364 GLfloat d = 1.0F / (ctx->Fog.End - ctx->Fog.Start); 365 GLfloat fogindex = ctx->Fog.Index; 366 GLfloat fogend = ctx->Fog.End; 367 368 for ( i = 0; i < n ; i++, STRIDE_F(v,stride), STRIDE_UI(in,in_stride)) 369 { 370 CULLCHECK { 371 GLfloat f = (fogend - ABSF(v[2])) * d; 372 f = CLAMP( f, 0.0, 1.0 ); 373 *out = (GLint) ((GLfloat)(GLint) *in + (1.0F-f) * fogindex); 374 } 375 } 376 break; 377 377 } 378 378 case GL_EXP: 379 379 { 380 381 382 383 384 385 386 387 388 389 380 GLfloat d = -ctx->Fog.Density; 381 GLfloat fogindex = ctx->Fog.Index; 382 for ( i = 0; i < n ; i++, STRIDE_F(v,stride), STRIDE_UI(in,in_stride)) 383 { 384 CULLCHECK { 385 GLfloat f = exp( d * ABSF(v[2]) ); 386 *out = (GLint) ((GLfloat)(GLint) *in + (1.0F-f) * fogindex); 387 } 388 } 389 break; 390 390 } 391 391 case GL_EXP2: 392 392 { 393 394 395 396 397 398 399 400 401 402 403 393 GLfloat d = -(ctx->Fog.Density*ctx->Fog.Density); 394 GLfloat fogindex = ctx->Fog.Index; 395 for ( i = 0; i < n ; i++, STRIDE_F(v,stride),STRIDE_UI(in,in_stride)) 396 { 397 CULLCHECK { 398 GLfloat z = v[2]; /*ABSF(v[i][2]);*/ 399 GLfloat f = exp( d * z*z ); /* was -d ??? */ 400 out[i] = (GLint) ((GLfloat)(GLint) *in + (1.0F-f) * fogindex); 401 } 402 } 403 break; 404 404 } 405 405 default: 406 407 406 gl_problem(ctx, "Bad fog mode in gl_fog_ci_vertices"); 407 return; 408 408 } 409 409 } else if (ctx->Fog.Mode == GL_LINEAR) { … … 414 414 fogindex = (GLuint)(f * ctx->Fog.Index); 415 415 if (fogindex) { 416 417 418 419 420 421 416 for ( i = 0; i < n ; i++, STRIDE_F(v,stride), STRIDE_UI(in,in_stride)) 417 { 418 CULLCHECK { 419 *out = *in + fogindex; 420 } 421 } 422 422 } 423 423 } -
trunk/src/opengl/mesa/get.h
r2938 r3582 1 /* $Id: get.h,v 1. 1 2000-02-29 00:48:31 sandervlExp $ */1 /* $Id: get.h,v 1.2 2000-05-21 20:47:50 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params ); 38 extern void 39 _mesa_GetBooleanv( GLenum pname, GLboolean *params ); 39 40 40 extern void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params ); 41 extern void 42 _mesa_GetDoublev( GLenum pname, GLdouble *params ); 41 43 42 extern void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params ); 44 extern void 45 _mesa_GetFloatv( GLenum pname, GLfloat *params ); 43 46 44 extern void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params ); 47 extern void 48 _mesa_GetIntegerv( GLenum pname, GLint *params ); 45 49 46 extern void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params ); 50 extern void 51 _mesa_GetPointerv( GLenum pname, GLvoid **params ); 47 52 48 extern const GLubyte *gl_GetString( GLcontext *ctx, GLenum name ); 53 extern const GLubyte * 54 _mesa_GetString( GLenum name ); 55 56 extern GLenum 57 _mesa_GetError( void ); 58 49 59 50 60
Note:
See TracChangeset
for help on using the changeset viewer.