# Patch created by Кирилл # Date: Mon Nov 13 03:41:49 RST 2006 # Repository: libjit # Comments: # #### End of Preamble #### #### Patch data follows #### Index: jit/jit-rules-x86.ins =================================================================== RCS file: /sources/dotgnu-pnet/./libjit/jit/jit-rules-x86.ins,v retrieving revision 1.19 diff -c -r1.19 jit-rules-x86.ins *** jit/jit-rules-x86.ins 10 Nov 2006 21:03:09 -0000 1.19 --- jit/jit-rules-x86.ins 13 Nov 2006 00:41:50 -0000 *************** *** 583,592 **** } x86_shift_reg_imm(inst, X86_SHR, $1, shift); } ! [reg("eax"), imm, scratch("?", "edx")] -> { ! x86_mov_reg_imm(inst, $3, $2); ! x86_clear_reg(inst, X86_EDX); ! x86_div_reg(inst, $3, 0); } [reg("eax"), reg, scratch("edx")] -> { unsigned char *patch; --- 583,618 ---- } x86_shift_reg_imm(inst, X86_SHR, $1, shift); } ! [reg, imm, if("$2 == 0xffffffff")] -> { ! x86_alu_reg_imm(inst, X86_ADD, $1, 1); ! x86_mov_reg_imm(inst, $1, 0); ! x86_alu_reg_imm(inst, X86_ADC, $1, 0); ! } ! [=reg("edx"), reg("eax"), imm, scratch("eax")] -> { ! jit_nuint shift, value = (jit_nuint)$3; ! for(shift = 0; value; value >>= 1) ! { ! ++shift; ! } ! jit_nuint b = shift - 1; ! jit_float64 f = 1.0/((jit_float64)((unsigned int)$3)); ! f *= jit_float64_pow((jit_float64)(2.0), (jit_float64)(32)); ! f *= jit_float64_pow((jit_float64)(2.0), (jit_float64)(b)); ! unsigned int f_i = (unsigned int)(jit_float64_floor(f)); ! jit_float64 fractpart = jit_float64_abs(f - (jit_float64_floor(f))); ! if(fractpart > 0.5) f_i++; ! x86_mov_reg_imm(inst, X86_EDX, f_i); ! if(fractpart < 0.5) ! { ! unsigned char *patch; ! x86_alu_reg_imm(inst, X86_ADD, X86_EAX, 1); ! patch = inst; ! x86_branch8(inst, X86_CC_C, 0, 0); ! x86_mul_reg(inst, X86_EDX, 0); ! x86_patch(patch, inst); ! } ! else x86_mul_reg(inst, X86_EDX, 0); ! x86_shift_reg_imm(inst, X86_SHR, X86_EDX, b); } [reg("eax"), reg, scratch("edx")] -> { unsigned char *patch; #### End of Patch data ####