Revision 43172207

b/tcg/sparc/tcg-target.c
314 314
static inline void tcg_out_movi(TCGContext *s, TCGType type,
315 315
                                int ret, tcg_target_long arg)
316 316
{
317
#if defined(__sparc_v9__) && !defined(__sparc_v8plus__)
318
    if (!check_fit_tl(arg, 32) && (arg & ~0xffffffffULL) != 0) {
319
        tcg_out_movi_imm32(s, TCG_REG_I4, arg >> 32);
317
    /* All 32-bit constants, as well as 64-bit constants with
318
       no high bits set go through movi_imm32.  */
319
    if (TCG_TARGET_REG_BITS == 32
320
        || type == TCG_TYPE_I32
321
        || (arg & ~(tcg_target_long)0xffffffff) == 0) {
322
        tcg_out_movi_imm32(s, ret, arg);
323
    } else if (check_fit_tl(arg, 13)) {
324
        /* A 13-bit constant sign-extended to 64-bits.  */
325
        tcg_out_movi_imm13(s, ret, arg);
326
    } else if (check_fit_tl(arg, 32)) {
327
        /* A 32-bit constant sign-extended to 64-bits.  */
328
        tcg_out_sethi(s, ret, ~arg);
329
        tcg_out_arithi(s, ret, ret, (arg & 0x3ff) | -0x400, ARITH_XOR);
330
    } else {
331
        tcg_out_movi_imm32(s, TCG_REG_I4, arg >> (TCG_TARGET_REG_BITS / 2));
320 332
        tcg_out_arithi(s, TCG_REG_I4, TCG_REG_I4, 32, SHIFT_SLLX);
321 333
        tcg_out_movi_imm32(s, ret, arg);
322 334
        tcg_out_arith(s, ret, ret, TCG_REG_I4, ARITH_OR);
323
    } else if (check_fit_tl(arg, 12))
324
        tcg_out_movi_imm13(s, ret, arg);
325
    else {
326
        tcg_out_sethi(s, ret, arg);
327
        if (arg & 0x3ff)
328
            tcg_out_arithi(s, ret, ret, arg & 0x3ff, ARITH_OR);
329 335
    }
330
#else
331
    tcg_out_movi_imm32(s, ret, arg);
332
#endif
333 336
}
334 337

  
335 338
static inline void tcg_out_ld_raw(TCGContext *s, int ret,

Also available in: Unified diff