aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/rtl/hipe_tagscheme.erl
AgeCommit message (Collapse)Author
2017-03-06hipe_tagscheme: Small codegen improvementsMagnus Lång
2017-03-06hipe: Improve code generation for element/2Magnus Lång
* Omit bounds check in more cases. A test case that needs this change to omit bounds check is added. * Improve code generation by reformulating bounds check to decrease register pressure.
2017-03-02hipe_rtl: Inline more of match eq testMagnus Lång
With this change, both the matches and does not match cases have fastpaths that does not need to call primops.
2016-11-23Remove obsolete CVS keyword markupRichard Carlsson
2016-11-23Correct copyright on remaining hipe filesRichard Carlsson
2016-11-16hipe_tagscheme: Simplify test_two_fixnums with immMagnus Lång
test_two_fixnums would previously only check its right-hand argument for immediates, but not it's left. Now, test_two_fixnums reduces to test_fixnum if either argument is an immediate.
2016-11-16hipe_tagscheme: x86 lea+test for mask_and_compareMagnus Lång
By changing mask_and_compare from and,sub to sub,and, x86 can use a 3-address LEA immediate add, saving a mov. The RISC backends should see no change in sequence length. We make test_(heap_|sub)binary use mask_and_compare so they will benefit too.
2016-11-16hipe_tagscheme: Improve fixnum_addsub with immMagnus Lång
The addsub sequence was suboptimal when one of the arguments was immediate, because it became an immediate alu followed by an immediate alub, and the optimisers would not combine them due to the risk of altering the branch. However, in this case we know that such a rewrite is safe, and do it directly in hipe_tagscheme:fixnum_addsub/5 instead.
2016-11-16hipe_tagscheme: Improve fixnum add on x86Magnus Lång
With the introduction of immediate adds encoded as 'LEA' on x86, it is now possible to do a fixnum add in two instructions and one branch by commuting the addition and reusing the result register as a temporary, which makes the 'alub' a 2-address add, saving a move instruction.
2016-11-15hipe_rtl: unify branch and alubMagnus Lång
branch and alub overlap in their use cases, but the backends rely on knowing that the result is unused in their lowering of branch. By extending alub so that the destination is optional, it can fully replace branch. This simplifies rtl by reducing code duplication and the number of instructions. Also, in the x86 and arm backends, we can now use 'test' and {'tst','mvn','teq'} to lower some alubs without destinations. This is particularly good for x86, as sequences such as 'is_boxed' type tests now get shorter (both from not needing a mov to copy the variable, but also from the fact that 'testb' encodes shorter than 'andq').
2016-10-14hipe,erts: Remove cached fun 'native_address'Sverker Eriksson
Did not work with purge and made worse by new purge strategy. Did yield terrible performance when fun thing is created *before* fun code is loaded. Like when receiving not yet loaded fun from other node. The cached 'native_address' in ErlFunThing will not be updated leading to mode switch and error_handler being called for every call to the fun from native code.
2015-11-27hipe: Fix constructing huge binariesMagnus Lång
Bugs were fixed in hipe_rtl_binary_match:{first_part/3,make_size/3,set_high/1} in commit 5aea81c49, but it turns out these had been copy-pasted verbatim into hipe_rtl_binary_construct, where they were causing further bugs. They have now moved to hipe_rtl_binary, from where they are included by the other two modules. Furthermore, first_part/3 (reamed get_word_integer/3, since it loads integers that fits into an unsigned word), and make_size/3 now accepts a fourth argument to distinguish too large arguments (which should cause a system_limit exception) from negative or non-integral arguments. The use of first_part/3 (get_word_integer/3) from 5aea81c49 in hipe_rtl_binary_construct now allows several binary construction instructions to accept bignum sizes, as they were supposed to. Additionally, calls to hipe_rtl_binary_construct:check_and_untag_fixnum/3 were replaced with get_word_integer/4 since all of them were also supposed to accept sufficiently small bignums, but didn't, and check_and_untag_fixnum/3 was essentially identical to first_part/3 anyway. HiPE is now capable of passing bs_construct_SUITE completely unmodified.
2015-10-02Fix matching with huge binariesKostis Sagonas
In certain cases of matching with very big binaries, the HiPE compiler generated code that would fail the match, even in cases that the matching was successful. The problem was more quite noticeable on 32-bit platforms where certain integer quantities would be represented as bignums. Brief summary of changes: * gen_rtl({bs_skip_bits, ...}, ...) could not handle too large constants. Previously the constants were truncated to word size. * hipe_rtl_binary_match:make_size/3 erroneously assumed that the output of first_part/3 would not overflow when multiplied by 8, which is no longer true. To maintain full performance, the overflow test is only performed when BitsVar was a bignum. Thus, the fast path is identical to before. * hipe_rtl_binary_match:set_high/2 was assuming that only bits below bit 27 were ever set in arguments to bs_skip_bits, which is not only false when the arguments are bignums, but also on 64-bit platforms. The commit includes a test taken from the bs_match_bin_SUITE. Most of the credit for finding these HiPE compiler errors and for creating appropriate fixes for them should go to Magnus Lång.
2015-06-22Merge branch 'bruce/change-license'Bruce Yinhe
OTP-12845 * bruce/change-license: fix errors caused by changed line numbers Change license text to APLv2
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-13Eliminate a dialyzer warningKostis Sagonas
For quite some time now, this module generated a (quite harmless) dialyzer warning. Comment out a clause which was actually unreachable. While at it, do some small code refactorings here and there.
2015-03-25Revert "hipe: Handle separate hashmap tag correctly"Björn-Egil Dahlberg
This reverts commit 4dc5f194b0a5a6f052763bb7494b0458f98d96ca.
2015-03-19hipe: Handle separate hashmap tag correctlySverker Eriksson
This is a temporary fix, it's probably a better solution to combine into one header tag for both map types.
2014-03-28Add support for the compilation of the is_map/1 guard to native codeKostis Sagonas
Namely, extend the HiPE tagging scheme info, properly handle the translation of the (is_)map type test to Icode and RTL and support handling of the map() type in the type system. While at it, also performed some clean up of things that needed small fixes.
2014-03-19Remove RTL code that handled the (is_)constant guardKostis Sagonas
The (is_)constant/1 guard is removed from Erlang long ago and thus there is no need to handle it in RTL. While editing these files, also performed some minor cleanup.
2013-03-10Update a commentKostis Sagonas
2011-03-22Fix hipe bug in convert_matchstate, bignum-padding one word too longSverker Eriksson
2011-03-11Update copyright yearsBjörn-Egil Dahlberg
2010-07-20One off-heap list, to eliminate two words per ETS object.Sverker Eriksson
Merging the three off-heap lists (binaries, funs and externals) into one list. This reduces memory consumption by two words (pointers) per ETS object.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP