diff options
author | Marcus Arendt <[email protected]> | 2015-01-19 15:12:37 +0100 |
---|---|---|
committer | Marcus Arendt <[email protected]> | 2015-01-19 15:12:37 +0100 |
commit | 677cb69c4c919e40d074df3bae40338a375a4731 (patch) | |
tree | 535ea1255610910c5706c83e38d0cece0e324d8d /lib/hipe/x86 | |
parent | 50a92094372b45c9864afe3418b79605da549122 (diff) | |
parent | 12e0894de1e1a5507b4b088a8bd5f89f8bd25b63 (diff) | |
download | otp-677cb69c4c919e40d074df3bae40338a375a4731.tar.gz otp-677cb69c4c919e40d074df3bae40338a375a4731.tar.bz2 otp-677cb69c4c919e40d074df3bae40338a375a4731.zip |
Merge branch 'mikpe/hipe-fconv-fmove-fixes/OTP-12413' into maint
* mikpe/hipe-fconv-fmove-fixes/OTP-12413:
hipe: rtl: fix phi_remove_pred/2 FP moves
hipe: backends: correct #fconv{} translation
Diffstat (limited to 'lib/hipe/x86')
-rw-r--r-- | lib/hipe/x86/hipe_rtl_to_x86.erl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/hipe/x86/hipe_rtl_to_x86.erl b/lib/hipe/x86/hipe_rtl_to_x86.erl index d77e4fed3b..36da2f4d44 100644 --- a/lib/hipe/x86/hipe_rtl_to_x86.erl +++ b/lib/hipe/x86/hipe_rtl_to_x86.erl @@ -236,7 +236,7 @@ conv_insn(I, Map, Data) -> #fconv{} -> {Dst, Map0} = conv_dst(hipe_rtl:fconv_dst(I), Map), {[], Src, Map1} = conv_src(hipe_rtl:fconv_src(I), Map0), - I2 = [hipe_x86:mk_fmove(Src, Dst)], + I2 = conv_fconv(Dst, Src), {I2, Map1, Data}; X -> %% gctest?? @@ -712,6 +712,19 @@ vmap_lookup(Map, Key) -> vmap_bind(Map, Key, Val) -> gb_trees:insert(Key, Val, Map). +%%% Finalise the conversion of an Integer-to-Float operation. + +conv_fconv(Dst, Src) -> + case hipe_x86:is_imm(Src) of + false -> + [hipe_x86:mk_fmove(Src, Dst)]; + true -> + %% cvtsi2sd does not allow src to be an immediate + Tmp = new_untagged_temp(), + [hipe_x86:mk_move(Src, Tmp), + hipe_x86:mk_fmove(Tmp, Dst)] + end. + %%% Finalise the conversion of a 2-address FP operation. conv_fp_unary(Dst, Src, FpUnOp) -> |