aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/x86/hipe_x86_ra_postconditions.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-11-09 18:49:06 +0100
committerMagnus Lång <[email protected]>2016-11-15 14:58:59 +0100
commit3579a706ea0c0081d7dd01291990cd8d3669f195 (patch)
treeea2df890f7b1a63331cce06a6f8350af4a608526 /lib/hipe/x86/hipe_x86_ra_postconditions.erl
parentcc45e36d1fb0b288ca534fa72fde772b62225e93 (diff)
downloadotp-3579a706ea0c0081d7dd01291990cd8d3669f195.tar.gz
otp-3579a706ea0c0081d7dd01291990cd8d3669f195.tar.bz2
otp-3579a706ea0c0081d7dd01291990cd8d3669f195.zip
hipe_{x86,amd64}: Finish test instr implementation
Diffstat (limited to 'lib/hipe/x86/hipe_x86_ra_postconditions.erl')
-rw-r--r--lib/hipe/x86/hipe_x86_ra_postconditions.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/hipe/x86/hipe_x86_ra_postconditions.erl b/lib/hipe/x86/hipe_x86_ra_postconditions.erl
index f496b71828..e7c397b5b7 100644
--- a/lib/hipe/x86/hipe_x86_ra_postconditions.erl
+++ b/lib/hipe/x86/hipe_x86_ra_postconditions.erl
@@ -83,6 +83,8 @@ do_insn(I, TempMap, Strategy) -> % Insn -> {Insn list, DidSpill}
do_fmove(I, TempMap, Strategy);
#shift{} ->
do_shift(I, TempMap, Strategy);
+ #test{} ->
+ do_test(I, TempMap, Strategy);
_ ->
%% comment, jmp*, label, pseudo_call, pseudo_jcc, pseudo_tailcall,
%% pseudo_tailcall_prepare, push, ret
@@ -308,6 +310,14 @@ do_shift(I, TempMap, Strategy) ->
{FixDst ++ [I#shift{dst=Dst}], DidSpill}
end.
+%%% Fix a test op.
+
+do_test(I, TempMap, Strategy) ->
+ #test{src=Src0,dst=Dst0} = I,
+ {FixSrc, Src, FixDst, Dst, DidSpill} =
+ do_binary(Src0, Dst0, TempMap, Strategy),
+ {FixSrc ++ FixDst ++ [I#test{src=Src,dst=Dst}], DidSpill}.
+
%%% Fix the operands of a binary op.
%%% 1. remove pseudos from any explicit memory operands
%%% 2. if both operands are (implicit or explicit) memory operands,