Revision 593f17e5

b/target-alpha/helper.h
83 83
DEF_HELPER_FLAGS_1(cvtgf, TCG_CALL_CONST, i64, i64)
84 84
DEF_HELPER_FLAGS_1(cvtgq, TCG_CALL_CONST, i64, i64)
85 85
DEF_HELPER_FLAGS_1(cvtqg, TCG_CALL_CONST, i64, i64)
86
DEF_HELPER_FLAGS_1(cvtlq, TCG_CALL_CONST | TCG_CALL_PURE, i64, i64)
87 86

  
88 87
DEF_HELPER_FLAGS_1(cvttq, TCG_CALL_CONST, i64, i64)
89 88
DEF_HELPER_FLAGS_1(cvttq_c, TCG_CALL_CONST, i64, i64)
b/target-alpha/op_helper.c
1152 1152
    return float64_to_g(fr);
1153 1153
}
1154 1154

  
1155
uint64_t helper_cvtlq (uint64_t a)
1156
{
1157
    int32_t lo = a >> 29;
1158
    int32_t hi = a >> 32;
1159
    return (lo & 0x3FFFFFFF) | (hi & 0xc0000000);
1160
}
1161

  
1162 1155
/* PALcode support special instructions */
1163 1156
#if !defined (CONFIG_USER_ONLY)
1164 1157
void helper_hw_rei (void)
b/target-alpha/translate.c
598 598
    gen_fp_exc_raise_ignore(rc, fn11, fn11 & QUAL_I ? 0 : float_flag_inexact);
599 599
}
600 600

  
601
static void gen_fcvtlq(int rb, int rc)
602
{
603
    if (unlikely(rc == 31)) {
604
        return;
605
    }
606
    if (unlikely(rb == 31)) {
607
        tcg_gen_movi_i64(cpu_fir[rc], 0);
608
    } else {
609
        TCGv tmp = tcg_temp_new();
610

  
611
        /* The arithmetic right shift here, plus the sign-extended mask below
612
           yields a sign-extended result without an explicit ext32s_i64.  */
613
        tcg_gen_sari_i64(tmp, cpu_fir[rb], 32);
614
        tcg_gen_shri_i64(cpu_fir[rc], cpu_fir[rb], 29);
615
        tcg_gen_andi_i64(tmp, tmp, (int32_t)0xc0000000);
616
        tcg_gen_andi_i64(cpu_fir[rc], cpu_fir[rc], 0x3fffffff);
617
        tcg_gen_or_i64(cpu_fir[rc], cpu_fir[rc], tmp);
618

  
619
        tcg_temp_free(tmp);
620
    }
621
}
622

  
601 623
static void gen_fcvtql(int rb, int rc)
602 624
{
603 625
    if (unlikely(rc == 31)) {
......
647 669
        tcg_temp_free(tmp);                             \
648 670
    }                                                   \
649 671
}
650
FARITH2(cvtlq)
651 672

  
652 673
/* ??? VAX instruction qualifiers ignored.  */
653 674
FARITH2(sqrtf)

Also available in: Unified diff