<feed xmlns='http://www.w3.org/2005/Atom'>
<title>otp.git/lib/hipe/rtl, branch OTP-18.2.2</title>
<subtitle>Mirror of Erlang/OTP repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/'/>
<entry>
<title>Merge branch 'kostis/hipe-bs-match-huge-bin' into maint</title>
<updated>2015-11-09T15:03:37+00:00</updated>
<author>
<name>Henrik Nord</name>
<email>henrik@erlang.org</email>
</author>
<published>2015-11-09T15:03:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=8e478dd409d2760ca38a7ddbc66b656b9d47f7dc'/>
<id>8e478dd409d2760ca38a7ddbc66b656b9d47f7dc</id>
<content type='text'>
* kostis/hipe-bs-match-huge-bin:
  Fix matching with huge binaries
  Compile without errors for exported variables

OTP-13092
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* kostis/hipe-bs-match-huge-bin:
  Fix matching with huge binaries
  Compile without errors for exported variables

OTP-13092
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix edge case of Size = 0 in bs_put_integer</title>
<updated>2015-10-12T05:53:20+00:00</updated>
<author>
<name>Kostis Sagonas</name>
<email>kostis@it.uu.se</email>
</author>
<published>2015-10-12T05:53:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=d94a8ef6dc136dd2eedf3c3ad4bc053ca8fdd1b0'/>
<id>d94a8ef6dc136dd2eedf3c3ad4bc053ca8fdd1b0</id>
<content type='text'>
copy_offset_int_big was assuming (Offset + Size - 1) (Tmp9 in the first
BB) would not underflow. It was also unconditionally reading and writing
the binary even when Size was zero, unlike copy_int_little, which is the
only other case of bs_put_integer that does not have a short-circuit on
Size = 0.

This was causing segfaults when constructing binaries starting with a
zero-length integer field, because a logical right shift was used to
compute an offset in bytes (which became 0x1fffffffffffffff) to read in
the binary.

Tests, taken from the emulator bs_construct_SUITE, were also added.
The complete credit for the report and the fix goes to Magnus Lång.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
copy_offset_int_big was assuming (Offset + Size - 1) (Tmp9 in the first
BB) would not underflow. It was also unconditionally reading and writing
the binary even when Size was zero, unlike copy_int_little, which is the
only other case of bs_put_integer that does not have a short-circuit on
Size = 0.

This was causing segfaults when constructing binaries starting with a
zero-length integer field, because a logical right shift was used to
compute an offset in bytes (which became 0x1fffffffffffffff) to read in
the binary.

Tests, taken from the emulator bs_construct_SUITE, were also added.
The complete credit for the report and the fix goes to Magnus Lång.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix matching with huge binaries</title>
<updated>2015-10-02T13:08:00+00:00</updated>
<author>
<name>Kostis Sagonas</name>
<email>kostis@it.uu.se</email>
</author>
<published>2015-10-02T12:50:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=5aea81c495f06d58d72b5d3dba86ed9326b1eb14'/>
<id>5aea81c495f06d58d72b5d3dba86ed9326b1eb14</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Compile without errors for exported variables</title>
<updated>2015-10-02T13:08:00+00:00</updated>
<author>
<name>Kostis Sagonas</name>
<email>kostis@it.uu.se</email>
</author>
<published>2015-10-02T10:44:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=c881813b0643138e9b1c1b1a573645460f14404e'/>
<id>c881813b0643138e9b1c1b1a573645460f14404e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'bruce/change-license'</title>
<updated>2015-06-22T13:44:54+00:00</updated>
<author>
<name>Bruce Yinhe</name>
<email>bruce@erlang.org</email>
</author>
<published>2015-06-22T13:42:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=8f63667b316cdff10e666b8f5b0b6a92bd722e5a'/>
<id>8f63667b316cdff10e666b8f5b0b6a92bd722e5a</id>
<content type='text'>
OTP-12845

* bruce/change-license:
  fix errors caused by changed line numbers
  Change license text to APLv2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OTP-12845

* bruce/change-license:
  fix errors caused by changed line numbers
  Change license text to APLv2
</pre>
</div>
</content>
</entry>
<entry>
<title>Change license text to APLv2</title>
<updated>2015-06-18T09:31:02+00:00</updated>
<author>
<name>Bruce Yinhe</name>
<email>bruce@erlang.org</email>
</author>
<published>2015-06-18T09:31:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=738c34d4bb8f1a3811acd00af8c6c12107f8315b'/>
<id>738c34d4bb8f1a3811acd00af8c6c12107f8315b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Eliminate a dialyzer warning</title>
<updated>2015-06-13T13:23:52+00:00</updated>
<author>
<name>Kostis Sagonas</name>
<email>kostis@it.uu.se</email>
</author>
<published>2015-06-13T13:23:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=95c318bf220451d5e223dbb166e6c9da4c7d067f'/>
<id>95c318bf220451d5e223dbb166e6c9da4c7d067f</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>erts,hipe: Optimize away calls to emasculate_binary</title>
<updated>2015-04-21T13:41:56+00:00</updated>
<author>
<name>Sverker Eriksson</name>
<email>sverker@erlang.org</email>
</author>
<published>2015-04-21T13:33:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=e40aab7e9fb9d622e9879efa43af2ce30b287450'/>
<id>e40aab7e9fb9d622e9879efa43af2ce30b287450</id>
<content type='text'>
Only call emasculate_binary if ProcBin.flags is set,
which means it's a writable binary.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only call emasculate_binary if ProcBin.flags is set,
which means it's a writable binary.
</pre>
</div>
</content>
</entry>
<entry>
<title>erts,hipe: Fix bug in binary matching of writable binary</title>
<updated>2015-04-20T13:52:27+00:00</updated>
<author>
<name>Sverker Eriksson</name>
<email>sverker@erlang.org</email>
</author>
<published>2015-04-20T13:52:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=91fb6636f95f882b75170fb77c412ccc4a9b75f4'/>
<id>91fb6636f95f882b75170fb77c412ccc4a9b75f4</id>
<content type='text'>
Seen symptom: Hipe compiled code with &lt;&lt;C/utf8, ...&gt;&gt; = Bin does sometimes
not match even though Bin contains a valid utf8 character. There might be
other possible binary matching symptoms, as the problem is not utf8
specific.

Problem: A writable binary was not "emasculated" when the matching started
(as it should) by the hipe compiled code.

Fix: Add a new primop emasculate_binary(Bin) that is called when
a matchstate is created.

ToDo: There are probably room for optimization. For example only call
emasculate_binary if ProcBin.flags is set.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Seen symptom: Hipe compiled code with &lt;&lt;C/utf8, ...&gt;&gt; = Bin does sometimes
not match even though Bin contains a valid utf8 character. There might be
other possible binary matching symptoms, as the problem is not utf8
specific.

Problem: A writable binary was not "emasculated" when the matching started
(as it should) by the hipe compiled code.

Fix: Add a new primop emasculate_binary(Bin) that is called when
a matchstate is created.

ToDo: There are probably room for optimization. For example only call
emasculate_binary if ProcBin.flags is set.
</pre>
</div>
</content>
</entry>
<entry>
<title>hipe: rtl: fix phi_remove_pred/2 FP moves</title>
<updated>2015-01-11T12:10:42+00:00</updated>
<author>
<name>Mikael Pettersson</name>
<email>mikpelinux@gmail.com</email>
</author>
<published>2015-01-08T18:30:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=12e0894de1e1a5507b4b088a8bd5f89f8bd25b63'/>
<id>12e0894de1e1a5507b4b088a8bd5f89f8bd25b63</id>
<content type='text'>
hipe_rtl:phi_remove_pred/2 can produce a #move{} instruction with
floating-point temporaries as operands, even though such moves MUST
be #fmove{} instructions.

Added type checks to the #move{} and #fmove{} constructor and setter
functions to ensure that similar mishaps cannot happen again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
hipe_rtl:phi_remove_pred/2 can produce a #move{} instruction with
floating-point temporaries as operands, even though such moves MUST
be #fmove{} instructions.

Added type checks to the #move{} and #fmove{} constructor and setter
functions to ensure that similar mishaps cannot happen again.
</pre>
</div>
</content>
</entry>
</feed>
