Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Update primary bootstrap | Björn Gustavsson | 2023-03-17 | 59 | -0/+0 |
| | |||||
* | Update primary bootstrap | Björn Gustavsson | 2023-02-10 | 28 | -0/+0 |
| | |||||
* | Update primary bootstrap | Raimo Niskanen | 2023-02-08 | 1 | -0/+0 |
| | |||||
* | Update primary bootstrap | Björn Gustavsson | 2023-02-06 | 6 | -0/+0 |
| | |||||
* | Update primary bootstrap | Björn Gustavsson | 2023-01-31 | 18 | -0/+0 |
| | |||||
* | Merge branch 'maint' | Björn Gustavsson | 2023-01-12 | 39 | -1/+1 |
|\ | | | | | | | | | * maint: Update primary bootstrap | ||||
| * | Update primary bootstrap | Björn Gustavsson | 2023-01-12 | 9 | -0/+0 |
| | | |||||
* | | Update primary bootstrap | Björn Gustavsson | 2022-10-28 | 33 | -0/+0 |
| | | |||||
* | | Update primary bootstrap | Lukas Larsson | 2022-10-14 | 3 | -0/+0 |
| | | |||||
* | | Update primary bootstrap | Björn Gustavsson | 2022-09-16 | 1 | -0/+0 |
| | | |||||
* | | Merge branch 'maint' | Björn Gustavsson | 2022-09-02 | 31 | -0/+0 |
|\ \ | |/ | | | | | | | * maint: Update primary bootstrap | ||||
| * | Update primary bootstrap | Björn Gustavsson | 2022-09-02 | 11 | -3/+3 |
| | | |||||
* | | Optimize binary matching for fixed-width segments | Björn Gustavsson | 2022-09-02 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider this function: foo(<<A:6, B:6, C:6, D:6>>) -> {A, B, C, D}. The compiler in Erlang/OTP 25 and earlier would generate the following code for doing the binary matching: {test,bs_start_match3,{f,1},1,[{x,0}],{x,1}}. {bs_get_position,{x,1},{x,0},2}. {test,bs_get_integer2, {f,3}, 2, [{x,1}, {integer,6}, 1, {field_flags,[{anno,[4,{file,"t.erl"}]},unsigned,big]}], {x,2}}. {test,bs_get_integer2, {f,3}, 3, [{x,1}, {integer,6}, 1, {field_flags,[{anno,[4,{file,"t.erl"}]},unsigned,big]}], {x,3}}. {test,bs_get_integer2, {f,3}, 4, [{x,1}, {integer,6}, 1, {field_flags,[{anno,[4,{file,"t.erl"}]},unsigned,big]}], {x,4}}. {test,bs_get_integer2, {f,3}, 5, [{x,1}, {integer,6}, 1, {field_flags,[{anno,[4,{file,"t.erl"}]},unsigned,big]}], {x,5}}. {test,bs_test_tail2,{f,3},[{x,1},0]}. That is, there would be one instruction for each segment being matched. Having separate match instructions for each segment makes it difficult for the JIT to do any serious optimization. Currently, when matching a segment with a size that is not a multiple of 8, the JIT will generate code that calls a helper function. Common sizes such as 8, 16, and 32 are specially optimized with inline code in the x86 JIT and in the non-JIT BEAM VM. This commit introduces a new `bs_match` instruction for matching of integer and binary segments of fixed size. Here is the generated code for the example: {test,bs_start_match3,{f,1},1,[{x,0}],{x,1}}. {bs_get_position,{x,1},{x,0},2}. {bs_match,{f,3}, {x,1}, {commands,[{ensure_exactly,24}, {integer,2,{literal,[]},6,1,{x,2}}, {integer,3,{literal,[]},6,1,{x,3}}, {integer,4,{literal,[]},6,1,{x,4}}, {integer,5,{literal,[]},6,1,{x,5}}]}}. Having only one instruction for the matching allows the JIT to generate faster code. The generated code will do the following: * Test that the size of the binary being matched is exactly 24 bits. * Read 24 bits from the binary into a temporary CPU register. * For each segment, extract the integer from the temporary register by shifting and masking. Because of the before-mentioned optimization for certain common segment sizes, the main part of the Base64 encoding in the `base64` module is currently implemented in the following non-intuitive way: encode_binary(<<B1:8, B2:8, B3:8, Ls/bits>>, A) -> BB = (B1 bsl 16) bor (B2 bsl 8) bor B3, encode_binary(Ls, <<A/bits,(b64e(BB bsr 18)):8, (b64e((BB bsr 12) band 63)):8, (b64e((BB bsr 6) band 63)):8, (b64e(BB band 63)):8>>) With the new optimization, it is now possible to express the Base64 encoding in a more natural way, which is also faster than before: encode_binary(<<B1:6, B2:6, B3:6, B4:6, Ls/bits>>, A) -> encode_binary(Ls, <<A/bits, (b64e(B1)):8, (b64e(B2)):8, (b64e(B3)):8, (b64e(B4)):8>>) | ||||
* | | Merge branch 'maint' | Björn Gustavsson | 2022-06-27 | 5 | -0/+0 |
|\ \ | |/ | | | | | | | | | | | * maint: Update preloaded modules Update primary bootstrap [features] General tweaks and fixes | ||||
| * | Update primary bootstrap | Cons T Åhs | 2022-06-23 | 1 | -0/+0 |
| | | |||||
* | | Update primary bootstrap | Björn Gustavsson | 2022-06-17 | 56 | -0/+0 |
| | | |||||
* | | Update primary bootstrap | Björn Gustavsson | 2022-06-13 | 6 | -3/+3 |
| | | |||||
* | | Update primary bootstrap | John Högberg | 2022-06-03 | 47 | -0/+0 |
|/ | |||||
* | Update primary bootstrap | Cons T Åhs | 2022-05-03 | 2 | -0/+0 |
| | |||||
* | Update primary bootstrap | Björn Gustavsson | 2022-04-23 | 56 | -0/+0 |
| | |||||
* | Update primary bootstrap | Björn Gustavsson | 2022-04-05 | 15 | -1/+2 |
| | |||||
* | Update primary bootstrap | Cons T Åhs | 2022-03-22 | 2 | -0/+0 |
| | |||||
* | Update primary bootstrap | Cons T Åhs | 2022-03-21 | 1 | -0/+0 |
| | |||||
* | Update primary bootstrap | Björn Gustavsson | 2022-03-15 | 31 | -2/+2 |
| | |||||
* | Update primary bootstrap | Björn Gustavsson | 2022-02-13 | 5 | -0/+0 |
| | |||||
* | Update primary bootstrap | Björn Gustavsson | 2022-02-11 | 31 | -0/+0 |
| | |||||
* | Update primary bootstrap | Björn Gustavsson | 2022-02-02 | 56 | -5/+4 |
| | |||||
* | Update primary bootstrap | John Högberg | 2022-01-11 | 33 | -0/+0 |
| | |||||
* | Merge branch 'maint' | Lukas Larsson | 2021-11-16 | 1 | -0/+0 |
|\ | |||||
| * | Update primary bootstrap | Lukas Larsson | 2021-10-25 | 1 | -0/+0 |
| | | |||||
* | | Update primary bootstrap | Björn Gustavsson | 2021-11-10 | 57 | -1/+1 |
| | | |||||
* | | Update primary bootstrap | John Högberg | 2021-10-22 | 27 | -0/+0 |
| | | |||||
* | | Merge branch 'maint' | Björn Gustavsson | 2021-09-10 | 34 | -4/+3 |
|\ \ | |/ | | | | | | | * maint: Update primary bootstrap | ||||
| * | Update primary bootstrap | Björn Gustavsson | 2021-09-10 | 11 | -1/+1 |
| | | |||||
* | | Update primary bootstrap | Lukas Larsson | 2021-08-09 | 10 | -0/+0 |
|/ | |||||
* | Update primary bootstrap | Björn Gustavsson | 2021-05-04 | 17 | -1/+1 |
| | |||||
* | Update primary bootstrap | Björn Gustavsson | 2021-02-22 | 9 | -0/+1 |
| | |||||
* | Update primary bootstrap | John Högberg | 2021-02-19 | 45 | -0/+0 |
| | |||||
* | Update primary bootstrap | John Högberg | 2021-02-05 | 3 | -0/+0 |
| | |||||
* | Merge branch 'maint' | Björn Gustavsson | 2021-02-03 | 11 | -2/+1 |
|\ | | | | | | | | | | | | | * maint: Update primary bootstrap Update deprecations Deprecate all functions in erl_tidy | ||||
| * | Update primary bootstrap | Björn Gustavsson | 2021-02-03 | 3 | -1/+1 |
| | | |||||
* | | Update primary bootstrap | Hans Bolinder | 2021-01-26 | 9 | -0/+0 |
| | | |||||
* | | Update primary bootstrap | John Högberg | 2021-01-22 | 18 | -0/+0 |
| | | |||||
* | | Update primary bootstrap | Lukas Larsson | 2021-01-22 | 21 | -0/+0 |
| | | |||||
* | | Merge branch 'maint' | Björn Gustavsson | 2020-12-11 | 45 | -2/+4 |
|\ \ | |/ | |||||
| * | Update primary bootstrap | Björn Gustavsson | 2020-12-11 | 4 | -1/+1 |
| | | |||||
| * | Update primary bootstrap | Lukas Larsson | 2020-12-02 | 7 | -0/+0 |
| | | |||||
* | | Merge branch 'rickard/alias/master/OTP-16718' | Rickard Green | 2020-11-12 | 1 | -0/+0 |
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | * rickard/alias/master/OTP-16718: User defined tag in monitor messages Use alias in gen behaviours Introduce aliases for processes Introduce internal references containing pid of creator Allow huge remote references | ||||
| * \ | Merge branch 'rickard/alias/OTP-16718' into rickard/alias/master/OTP-16718 | Rickard Green | 2020-11-12 | 1 | -0/+0 |
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rickard/alias/OTP-16718: User defined tag in monitor messages Use alias in gen behaviours Introduce aliases for processes Introduce internal references containing pid of creator Allow huge remote references | ||||
| | * | | Introduce aliases for processes | Rickard Green | 2020-11-12 | 1 | -0/+0 |
| | | | |