/[pcre]/code/trunk/sljit/sljitNativeMIPS_common.c
ViewVC logotype

Diff of /code/trunk/sljit/sljitNativeMIPS_common.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 879 by zherczeg, Sat Jan 14 17:05:53 2012 UTC revision 880 by zherczeg, Sun Jan 15 17:23:37 2012 UTC
# Line 459  static int emit_op(struct sljit_compiler Line 459  static int emit_op(struct sljit_compiler
459          int src1, sljit_w src1w,          int src1, sljit_w src1w,
460          int src2, sljit_w src2w);          int src2, sljit_w src2w);
461    
462  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_enter(struct sljit_compiler *compiler, int args, int temporaries, int generals, int local_size)  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_enter(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)
463  {  {
464          sljit_ins base;          sljit_ins base;
465    
466          CHECK_ERROR();          CHECK_ERROR();
467          check_sljit_emit_enter(compiler, args, temporaries, generals, local_size);          check_sljit_emit_enter(compiler, args, temporaries, saveds, local_size);
468    
469          compiler->temporaries = temporaries;          compiler->temporaries = temporaries;
470          compiler->generals = generals;          compiler->saveds = saveds;
471    
472          compiler->has_locals = local_size > 0;          compiler->has_locals = local_size > 0;
473          local_size += (generals + 2 + 4) * sizeof(sljit_w);          local_size += (saveds + 2 + 4) * sizeof(sljit_w);
474          local_size = (local_size + 15) & ~0xf;          local_size = (local_size + 15) & ~0xf;
475          compiler->local_size = local_size;          compiler->local_size = local_size;
476    
# Line 490  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 490  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
490          FAIL_IF(push_inst(compiler, STACK_STORE | base | TA(RETURN_ADDR_REG) | IMM(local_size - 1 * (int)sizeof(sljit_w)), MOVABLE_INS));          FAIL_IF(push_inst(compiler, STACK_STORE | base | TA(RETURN_ADDR_REG) | IMM(local_size - 1 * (int)sizeof(sljit_w)), MOVABLE_INS));
491          if (compiler->has_locals)          if (compiler->has_locals)
492                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_LOCALS_REG) | IMM(local_size - 2 * (int)sizeof(sljit_w)), MOVABLE_INS));                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_LOCALS_REG) | IMM(local_size - 2 * (int)sizeof(sljit_w)), MOVABLE_INS));
493          if (generals >= 1)          if (saveds >= 1)
494                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_GENERAL_REG1) | IMM(local_size - 3 * (int)sizeof(sljit_w)), MOVABLE_INS));                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_SAVED_REG1) | IMM(local_size - 3 * (int)sizeof(sljit_w)), MOVABLE_INS));
495          if (generals >= 2)          if (saveds >= 2)
496                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_GENERAL_REG2) | IMM(local_size - 4 * (int)sizeof(sljit_w)), MOVABLE_INS));                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_SAVED_REG2) | IMM(local_size - 4 * (int)sizeof(sljit_w)), MOVABLE_INS));
497          if (generals >= 3)          if (saveds >= 3)
498                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_GENERAL_REG3) | IMM(local_size - 5 * (int)sizeof(sljit_w)), MOVABLE_INS));                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_SAVED_REG3) | IMM(local_size - 5 * (int)sizeof(sljit_w)), MOVABLE_INS));
499          if (generals >= 4)          if (saveds >= 4)
500                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_GENERAL_EREG1) | IMM(local_size - 6 * (int)sizeof(sljit_w)), MOVABLE_INS));                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_SAVED_EREG1) | IMM(local_size - 6 * (int)sizeof(sljit_w)), MOVABLE_INS));
501          if (generals >= 5)          if (saveds >= 5)
502                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_GENERAL_EREG2) | IMM(local_size - 7 * (int)sizeof(sljit_w)), MOVABLE_INS));                  FAIL_IF(push_inst(compiler, STACK_STORE | base | T(SLJIT_SAVED_EREG2) | IMM(local_size - 7 * (int)sizeof(sljit_w)), MOVABLE_INS));
503    
504          if (compiler->has_locals)          if (compiler->has_locals)
505                  FAIL_IF(push_inst(compiler, ADDIU_W | S(REAL_STACK_PTR) | T(SLJIT_LOCALS_REG) | IMM(4 * sizeof(sljit_w)), DR(SLJIT_LOCALS_REG)));                  FAIL_IF(push_inst(compiler, ADDIU_W | S(REAL_STACK_PTR) | T(SLJIT_LOCALS_REG) | IMM(4 * sizeof(sljit_w)), DR(SLJIT_LOCALS_REG)));
506    
507          if (args >= 1)          if (args >= 1)
508                  FAIL_IF(push_inst(compiler, ADDU_W | SA(4) | TA(0) | D(SLJIT_GENERAL_REG1), DR(SLJIT_GENERAL_REG1)));                  FAIL_IF(push_inst(compiler, ADDU_W | SA(4) | TA(0) | D(SLJIT_SAVED_REG1), DR(SLJIT_SAVED_REG1)));
509          if (args >= 2)          if (args >= 2)
510                  FAIL_IF(push_inst(compiler, ADDU_W | SA(5) | TA(0) | D(SLJIT_GENERAL_REG2), DR(SLJIT_GENERAL_REG2)));                  FAIL_IF(push_inst(compiler, ADDU_W | SA(5) | TA(0) | D(SLJIT_SAVED_REG2), DR(SLJIT_SAVED_REG2)));
511          if (args >= 3)          if (args >= 3)
512                  FAIL_IF(push_inst(compiler, ADDU_W | SA(6) | TA(0) | D(SLJIT_GENERAL_REG3), DR(SLJIT_GENERAL_REG3)));                  FAIL_IF(push_inst(compiler, ADDU_W | SA(6) | TA(0) | D(SLJIT_SAVED_REG3), DR(SLJIT_SAVED_REG3)));
513    
514          return SLJIT_SUCCESS;          return SLJIT_SUCCESS;
515  }  }
516    
517  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_context(struct sljit_compiler *compiler, int args, int temporaries, int generals, int local_size)  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_context(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)
518  {  {
519          CHECK_ERROR_VOID();          CHECK_ERROR_VOID();
520          check_sljit_set_context(compiler, args, temporaries, generals, local_size);          check_sljit_set_context(compiler, args, temporaries, saveds, local_size);
521    
522          compiler->temporaries = temporaries;          compiler->temporaries = temporaries;
523          compiler->generals = generals;          compiler->saveds = saveds;
524    
525          compiler->has_locals = local_size > 0;          compiler->has_locals = local_size > 0;
526          local_size += (generals + 2 + 4) * sizeof(sljit_w);          local_size += (saveds + 2 + 4) * sizeof(sljit_w);
527          compiler->local_size = (local_size + 15) & ~0xf;          compiler->local_size = (local_size + 15) & ~0xf;
528  }  }
529    
# Line 548  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 548  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
548          }          }
549    
550          FAIL_IF(push_inst(compiler, STACK_LOAD | base | TA(RETURN_ADDR_REG) | IMM(local_size - 1 * (int)sizeof(sljit_w)), RETURN_ADDR_REG));          FAIL_IF(push_inst(compiler, STACK_LOAD | base | TA(RETURN_ADDR_REG) | IMM(local_size - 1 * (int)sizeof(sljit_w)), RETURN_ADDR_REG));
551          if (compiler->generals >= 5)          if (compiler->saveds >= 5)
552                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_GENERAL_EREG2) | IMM(local_size - 7 * (int)sizeof(sljit_w)), DR(SLJIT_GENERAL_EREG2)));                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_SAVED_EREG2) | IMM(local_size - 7 * (int)sizeof(sljit_w)), DR(SLJIT_SAVED_EREG2)));
553          if (compiler->generals >= 4)          if (compiler->saveds >= 4)
554                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_GENERAL_EREG1) | IMM(local_size - 6 * (int)sizeof(sljit_w)), DR(SLJIT_GENERAL_EREG1)));                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_SAVED_EREG1) | IMM(local_size - 6 * (int)sizeof(sljit_w)), DR(SLJIT_SAVED_EREG1)));
555          if (compiler->generals >= 3)          if (compiler->saveds >= 3)
556                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_GENERAL_REG3) | IMM(local_size - 5 * (int)sizeof(sljit_w)), DR(SLJIT_GENERAL_REG3)));                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_SAVED_REG3) | IMM(local_size - 5 * (int)sizeof(sljit_w)), DR(SLJIT_SAVED_REG3)));
557          if (compiler->generals >= 2)          if (compiler->saveds >= 2)
558                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_GENERAL_REG2) | IMM(local_size - 4 * (int)sizeof(sljit_w)), DR(SLJIT_GENERAL_REG2)));                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_SAVED_REG2) | IMM(local_size - 4 * (int)sizeof(sljit_w)), DR(SLJIT_SAVED_REG2)));
559          if (compiler->generals >= 1)          if (compiler->saveds >= 1)
560                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_GENERAL_REG1) | IMM(local_size - 3 * (int)sizeof(sljit_w)), DR(SLJIT_GENERAL_REG1)));                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_SAVED_REG1) | IMM(local_size - 3 * (int)sizeof(sljit_w)), DR(SLJIT_SAVED_REG1)));
561          if (compiler->has_locals)          if (compiler->has_locals)
562                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_LOCALS_REG) | IMM(local_size - 2 * (int)sizeof(sljit_w)), DR(SLJIT_LOCALS_REG)));                  FAIL_IF(push_inst(compiler, STACK_LOAD | base | T(SLJIT_LOCALS_REG) | IMM(local_size - 2 * (int)sizeof(sljit_w)), DR(SLJIT_LOCALS_REG)));
563    
# Line 1264  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1264  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1264  /*  Other instructions                                                   */  /*  Other instructions                                                   */
1265  /* --------------------------------------------------------------------- */  /* --------------------------------------------------------------------- */
1266    
1267  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fast_enter(struct sljit_compiler *compiler, int dst, sljit_w dstw, int args, int temporaries, int generals, int local_size)  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fast_enter(struct sljit_compiler *compiler, int dst, sljit_w dstw, int args, int temporaries, int saveds, int local_size)
1268  {  {
1269          CHECK_ERROR();          CHECK_ERROR();
1270          check_sljit_emit_fast_enter(compiler, dst, dstw, args, temporaries, generals, local_size);          check_sljit_emit_fast_enter(compiler, dst, dstw, args, temporaries, saveds, local_size);
1271    
1272          compiler->temporaries = temporaries;          compiler->temporaries = temporaries;
1273          compiler->generals = generals;          compiler->saveds = saveds;
1274    
1275          compiler->has_locals = local_size > 0;          compiler->has_locals = local_size > 0;
1276          local_size += (generals + 2 + 4) * sizeof(sljit_w);          local_size += (saveds + 2 + 4) * sizeof(sljit_w);
1277          compiler->local_size = (local_size + 15) & ~0xf;          compiler->local_size = (local_size + 15) & ~0xf;
1278    
1279          if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS)          if (dst >= SLJIT_TEMPORARY_REG1 && dst <= SLJIT_NO_REGISTERS)

Legend:
Removed from v.879  
changed lines
  Added in v.880

  ViewVC Help
Powered by ViewVC 1.1.5