~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to tcg/tci/tcg-target.inc.c

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
    { -1 },
260
260
};
261
261
 
 
262
static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op)
 
263
{
 
264
    int i, n = ARRAY_SIZE(tcg_target_op_defs);
 
265
 
 
266
    for (i = 0; i < n; ++i) {
 
267
        if (tcg_target_op_defs[i].op == op) {
 
268
            return &tcg_target_op_defs[i];
 
269
        }
 
270
    }
 
271
    return NULL;
 
272
}
 
273
 
262
274
static const int tcg_target_reg_alloc_order[] = {
263
275
    TCG_REG_R0,
264
276
    TCG_REG_R1,
372
384
}
373
385
 
374
386
/* Parse target specific constraints. */
375
 
static int target_parse_constraint(TCGArgConstraint *ct, const char **pct_str)
 
387
static const char *target_parse_constraint(TCGArgConstraint *ct,
 
388
                                           const char *ct_str, TCGType type)
376
389
{
377
 
    const char *ct_str = *pct_str;
378
 
    switch (ct_str[0]) {
 
390
    switch (*ct_str++) {
379
391
    case 'r':
380
392
    case 'L':                   /* qemu_ld constraint */
381
393
    case 'S':                   /* qemu_st constraint */
383
395
        tcg_regset_set32(ct->u.regs, 0, BIT(TCG_TARGET_NB_REGS) - 1);
384
396
        break;
385
397
    default:
386
 
        return -1;
 
398
        return NULL;
387
399
    }
388
 
    ct_str++;
389
 
    *pct_str = ct_str;
390
 
    return 0;
 
400
    return ct_str;
391
401
}
392
402
 
393
403
#if defined(CONFIG_DEBUG_TCG_INTERPRETER)
556
566
    case INDEX_op_goto_tb:
557
567
        if (s->tb_jmp_insn_offset) {
558
568
            /* Direct jump method. */
559
 
            tcg_debug_assert(args[0] < ARRAY_SIZE(s->tb_jmp_insn_offset));
560
569
            /* Align for atomic patching and thread safety */
561
570
            s->code_ptr = QEMU_ALIGN_PTR_UP(s->code_ptr, 4);
562
571
            s->tb_jmp_insn_offset[args[0]] = tcg_current_code_size(s);
565
574
            /* Indirect jump method. */
566
575
            TODO();
567
576
        }
568
 
        tcg_debug_assert(args[0] < ARRAY_SIZE(s->tb_jmp_reset_offset));
569
577
        s->tb_jmp_reset_offset[args[0]] = tcg_current_code_size(s);
570
578
        break;
571
579
    case INDEX_op_br:
875
883
 
876
884
    tcg_regset_clear(s->reserved_regs);
877
885
    tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK);
878
 
    tcg_add_target_add_op_defs(tcg_target_op_defs);
879
886
 
880
887
    /* We use negative offsets from "sp" so that we can distinguish
881
888
       stores that might pretend to be call arguments.  */