Revision c66b5c2c tcg/arm/tcg-target.c

b/tcg/arm/tcg-target.c
396 396
static inline void tcg_out_movi32(TCGContext *s,
397 397
                int cond, int rd, int32_t arg)
398 398
{
399
    int offset = (uint32_t) arg - ((uint32_t) s->code_ptr + 8);
400

  
401 399
    /* TODO: This is very suboptimal, we can easily have a constant
402 400
     * pool somewhere after all the instructions.  */
403 401

  
404 402
    if (arg < 0 && arg > -0x100)
405 403
        return tcg_out_dat_imm(s, cond, ARITH_MVN, rd, 0, (~arg) & 0xff);
406 404

  
407
    if (offset < 0x100 && offset > -0x100)
408
        return offset >= 0 ?
409
                tcg_out_dat_imm(s, cond, ARITH_ADD, rd, 15, offset) :
410
                tcg_out_dat_imm(s, cond, ARITH_SUB, rd, 15, -offset);
411

  
412 405
    if (use_armv7_instructions) {
413 406
        /* use movw/movt */
414 407
        /* movw */

Also available in: Unified diff