]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - misc/mediasource/fteqcc-src/pr_x86.c
Rename mediasource to source
[voretournament/voretournament.git] / misc / mediasource / fteqcc-src / pr_x86.c
diff --git a/misc/mediasource/fteqcc-src/pr_x86.c b/misc/mediasource/fteqcc-src/pr_x86.c
deleted file mode 100644 (file)
index 4ebfdda..0000000
+++ /dev/null
@@ -1,1087 +0,0 @@
-/*\r
-when I say JIT, I mean load time, not execution time.\r
-\r
-notes:\r
-       qc jump offsets are all constants. we have no variable offset jumps (other than function calls/returns)\r
-       field remapping... fields are in place, and cannot be adjusted. if a field is not set to 0, its assumed to be a constant.\r
-\r
-optimisations:\r
-       none at the moment...\r
-       instructions need to be chained. stuff that writes to C should be cacheable, etc. maybe we don't even need to do the write to C\r
-       it should also be possible to fold in eq+ifnot, so none of this silly storeing of floats in equality tests\r
-\r
-       eax - tmp\r
-       ebx - prinst->edicttable\r
-       ecx     - tmp\r
-       edx - tmp\r
-       esi - \r
-       edi - tmp (because its preserved by subfunctions\r
-       ebp - \r
-\r
-  to use gas to provide binary opcodes:\r
-  vim -N blob.s && as blob.s && objdump.exe -d a.out\r
-*/\r
-\r
-#define PROGSUSED\r
-#include "progsint.h"\r
-\r
-#ifdef QCJIT\r
-\r
-static float ta, tb, nullfloat=0;\r
-\r
-unsigned int *statementjumps;  //[MAX_STATEMENTS*2]\r
-unsigned char **statementoffsets; //[MAX_STATEMENTS]\r
-unsigned int numjumps;\r
-unsigned char *code;\r
-unsigned int codesize;\r
-unsigned int jitstatements;\r
-\r
-void EmitByte(unsigned char byte)\r
-{\r
-       code[codesize++] = byte;\r
-}\r
-void Emit4Byte(unsigned int value)\r
-{\r
-       code[codesize++] = (value>> 0)&0xff;\r
-       code[codesize++] = (value>> 8)&0xff;\r
-       code[codesize++] = (value>>16)&0xff;\r
-       code[codesize++] = (value>>24)&0xff;\r
-}\r
-void EmitAdr(void *value)\r
-{\r
-       Emit4Byte((unsigned int)value);\r
-}\r
-void EmitFloat(float value)\r
-{\r
-       union {float f; unsigned int i;} u;\r
-       u.f = value;\r
-       Emit4Byte(u.i);\r
-}\r
-void Emit2Byte(unsigned short value)\r
-{\r
-       code[codesize++] = (value>> 0)&0xff;\r
-       code[codesize++] = (value>> 8)&0xff;\r
-}\r
-\r
-void EmitFOffset(void *func, int bias)\r
-{\r
-       union {void *f; unsigned int i;} u;\r
-       u.f = func;\r
-       u.i -= (unsigned int)&code[codesize+bias];\r
-       Emit4Byte(u.i);\r
-}\r
-\r
-void Emit4ByteJump(int statementnum, int offset)\r
-{\r
-       statementjumps[numjumps++] = codesize;\r
-       statementjumps[numjumps++] = statementnum;\r
-       statementjumps[numjumps++] = offset;\r
-\r
-       //the offset is filled in later\r
-       codesize += 4;\r
-}\r
-\r
-void FixupJumps(void)\r
-{\r
-       unsigned int j;\r
-       unsigned char *codesrc;\r
-       unsigned char *codedst;\r
-       unsigned int offset;\r
-\r
-       unsigned int v;\r
-\r
-       for (j = 0; j < numjumps;)\r
-       {\r
-               v = statementjumps[j++];\r
-               codesrc = &code[v];\r
-\r
-               v = statementjumps[j++];\r
-               codedst = statementoffsets[v];\r
-\r
-               v = statementjumps[j++];\r
-               offset = (int)(codedst - (codesrc-v));  //3rd term because the jump is relative to the instruction start, not the instruction's offset\r
-\r
-               codesrc[0] = (offset>> 0)&0xff;\r
-               codesrc[1] = (offset>> 8)&0xff;\r
-               codesrc[2] = (offset>>16)&0xff;\r
-               codesrc[3] = (offset>>24)&0xff;\r
-       }\r
-}\r
-\r
-int PR_LeaveFunction (progfuncs_t *progfuncs);\r
-int PR_EnterFunction (progfuncs_t *progfuncs, dfunction_t *f, int progsnum);\r
-\r
-pbool PR_GenerateJit(progfuncs_t *progfuncs)\r
-{\r
-       unsigned int i;\r
-       dstatement16_t *op = (dstatement16_t*)current_progstate->statements;\r
-       unsigned int numstatements = current_progstate->progs->numstatements;\r
-       int *glob = (int*)current_progstate->globals;\r
-\r
-       if (current_progstate->numbuiltins)\r
-               return false;\r
-\r
-       jitstatements = numstatements;\r
-\r
-       statementjumps = malloc(numstatements*12);\r
-       statementoffsets = malloc(numstatements*4);\r
-       code = malloc(numstatements*500);\r
-\r
-       numjumps = 0;\r
-       codesize = 0;\r
-\r
-\r
-\r
-       for (i = 0; i < numstatements; i++)\r
-       {\r
-               statementoffsets[i] = &code[codesize];\r
-               switch(op[i].op)\r
-               {\r
-               //jumps\r
-               case OP_IF:\r
-                       //integer compare\r
-                       //if a, goto b\r
-\r
-                       //cmpl $0,glob[A]\r
-                       EmitByte(0x83);EmitByte(0x3d);EmitAdr(glob + op[i].a);EmitByte(0x0);\r
-                       //jnz B\r
-                       EmitByte(0x0f);EmitByte(0x85);Emit4ByteJump(i + (signed short)op[i].b, -4);\r
-                       break;\r
-\r
-               case OP_IFNOT:\r
-                       //integer compare\r
-                       //if !a, goto b\r
-\r
-                       //cmpl $0,glob[A]\r
-                       EmitByte(0x83);EmitByte(0x3d);EmitAdr(glob + op[i].a);EmitByte(0x0);\r
-                       //jz B\r
-                       EmitByte(0x0f);EmitByte(0x84);Emit4ByteJump(i + (signed short)op[i].b, -4);\r
-                       break;\r
-\r
-               case OP_GOTO:\r
-                       EmitByte(0xE9);Emit4ByteJump(i + (signed short)op[i].a, -4);\r
-                       break;\r
-                       \r
-               //function returns\r
-               case OP_DONE:\r
-               case OP_RETURN:\r
-                       //done and return are the same\r
-\r
-                       //part 1: store A into OFS_RETURN\r
-\r
-                       if (!op[i].a)\r
-                       {\r
-                               //assumption: anything that returns address 0 is a void or zero return.\r
-                               //thus clear eax and copy that to the return vector.\r
-                               EmitByte(0x31);EmitByte(0xc0);\r
-                               EmitByte(0xa3);EmitAdr(glob + OFS_RETURN+0);\r
-                               EmitByte(0xa3);EmitAdr(glob + OFS_RETURN+1);\r
-                               EmitByte(0xa3);EmitAdr(glob + OFS_RETURN+2);\r
-                       }\r
-                       else\r
-                       {\r
-                               //movl glob[A+0],eax\r
-                               EmitByte(0xa1);EmitAdr(glob + op[i].a+0);\r
-                               //movl glob[A+0],edx\r
-                               EmitByte(0x8b);EmitByte(0x0d);EmitAdr(glob + op[i].a+1);\r
-                               //movl glob[A+0],ecx\r
-                               EmitByte(0x8b);EmitByte(0x15);EmitAdr(glob + op[i].a+2);\r
-                               //movl eax, glob[OFS_RET+0]\r
-                               EmitByte(0xa3);EmitAdr(glob + OFS_RETURN+0);\r
-                               //movl edx, glob[OFS_RET+0]\r
-                               EmitByte(0x89);EmitByte(0x15);EmitAdr(glob + OFS_RETURN+1);\r
-                               //movl ecx, glob[OFS_RET+0]\r
-                               EmitByte(0x89);EmitByte(0x15);EmitAdr(glob + OFS_RETURN+2);\r
-                       }\r
-                       \r
-                       //call leavefunction to get the return address\r
-                       \r
-//                     pushl progfuncs\r
-                       EmitByte(0x68);EmitAdr(progfuncs);\r
-//                     call PR_LeaveFunction\r
-                       EmitByte(0xe8);EmitFOffset(PR_LeaveFunction, 4);\r
-//                     add $4,%esp\r
-                       EmitByte(0x83);EmitByte(0xc4);EmitByte(0x04);\r
-//                     movl pr_depth,%edx\r
-                       EmitByte(0x8b);EmitByte(0x15);EmitAdr(&pr_depth);\r
-//                     cmp prinst->exitdepth,%edx\r
-                       EmitByte(0x3b);EmitByte(0x15);EmitAdr(&prinst->exitdepth);\r
-//                     je returntoc\r
-                       EmitByte(0x74);EmitByte(0x09);\r
-//                     mov statementoffsets[%eax*4],%eax\r
-                       EmitByte(0x8b);EmitByte(0x04);EmitByte(0x85);EmitAdr(statementoffsets+1);\r
-//                     jmp eax\r
-                       EmitByte(0xff);EmitByte(0xe0);\r
-//                     returntoc:\r
-//                     ret\r
-                       EmitByte(0xc3);\r
-                       break;\r
-\r
-               //function calls\r
-               case OP_CALL0:\r
-               case OP_CALL1:\r
-               case OP_CALL2:\r
-               case OP_CALL3:\r
-               case OP_CALL4:\r
-               case OP_CALL5:\r
-               case OP_CALL6:\r
-               case OP_CALL7:\r
-               case OP_CALL8:\r
-               //save the state in place the rest of the engine can cope with\r
-                       //movl $i, pr_xstatement\r
-                       EmitByte(0xc7);EmitByte(0x05);EmitAdr(&pr_xstatement);Emit4Byte(i);\r
-                       //movl $(op[i].op-OP_CALL0), pr_argc\r
-                       EmitByte(0xc7);EmitByte(0x05);EmitAdr(&pr_argc);Emit4Byte(op[i].op-OP_CALL0);\r
-\r
-               //figure out who we're calling, and what that involves\r
-                       //%eax = glob[A]\r
-                       EmitByte(0xa1); EmitAdr(glob + op[i].a);\r
-               //eax is now the func num\r
-\r
-                       //mov %eax,%ecx\r
-                       EmitByte(0x89); EmitByte(0xc1);\r
-                       //shr $24,%ecx\r
-                       EmitByte(0xc1); EmitByte(0xe9); EmitByte(0x18);\r
-               //ecx is now the progs num for the new func\r
-\r
-                       //cmp %ecx,pr_typecurrent\r
-                       EmitByte(0x39); EmitByte(0x0d); EmitAdr(&pr_typecurrent);\r
-                       //je sameprogs\r
-                       EmitByte(0x74); EmitByte(0x3);\r
-                       {\r
-                               //can't handle switching progs\r
-\r
-                               //FIXME: recurse though PR_ExecuteProgram\r
-                               //push eax\r
-                               //push progfuncs\r
-                               //call PR_ExecuteProgram\r
-                               //add $8,%esp\r
-                               //remember to change the je above\r
-\r
-                               //err... exit depth? no idea\r
-                               EmitByte(0xcd);EmitByte(op[i].op);      //int $X\r
-\r
-\r
-                               //ret\r
-                               EmitByte(0xc3);\r
-                       }\r
-                       //sameprogs:\r
-\r
-                       //andl $0x00ffffff, %eax\r
-                       EmitByte(0x25);Emit4Byte(0x00ffffff);\r
-                       \r
-                       //mov $sizeof(dfunction_t),%edx\r
-                       EmitByte(0xba);Emit4Byte(sizeof(dfunction_t));\r
-                       //mul %edx\r
-                       EmitByte(0xf7); EmitByte(0xe2);\r
-                       //add pr_functions,%eax\r
-                       EmitByte(0x05); EmitAdr(pr_functions);\r
-\r
-               //eax is now the dfunction_t to be called\r
-               //edx is clobbered.\r
-\r
-                       //mov (%eax),%edx\r
-                       EmitByte(0x8b);EmitByte(0x10);\r
-               //edx is now the first statement number\r
-                       //cmp $0,%edx\r
-                       EmitByte(0x83);EmitByte(0xfa);EmitByte(0x00);\r
-                       //jl isabuiltin\r
-                       EmitByte(0x7c);EmitByte(22);\r
-       \r
-                       {\r
-                               //push %ecx\r
-                               EmitByte(0x51);\r
-                               //push %eax\r
-                               EmitByte(0x50);\r
-                               //pushl progfuncs\r
-                               EmitByte(0x68);EmitAdr(progfuncs);\r
-                               //call PR_EnterFunction\r
-                               EmitByte(0xe8);EmitFOffset(PR_EnterFunction, 4);\r
-                               //sub $12,%esp\r
-                               EmitByte(0x83);EmitByte(0xc4);EmitByte(0xc);\r
-               //eax is now the next statement number (first of the new function, usually equal to ecx, but not always)\r
-\r
-                               //jmp statementoffsets[%eax*4]\r
-                               EmitByte(0xff);EmitByte(0x24);EmitByte(0x85);EmitAdr(statementoffsets+1);\r
-                       }\r
-                       //isabuiltin:\r
-\r
-\r
-                       //push current_progstate->globals\r
-                       EmitByte(0x68);EmitAdr(current_progstate->globals);\r
-                       //push progfuncs\r
-                       EmitByte(0x68);EmitAdr(progfuncs);\r
-                       //neg %edx\r
-                       EmitByte(0xf7);EmitByte(0xda);\r
-                       //call externs->globalbuiltins[%edx,4]\r
-//FIXME: make sure this dereferences\r
-                       EmitByte(0xff);EmitByte(0x14);EmitByte(0x95);EmitAdr(externs->globalbuiltins);\r
-                       //add $8,%esp\r
-                       EmitByte(0x83);EmitByte(0xc4);EmitByte(0x8);\r
-\r
-               //but that builtin might have been Abort()\r
-\r
-                       //mov prinst->continuestatement,%eax\r
-                       EmitByte(0xa1);EmitAdr(&prinst->continuestatement);\r
-               //eax is now prinst->continuestatement\r
-\r
-                       //cmp $-1,%eax\r
-                       EmitByte(0x83);EmitByte(0xf8);EmitByte(0xff);\r
-                       //je donebuiltincall\r
-                       EmitByte(0x74);EmitByte(10+8);\r
-                       {\r
-EmitByte(0xcc);\r
-                               //jmp statementoffsets[%eax*4]\r
-                               EmitByte(0xff);EmitByte(0x24);EmitByte(0x85);EmitAdr(statementoffsets+1);\r
-\r
-                               //mov $-1,prinst->continuestatement\r
-                               EmitByte(0xc7);EmitByte(0x05);EmitAdr(&prinst->continuestatement+1);Emit4Byte((unsigned int)-1);\r
-                       }\r
-                       //donebuiltincall:\r
-                       break;\r
-\r
-               case OP_MUL_F:\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a);\r
-                       //fmuls glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x0d);EmitAdr(glob + op[i].b);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c);\r
-                       break;\r
-               case OP_DIV_F:\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a);\r
-                       //fdivs glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x35);EmitAdr(glob + op[i].b);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c);\r
-                       break;\r
-               case OP_ADD_F:\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a);\r
-                       //fadds glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x05);EmitAdr(glob + op[i].b);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c);\r
-                       break;\r
-               case OP_SUB_F:\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a);\r
-                       //fsubs glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x25);EmitAdr(glob + op[i].b);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c);\r
-                       break;\r
-\r
-               case OP_NOT_F:\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a);\r
-                       //fldz\r
-                       EmitByte(0xd9);EmitByte(0xee);\r
-                       //fnstsw %ax\r
-                       EmitByte(0xdf);EmitByte(0xe0);\r
-                       //testb 0x40,%ah\r
-                       EmitByte(0xf6);EmitByte(0xc4);EmitByte(0x40);\r
-                       //je noteq\r
-                       EmitByte(0x74);EmitByte(0x0c);\r
-                       //movl 1.0f,glob[C]\r
-                       EmitByte(0xc7);EmitByte(0x05);EmitAdr(glob + op[i].c);EmitFloat(0.0f);\r
-                       //jmp end\r
-                       EmitByte(0xeb);EmitByte(0x0a);\r
-                       //noteq:\r
-                       //movl 0.0f,glob[C]\r
-                       EmitByte(0xc7);EmitByte(0x05);EmitAdr(glob + op[i].c);EmitFloat(1.0f);\r
-                       //end:\r
-                       break;\r
-\r
-               case OP_STORE_F:\r
-               case OP_STORE_S:\r
-               case OP_STORE_ENT:\r
-               case OP_STORE_FLD:\r
-               case OP_STORE_FNC:\r
-                       //movl glob[A],eax\r
-                       EmitByte(0xa1);EmitAdr(glob + op[i].a);\r
-                       //movl eax,glob[B]\r
-                       EmitByte(0xa3);EmitAdr(glob + op[i].b);\r
-                       break;\r
-\r
-               case OP_STORE_V:\r
-                       //movl glob[A+0],eax\r
-                       EmitByte(0xa1);EmitAdr(glob + op[i].a+0);\r
-                       //movl glob[A+1],edx\r
-                       EmitByte(0x8b);EmitByte(0x0d);EmitAdr(glob + op[i].a+1);\r
-                       //movl glob[A+2],ecx\r
-                       EmitByte(0x8b);EmitByte(0x15);EmitAdr(glob + op[i].a+2);\r
-\r
-                       //movl eax, glob[B+0]\r
-                       EmitByte(0xa3);EmitAdr(glob + op[i].b+0);\r
-                       //movl edx, glob[B+1]\r
-                       EmitByte(0x89);EmitByte(0x15);EmitAdr(glob + op[i].b+1);\r
-                       //movl ecx, glob[B+2]\r
-                       EmitByte(0x89);EmitByte(0x15);EmitAdr(glob + op[i].b+2);\r
-                       break;\r
-\r
-               case OP_LOAD_F:\r
-               case OP_LOAD_S:\r
-               case OP_LOAD_ENT:\r
-               case OP_LOAD_FLD:\r
-               case OP_LOAD_FNC:\r
-               case OP_LOAD_V:\r
-               //a is the ent number, b is the field\r
-               //c is the dest\r
-\r
-                       //movl glob[A+0],eax\r
-                       EmitByte(0xa1);EmitAdr(glob + op[i].a);\r
-                       //mov glob[B],ecx\r
-                       EmitByte(0x8b); EmitByte(0x0d);EmitAdr(glob + op[i].b);\r
-               //FIXME: bound eax (ent number)\r
-               //FIXME: bound ecx (field index)\r
-                       //mov (ebx,eax,4).%eax\r
-                       EmitByte(0x8b); EmitByte(0x04); EmitByte(0x83);\r
-               //eax is now an edictrun_t\r
-                       //mov fields(,%eax,4),%edx\r
-                       EmitByte(0x8b);EmitByte(0x50);EmitByte((int)&((edictrun_t*)NULL)->fields);\r
-               //edx is now the field array for that ent\r
-\r
-                       //mov fieldajust(%edx,%ecx,4),%eax      //offset = progfuncs->fieldadjust\r
-                       EmitByte(0x8b); EmitByte(0x84); EmitByte(0x8a); Emit4Byte(progfuncs->fieldadjust*4);\r
-                       //mov edx,glob[C]\r
-                       EmitByte(0xa3);EmitAdr(glob + op[i].c);\r
-\r
-                       if (op[i].op == OP_LOAD_V)\r
-                       {\r
-                               //mov fieldajust+4(%edx,%ecx,4),%eax    //offset = progfuncs->fieldadjust\r
-                               EmitByte(0x8b); EmitByte(0x84); EmitByte(0x8a); Emit4Byte(4+progfuncs->fieldadjust*4);\r
-                               //mov edx,glob[C+1]\r
-                               EmitByte(0xa3);EmitAdr(glob + op[i].c+1);\r
-\r
-                               //mov fieldajust+8(%edx,%ecx,4),%eax    //offset = progfuncs->fieldadjust\r
-                               EmitByte(0x8b); EmitByte(0x84); EmitByte(0x8a); Emit4Byte(4+progfuncs->fieldadjust*4);\r
-                               //mov edx,glob[C+1]\r
-                               EmitByte(0xa3);EmitAdr(glob + op[i].c+2);\r
-                       }\r
-                       break;\r
-\r
-               case OP_ADDRESS:\r
-                       //a is the ent number, b is the field\r
-               //c is the dest\r
-\r
-                       //movl glob[A+0],eax\r
-                       EmitByte(0xa1);EmitAdr(glob + op[i].a);\r
-                       //mov glob[B],ecx\r
-                       EmitByte(0x8b); EmitByte(0x0d);EmitAdr(glob + op[i].b);\r
-               //FIXME: bound eax (ent number)\r
-               //FIXME: bound ecx (field index)\r
-                       //mov (ebx,eax,4).%eax\r
-                       EmitByte(0x8b); EmitByte(0x04); EmitByte(0x83);\r
-               //eax is now an edictrun_t\r
-                       //mov fields(,%eax,4),%edx\r
-                       EmitByte(0x8b);EmitByte(0x50);EmitByte((int)&((edictrun_t*)NULL)->fields);\r
-               //edx is now the field array for that ent\r
-                       //mov fieldajust(%edx,%ecx,4),%eax      //offset = progfuncs->fieldadjust\r
-                       //EmitByte(0x8d); EmitByte(0x84); EmitByte(0x8a); EmitByte(progfuncs->fieldadjust*4);\r
-                       EmitByte(0x8d); EmitByte(0x84); EmitByte(0x8a); Emit4Byte(progfuncs->fieldadjust*4);\r
-                       //mov edx,glob[C]\r
-                       EmitByte(0xa3);EmitAdr(glob + op[i].c);\r
-                       break;\r
-\r
-               case OP_STOREP_F:\r
-               case OP_STOREP_S:\r
-               case OP_STOREP_ENT:\r
-               case OP_STOREP_FLD:\r
-               case OP_STOREP_FNC:\r
-                       //movl glob[A],eax\r
-                       EmitByte(0xa1);EmitAdr(glob + op[i].a);\r
-                       //mov glob[B],ecx\r
-                       EmitByte(0x8b); EmitByte(0x0d);EmitAdr(glob + op[i].b);\r
-                       //mov %eax,(%ecx)\r
-                       EmitByte(0x89);EmitByte(0x01);\r
-                       break;\r
-\r
-               case OP_STOREP_V:\r
-                       //mov glob[B],ecx\r
-                       EmitByte(0x8b); EmitByte(0x0d);EmitAdr(glob + op[i].b);\r
-                       //movl glob[A],eax\r
-                       EmitByte(0xa1);EmitAdr(glob + op[i].a+0);\r
-                       //mov %eax,0(%ecx)\r
-                       EmitByte(0x89);EmitByte(0x01);\r
-                       //movl glob[A],eax\r
-                       EmitByte(0xa1);EmitAdr(glob + op[i].a+0);\r
-                       //mov %eax,4(%ecx)\r
-                       EmitByte(0x89);EmitByte(0x41);EmitByte(0x04);\r
-                       //movl glob[A],eax\r
-                       EmitByte(0xa1);EmitAdr(glob + op[i].a+0);\r
-                       //mov %eax,8(%ecx)\r
-                       EmitByte(0x89);EmitByte(0x41);EmitByte(0x08);\r
-                       break;\r
-\r
-               case OP_EQ_E:\r
-               case OP_EQ_FNC:\r
-                       //integer equality\r
-                       //movl glob[A],%eax\r
-                       EmitByte(0xa1);EmitAdr(glob + op[i].a);\r
-                       //cmp glob[B],%eax\r
-                       EmitByte(0x3b); EmitByte(0x0f); EmitAdr(glob + op[i].b);\r
-                       //je 12\r
-                       EmitByte(0x74);EmitByte(0x0c);\r
-                       //mov 0.0f,glob[C]\r
-                       EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].a);EmitFloat(0.0f);\r
-                       //jmp 10\r
-                       EmitByte(0xeb);EmitByte(0x0a);\r
-                       //mov 1.0f,glob[C]\r
-                       EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].a);EmitFloat(1.0f);\r
-                       break;\r
-\r
-               case OP_NE_E:\r
-               case OP_NE_FNC:\r
-                       //integer equality\r
-                       //movl glob[A],%eax\r
-                       EmitByte(0xa1);EmitAdr(glob + op[i].a);\r
-                       //cmp glob[B],%eax\r
-                       EmitByte(0x3b); EmitByte(0x0f); EmitAdr(glob + op[i].b);\r
-                       //je 12\r
-                       EmitByte(0x74);EmitByte(0x0c);\r
-                       //mov 0.0f,glob[C]\r
-                       EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].a);EmitFloat(1.0f);\r
-                       //jmp 10\r
-                       EmitByte(0xeb);EmitByte(0x0a);\r
-                       //mov 1.0f,glob[C]\r
-                       EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].a);EmitFloat(0.0f);\r
-                       break;\r
-\r
-               case OP_NOT_ENT:\r
-               case OP_NOT_FNC:\r
-                       //cmp glob[B],%eax\r
-                       EmitByte(0x8c); EmitByte(0x3d); EmitAdr(glob + op[i].a);EmitByte(0x00);\r
-                       //je 12\r
-                       EmitByte(0x74);EmitByte(0x0c);\r
-                       //mov 0.0f,glob[C]\r
-                       EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].a);EmitFloat(0.0f);\r
-                       //jmp 10\r
-                       EmitByte(0xeb);EmitByte(0x0a);\r
-                       //mov 1.0f,glob[C]\r
-                       EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].c);EmitFloat(1.0f);\r
-                       break;\r
-\r
-               case OP_BITOR:  //floats...\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9); EmitByte(0x05);EmitAdr(glob + op[i].a);\r
-                       //flds glob[B]\r
-                       EmitByte(0xd9); EmitByte(0x05);EmitAdr(glob + op[i].b);\r
-                       //fistp tb\r
-                       EmitByte(0xdf); EmitByte(0x1d);EmitAdr(&tb);\r
-                       //fistp ta\r
-                       EmitByte(0xdf); EmitByte(0x1d);EmitAdr(&ta);\r
-                       //mov ta,%eax\r
-                       EmitByte(0xa1); EmitAdr(&ta);\r
-                       //and tb,%eax\r
-                       EmitByte(0x09); EmitByte(0x05);EmitAdr(&tb);\r
-                       //fild tb\r
-                       EmitByte(0xdf); EmitByte(0x05);EmitAdr(&tb);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9); EmitByte(0x1d);EmitAdr(glob + op[i].c);\r
-                       break;\r
-\r
-               case OP_BITAND:\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9); EmitByte(0x05);EmitAdr(glob + op[i].a);\r
-                       //flds glob[B]\r
-                       EmitByte(0xd9); EmitByte(0x05);EmitAdr(glob + op[i].b);\r
-                       //fistp tb\r
-                       EmitByte(0xdf); EmitByte(0x1d);EmitAdr(&tb);\r
-                       //fistp ta\r
-                       EmitByte(0xdf); EmitByte(0x1d);EmitAdr(&ta);\r
-                       //mov ta,%eax\r
-                       EmitByte(0xa1); EmitAdr(&ta);\r
-                       //and tb,%eax\r
-                       EmitByte(0x21); EmitByte(0x05);EmitAdr(&tb);\r
-                       //fild tb\r
-                       EmitByte(0xdf); EmitByte(0x05);EmitAdr(&tb);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9); EmitByte(0x1d);EmitAdr(glob + op[i].c);\r
-                       break;\r
-\r
-               case OP_AND:\r
-                       //test floats properly, so we don't get confused with -0.0\r
-\r
-                       //flds  glob[A]\r
-                       EmitByte(0xd9); EmitByte(0x05); EmitAdr(glob + op[i].a);\r
-                       //fcomps        nullfloat\r
-                       EmitByte(0xd8); EmitByte(0x1d); EmitAdr(&nullfloat);\r
-                       //fnstsw        %ax\r
-                       EmitByte(0xdf); EmitByte(0xe0);\r
-                       //test  $0x40,%ah\r
-                       EmitByte(0xf6); EmitByte(0xc4);EmitByte(0x40);\r
-                       //je onefalse\r
-                       EmitByte(0x75); EmitByte(0x1f);\r
-\r
-                       //flds  glob[B]\r
-                       EmitByte(0xd9); EmitByte(0x05); EmitAdr(glob + op[i].b);\r
-                       //fcomps        nullfloat\r
-                       EmitByte(0xd8); EmitByte(0x1d); EmitAdr(&nullfloat);\r
-                       //fnstsw        %ax\r
-                       EmitByte(0xdf); EmitByte(0xe0);\r
-                       //test  $0x40,%ah\r
-                       EmitByte(0xf6); EmitByte(0xc4);EmitByte(0x40);\r
-                       //jne onefalse\r
-                       EmitByte(0x75); EmitByte(0x0c);\r
-\r
-                       //mov float0,glob[C]\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(1.0f);\r
-                       //jmp done\r
-                       EmitByte(0xeb); EmitByte(0x0a);\r
-\r
-                       //onefalse:\r
-                       //mov float1,glob[C]\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(0.0f);\r
-                       //done:\r
-                       break;\r
-               case OP_OR:\r
-                       //test floats properly, so we don't get confused with -0.0\r
-\r
-                       //flds  glob[A]\r
-                       EmitByte(0xd9); EmitByte(0x05); EmitAdr(glob + op[i].a);\r
-                       //fcomps        nullfloat\r
-                       EmitByte(0xd8); EmitByte(0x1d); EmitAdr(&nullfloat);\r
-                       //fnstsw        %ax\r
-                       EmitByte(0xdf); EmitByte(0xe0);\r
-                       //test  $0x40,%ah\r
-                       EmitByte(0xf6); EmitByte(0xc4);EmitByte(0x40);\r
-                       //je onetrue\r
-                       EmitByte(0x74); EmitByte(0x1f);\r
-\r
-                       //flds  glob[B]\r
-                       EmitByte(0xd9); EmitByte(0x05); EmitAdr(glob + op[i].b);\r
-                       //fcomps        nullfloat\r
-                       EmitByte(0xd8); EmitByte(0x1d); EmitAdr(&nullfloat);\r
-                       //fnstsw        %ax\r
-                       EmitByte(0xdf); EmitByte(0xe0);\r
-                       //test  $0x40,%ah\r
-                       EmitByte(0xf6); EmitByte(0xc4);EmitByte(0x40);\r
-                       //je onetrue\r
-                       EmitByte(0x74); EmitByte(0x0c);\r
-\r
-                       //mov float0,glob[C]\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(0.0f);\r
-                       //jmp done\r
-                       EmitByte(0xeb); EmitByte(0x0a);\r
-\r
-                       //onetrue:\r
-                       //mov float1,glob[C]\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(1.0f);\r
-                       //done:\r
-                       break;\r
-\r
-               case OP_EQ_S:\r
-               case OP_NE_S:\r
-                       //put a in ecx\r
-                       //put b in edi\r
-                       //mov a,%ecx\r
-                       EmitByte(0x8b); EmitByte(0x0d); EmitAdr(glob + op[i].a);\r
-                       //mov b,%edi\r
-                       EmitByte(0x8b); EmitByte(0x3d); EmitAdr(glob + op[i].b);\r
-\r
-                       //early out if they're equal\r
-                       //cmp %ecx,%edi\r
-                       EmitByte(0x39); EmitByte(0xd1);\r
-                       //je _true\r
-                       EmitByte(0x74); EmitByte(0x68);\r
-\r
-                       //if a is 0, check if b is ""\r
-                       //jecxz ais0\r
-                       EmitByte(0xe3); EmitByte(0x1a);\r
-\r
-                       //if b is 0, check if a is ""\r
-                       //cmp $0,%edi\r
-                       EmitByte(0x83); EmitByte(0xff); EmitByte(0x00);\r
-                       //jne bnot0\r
-                       EmitByte(0x75); EmitByte(0x2a);\r
-                       {\r
-                               //push a\r
-                               EmitByte(0x51);\r
-                               //push progfuncs\r
-                               EmitByte(0x68); EmitAdr(progfuncs);\r
-                               //call PR_StringToNative\r
-                               EmitByte(0xe8); EmitFOffset(PR_StringToNative,4);\r
-                               //add $8,%esp\r
-                               EmitByte(0x83); EmitByte(0xc4); EmitByte(0x08);\r
-                               //cmpb $0,(%eax)\r
-                               EmitByte(0x80); EmitByte(0x38); EmitByte(0x00);\r
-                               //je _true\r
-                               EmitByte(0x74); EmitByte(0x4b);\r
-                               //jmp _false\r
-                               EmitByte(0xeb); EmitByte(0x3d);\r
-\r
-                               //ais0:\r
-                               {\r
-                                       //push edi\r
-                                       EmitByte(0x57);\r
-                                       //push progfuncs\r
-                                       EmitByte(0x68); EmitAdr(progfuncs);\r
-                                       //call PR_StringToNative\r
-                                       EmitByte(0xe8); EmitFOffset(PR_StringToNative,4);\r
-                                       //add $8,%esp\r
-                                       EmitByte(0x83); EmitByte(0xc4); EmitByte(0x08);\r
-                                       //cmpb $0,(%eax)\r
-                                       EmitByte(0x80); EmitByte(0x38); EmitByte(0x00);\r
-                                       //je _true\r
-                                       EmitByte(0x74); EmitByte(0x36);\r
-                                       //jmp _false\r
-                                       EmitByte(0xeb); EmitByte(0x28);\r
-                               }\r
-                       }\r
-                       //bnot0:\r
-\r
-                       //push ecx\r
-                       EmitByte(0x51);\r
-                       //push progfuncs\r
-                       EmitByte(0x68); EmitAdr(progfuncs);\r
-                       //call PR_StringToNative\r
-                       EmitByte(0xe8); EmitFOffset(PR_StringToNative,4);\r
-                       //push %eax\r
-                       EmitByte(0x50);\r
-\r
-                       //push %edi\r
-                       EmitByte(0x57);\r
-                       //push progfuncs\r
-                       EmitByte(0x68); EmitAdr(progfuncs);\r
-                       //call PR_StringToNative\r
-                       EmitByte(0xe8); EmitFOffset(PR_StringToNative,4);\r
-                       //add $8,%esp\r
-                       EmitByte(0x83); EmitByte(0xc4); EmitByte(0x08);\r
-\r
-\r
-                       //push %eax\r
-                       EmitByte(0x50);\r
-                       //call strcmp\r
-                       EmitByte(0xe8); EmitFOffset(strcmp,4);\r
-                       //add $16,%esp\r
-                       EmitByte(0x83); EmitByte(0xc4); EmitByte(0x10);\r
-                       //cmp $0,%eax\r
-                       EmitByte(0x83); EmitByte(0xf8); EmitByte(0x00);\r
-                       //je _true\r
-                       EmitByte(0x74); EmitByte(0x0c);\r
-//_false:\r
-                       //mov 0.0f,c\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat((op[i].op == OP_NE_S)?1.0f:0.0f);\r
-                       //jmp done\r
-                       EmitByte(0xeb); EmitByte(0x0a);\r
-//_true:\r
-                       //mov 1.0f,c\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat((op[i].op == OP_NE_S)?0.0f:1.0f);\r
-//_done:\r
-                       break;\r
-\r
-               case OP_NOT_S:\r
-                       //mov A,%eax\r
-                       EmitByte(0xa1);EmitAdr(glob + op[i].a);\r
-                       //cmp $0,%eax\r
-                       EmitByte(0x83); EmitByte(0xf8); EmitByte(0x00);\r
-                       //je _true\r
-                       EmitByte(0x74); EmitByte(0x1f);\r
-                       //push %eax\r
-                       EmitByte(0x50);\r
-                       //push progfuncs\r
-                       EmitByte(0x68); EmitAdr(progfuncs);\r
-                       //call PR_StringToNative\r
-                       EmitByte(0xe8); EmitFOffset(PR_StringToNative,4);\r
-                       //add $8,%esp\r
-                       EmitByte(0x83); EmitByte(0xc4); EmitByte(0x08);\r
-                       //cmpb $0,(%eax)\r
-                       EmitByte(0x80); EmitByte(0x38); EmitByte(0x00);\r
-                       //je _true\r
-                       EmitByte(0x74); EmitByte(0x0c);\r
-//_false:\r
-                       //mov 0.0f,c\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(0.0f);\r
-                       //jmp done\r
-                       EmitByte(0xeb); EmitByte(0x0a);\r
-//_true:\r
-                       //mov 1.0f,c\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(1.0f);\r
-//_done:\r
-                       break;\r
-\r
-               case OP_ADD_V:\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+0);\r
-                       //fadds glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x05);EmitAdr(glob + op[i].b+0);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c+0);\r
-\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+1);\r
-                       //fadds glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x05);EmitAdr(glob + op[i].b+1);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c+1);\r
-\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+2);\r
-                       //fadds glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x05);EmitAdr(glob + op[i].b+2);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c+2);\r
-                       break;\r
-               case OP_SUB_V:\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+0);\r
-                       //fsubs glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x25);EmitAdr(glob + op[i].b+0);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c+0);\r
-\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+1);\r
-                       //fsubs glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x25);EmitAdr(glob + op[i].b+1);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c+1);\r
-\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+2);\r
-                       //fsubs glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x25);EmitAdr(glob + op[i].b+2);\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c+2);\r
-                       break;\r
-\r
-               case OP_MUL_V:\r
-                       //this is actually a dotproduct\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+0);\r
-                       //fmuls glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x0d);EmitAdr(glob + op[i].b+0);\r
-\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+1);\r
-                       //fmuls glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x0d);EmitAdr(glob + op[i].b+1);\r
-\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+2);\r
-                       //fmuls glob[B]\r
-                       EmitByte(0xd8);EmitByte(0x0d);EmitAdr(glob + op[i].b+2);\r
-\r
-                       //faddp\r
-                       EmitByte(0xde);EmitByte(0xc1);\r
-                       //faddp\r
-                       EmitByte(0xde);EmitByte(0xc1);\r
-\r
-                       //fstps glob[C]\r
-                       EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c);\r
-                       break;\r
-\r
-               case OP_EQ_F:\r
-               case OP_NE_F:\r
-               case OP_LE:\r
-               case OP_GE:\r
-               case OP_LT:\r
-               case OP_GT:\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a);\r
-                       //flds glob[B]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].b);\r
-                       //fcomip %st(1),%st\r
-                       EmitByte(0xdf);EmitByte(0xe9);\r
-                       //fstp %st(0)   (aka: pop)\r
-                       EmitByte(0xdd);EmitByte(0xd8);\r
-\r
-                       //jcc _true\r
-                       if (op[i].op == OP_LE)\r
-                               EmitByte(0x7e); //jle\r
-                       else if (op[i].op == OP_GE)\r
-                               EmitByte(0x7d); //jge\r
-                       else if (op[i].op == OP_LT)\r
-                               EmitByte(0x7c); //jl\r
-                       else if (op[i].op == OP_GT)\r
-                               EmitByte(0x7f); //jg\r
-                       else if (op[i].op == OP_NE_F)\r
-                               EmitByte(0x75); //jne\r
-                       else\r
-                               EmitByte(0x74); //je\r
-                       EmitByte(0x0c);\r
-//_false:\r
-                       //mov 0.0f,c\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(0.0f);\r
-                       //jmp done\r
-                       EmitByte(0xeb); EmitByte(0x0a);\r
-//_true:\r
-                       //mov 1.0f,c\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(1.0f);\r
-//_done:\r
-                       break;\r
-\r
-               case OP_MUL_FV:\r
-               case OP_MUL_VF:\r
-                       //\r
-                       {\r
-                               int v;\r
-                               int f;\r
-                               if (op[i].op == OP_MUL_FV)\r
-                               {\r
-                                       f = op[i].a;\r
-                                       v = op[i].b;\r
-                               }\r
-                               else\r
-                               {\r
-                                       v = op[i].a;\r
-                                       f = op[i].b;\r
-                               }\r
-\r
-                               //flds glob[F]\r
-                               EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + f);\r
-\r
-                               //flds glob[V0]\r
-                               EmitByte(0xd8);EmitByte(0x0d);EmitAdr(glob + v+0);\r
-                               //fmul st(1)\r
-                               EmitByte(0xd8);EmitByte(0xc9);\r
-                               //fstps glob[C]\r
-                               EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c+0);\r
-\r
-                               //flds glob[V0]\r
-                               EmitByte(0xd8);EmitByte(0x0d);EmitAdr(glob + v+1);\r
-                               //fmul st(1)\r
-                               EmitByte(0xd8);EmitByte(0xc9);\r
-                               //fstps glob[C]\r
-                               EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c+1);\r
-\r
-                               //flds glob[V0]\r
-                               EmitByte(0xd8);EmitByte(0x0d);EmitAdr(glob + v+2);\r
-                               //fmul st(1)\r
-                               EmitByte(0xd8);EmitByte(0xc9);\r
-                               //fstps glob[C]\r
-                               EmitByte(0xd9);EmitByte(0x1d);EmitAdr(glob + op[i].c+2);\r
-\r
-                               //fstp %st(0)   (aka: pop)\r
-                               EmitByte(0xdd);EmitByte(0xd8);\r
-                       }\r
-                       break;\r
-\r
-               case OP_STATE:\r
-                       //externs->stateop(progfuncs, OPA->_float, OPB->function);\r
-                       //push b\r
-                       EmitByte(0xff);EmitByte(0x35);EmitAdr(glob + op[i].b);\r
-                       //push a\r
-                       EmitByte(0xff);EmitByte(0x35);EmitAdr(glob + op[i].a);\r
-                       //push $progfuncs\r
-                       EmitByte(0x68); EmitAdr(progfuncs);\r
-                       //call externs->stateop\r
-                       EmitByte(0xe8); EmitFOffset(externs->stateop, 4);\r
-                       //add $12,%esp\r
-                       EmitByte(0x83); EmitByte(0xc4); EmitByte(0x0c);\r
-                       break;\r
-#if 0\r
-               case OP_NOT_V:\r
-                       //flds 0\r
-                       //flds glob[A+0]\r
-                       //fcomip %st(1),%st\r
-                       //jne _true\r
-                       //flds glob[A+1]\r
-                       //fcomip %st(1),%st\r
-                       //jne _true\r
-                       //flds glob[A+1]\r
-                       //fcomip %st(1),%st\r
-                       //jne _true\r
-                       //mov 1,C\r
-                       //jmp done\r
-                       //_true:\r
-                       //mov 0,C\r
-                       //done:\r
-                       break;\r
-\r
-               case OP_EQ_V:\r
-                       //flds glob[A]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+0);\r
-                       //flds glob[B]\r
-                       EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].b+0);\r
-                       //fcomip %st(1),%st\r
-                       EmitByte(0xdf);EmitByte(0xe9);\r
-                       //fstp %st(0)   (aka: pop)\r
-                       EmitByte(0xdd);EmitByte(0xd8);\r
-\r
-                       //jncc _true\r
-                       if (op[i].op == OP_NE_V)\r
-                               EmitByte(0x74); //je\r
-                       else\r
-                               EmitByte(0x75); //jne\r
-                       EmitByte(0x0c);\r
-//_false0:\r
-                       //mov 0.0f,c\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(1.0f);\r
-                       //jmp done\r
-                       EmitByte(0xeb); EmitByte(0x0a);\r
-\r
-\r
-//_true:\r
-                       //mov 1.0f,c\r
-                       EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(0.0f);\r
-//_done:\r
-                       break;\r
-\r
-\r
-               case OP_EQ_V:\r
-                       EmitByte(0xcd);EmitByte(op[i].op);\r
-                       printf("QCJIT: instruction %i is not implemented\n", op[i].op);\r
-                       break;\r
-\r
-               case OP_NE_V:\r
-                       EmitByte(0xcd);EmitByte(op[i].op);\r
-                       printf("QCJIT: instruction %i is not implemented\n", op[i].op);\r
-                       break;\r
-\r
-               case OP_NOT_V:\r
-                       EmitByte(0xcd);EmitByte(op[i].op);\r
-                       printf("QCJIT: instruction %i is not implemented\n", op[i].op);\r
-                       break;\r
-#endif\r
-               default:\r
-                       printf("QCJIT: Extended instruction set %i is not supported, not using jit.\n", op[i].op);\r
-\r
-\r
-                       free(statementjumps);   //[MAX_STATEMENTS]\r
-                       free(statementoffsets); //[MAX_STATEMENTS]\r
-                       free(code);\r
-                       statementoffsets = NULL;\r
-                       return false;\r
-               }\r
-       }\r
-\r
-       FixupJumps();\r
-\r
-#ifdef _WIN32\r
-       {\r
-               DWORD old;\r
-\r
-               //this memory is on the heap.\r
-               //this means that we must maintain read/write protection, or libc will crash us\r
-               VirtualProtect(code, codesize, PAGE_EXECUTE_READWRITE, &old);\r
-       }\r
-#endif\r
-\r
-//     externs->WriteFile("jit.x86", code, codesize);\r
-\r
-       return true;\r
-}\r
-\r
-void PR_EnterJIT(progfuncs_t *progfuncs, int statement)\r
-{\r
-#ifdef __GNUC__\r
-       //call, it clobbers pretty much everything.\r
-       asm("call *%0" :: "r"(statementoffsets[statement+1]),"b"(prinst->edicttable):"cc","memory","eax","ecx","edx");\r
-#elif defined(_MSC_VER)\r
-       void *entry = statementoffsets[statement+1];\r
-       void *edicttable = prinst->edicttable;\r
-       __asm {\r
-               pushad\r
-               mov eax,entry\r
-               mov ebx,edicttable\r
-               call eax\r
-               popad\r
-       }\r
-#else\r
-       #error "Sorry, no idea how to enter assembler safely for your compiler"\r
-#endif\r
-}\r
-#endif\r