diff options
author | Sverker Eriksson <[email protected]> | 2016-08-26 12:28:16 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-08-26 12:28:16 +0200 |
commit | d017ade88b8fa39f57aee722dd2e2c5d82e8b262 (patch) | |
tree | 59a0b949d0452f38c52f5d9b1d0e3a57c0a4cbd8 /lib/hipe/ppc/hipe_ppc.erl | |
parent | fbff3418f1c2ac658c6ff5ee808b4a2af0e70c9e (diff) | |
parent | f3e018dc3bb3c74b88c7454f6a1888938215f912 (diff) | |
download | otp-d017ade88b8fa39f57aee722dd2e2c5d82e8b262.tar.gz otp-d017ade88b8fa39f57aee722dd2e2c5d82e8b262.tar.bz2 otp-d017ade88b8fa39f57aee722dd2e2c5d82e8b262.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/hipe/ppc/hipe_ppc.erl')
-rw-r--r-- | lib/hipe/ppc/hipe_ppc.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/hipe/ppc/hipe_ppc.erl b/lib/hipe/ppc/hipe_ppc.erl index 0fa96162f6..380e791bc1 100644 --- a/lib/hipe/ppc/hipe_ppc.erl +++ b/lib/hipe/ppc/hipe_ppc.erl @@ -167,8 +167,10 @@ temp_is_precoloured(#ppc_temp{reg=Reg,type=Type}) -> _ -> hipe_ppc_registers:is_precoloured_gpr(Reg) end. -mk_simm16(Value) -> #ppc_simm16{value=Value}. -mk_uimm16(Value) -> #ppc_uimm16{value=Value}. +mk_simm16(Value) when Value >= -(1 bsl 15), Value < (1 bsl 15) -> + #ppc_simm16{value=Value}. +mk_uimm16(Value) when Value >= 0, Value < (1 bsl 16) -> + #ppc_uimm16{value=Value}. mk_mfa(M, F, A) -> #ppc_mfa{m=M, f=F, a=A}. @@ -240,7 +242,11 @@ mk_li(Dst, Value, Tail) -> % Dst can be R0 Value =< 16#7FFFFFFF -> mk_li32(Dst, R0, Value, Tail); true -> - Highest = (Value bsr 48), % Value@highest + Highest = case (Value bsr 48) of % Value@highest + TopBitSet when TopBitSet >= (1 bsl 15) -> + TopBitSet - (1 bsl 16); % encoder needs it to be negative + FitsSimm16 -> FitsSimm16 + end, Higher = (Value bsr 32) band 16#FFFF, % Value@higher High = (Value bsr 16) band 16#FFFF, % Value@h Low = Value band 16#FFFF, % Value@l |