From: Armin R. <ar...@us...> - 2004-10-26 12:20:49
|
Update of /cvsroot/psyco/psyco/c/ivm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30258 Modified Files: idispatcher.c iencoding.c iencoding.h ivm-insns.h Log Message: Some old updates to the 'ivm' back-end. It probably doesn't work yet. Index: idispatcher.c =================================================================== RCS file: /cvsroot/psyco/psyco/c/ivm/idispatcher.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** idispatcher.c 23 Sep 2003 15:43:57 -0000 1.2 --- idispatcher.c 26 Oct 2004 12:20:39 -0000 1.3 *************** *** 193,196 **** --- 193,199 ---- CodeBufferObject* target_codebuf = lastmatch->matching; int sdepth = get_stack_depth(&target_codebuf->snapshot); + #if PSYCO_DEBUG + bool has_ccreg = (po->ccreg != NULL); + #endif extra_assert(lastmatch->diff == NullArray); /* unify with exact match only */ *************** *** 235,238 **** --- 238,244 ---- if (code > dm.code_limit) /* start a new buffer if we wrote past the end */ code = data_new_buffer(code, &dm); + #if PSYCO_DEBUG + extra_assert(has_ccreg == (po->ccreg != NULL)); + #endif JUMP_TO((code_t*) target_codebuf->codestart); Index: iencoding.c =================================================================== RCS file: /cvsroot/psyco/psyco/c/ivm/iencoding.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iencoding.c 23 Sep 2003 15:43:57 -0000 1.2 --- iencoding.c 26 Oct 2004 12:20:39 -0000 1.3 *************** *** 162,166 **** condition_code_t cc = cc_from_vsource(v->source); ! INSN_push_cc(cc); INSNPUSHED(1); --- 162,167 ---- condition_code_t cc = cc_from_vsource(v->source); ! INSN_normalize_cc(cc); ! INSN_flag_push(); INSNPUSHED(1); *************** *** 229,236 **** long immed_true, long immed_false) { BEGIN_CODE ! INSN_push_cc(cc); ! INSN_immed(-1); ! INSN_add(); INSN_immed(immed_false - immed_true); INSN_and(); --- 230,243 ---- long immed_true, long immed_false) { + extra_assert(cc == CC_FLAG || cc == CC_NOT_FLAG); + if (cc == CC_NOT_FLAG) { + long tmp = immed_true; + immed_true = immed_false; + immed_false = tmp; + } BEGIN_CODE ! INSN_flag_push(); ! INSN_immed(-1); ! INSN_add(); INSN_immed(immed_false - immed_true); INSN_and(); Index: iencoding.h =================================================================== RCS file: /cvsroot/psyco/psyco/c/ivm/iencoding.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** iencoding.h 1 Mar 2004 18:23:14 -0000 1.5 --- iencoding.h 26 Oct 2004 12:20:39 -0000 1.6 *************** *** 4,9 **** - #error "ivm is still buggy -- sorry, Psyco requires a PC at the moment." - #ifndef _IENCODING_H #define _IENCODING_H --- 4,7 ---- *************** *** 179,188 **** /*** some macro for code emission ***/ ! #define CHECK_NONZERO_FROM_RT(src, rcc) do { \ ! NEED_CC(); \ ! INSN_rt_push(src); \ ! INSN_not(); /* normalize to 1 or 0 */ \ ! INSN_flag_pop(); \ ! rcc = CC_NOT_FLAG; \ } while (0) --- 177,185 ---- /*** some macro for code emission ***/ ! #define CHECK_NONZERO_FROM_RT(src, rcc) do { \ ! NEED_CC(); \ ! INSN_rt_push(src); \ ! INSN_cmpz(); /* negative form, to normalize to 1 or 0 */ \ ! rcc = CC_NOT_FLAG; \ } while (0) Index: ivm-insns.h =================================================================== RCS file: /cvsroot/psyco/psyco/c/ivm/ivm-insns.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ivm-insns.h 23 Sep 2003 15:43:57 -0000 1.2 --- ivm-insns.h 26 Oct 2004 12:20:39 -0000 1.3 *************** *** 89,104 **** if ((cc) == CC_NOT_FLAG) { \ INSN_flag_push(); \ ! INSN_not(); \ ! INSN_flag_pop(); \ if (po->ccreg != NULL) psyco_inverted_cc(po); \ } \ } while (0) - #define INSN_push_cc(cc) do { \ - extra_assert((int)(cc) < CC_TOTAL); \ - INSN_flag_push(); \ - if ((cc) == CC_NOT_FLAG) { \ - INSN_not(); \ - } \ - } while (0) #if META_ASSERT_DEPTH --- 89,96 ---- if ((cc) == CC_NOT_FLAG) { \ INSN_flag_push(); \ ! INSN_cmpz(); \ if (po->ccreg != NULL) psyco_inverted_cc(po); \ } \ } while (0) #if META_ASSERT_DEPTH |