On 2013/09/17 05:58:31, Sven Panne wrote:
On 2013/09/16 14:54:24, Bangfu wrote:
> On 2013/09/16 13:51:48, Sven Panne wrote:
> > Committed patchset #2 manually as r16735.
>
> for example:
>
> var b = 0x1234;
> function rol(num, cnt)
> {
> return (num << cnt) | (num >>> (32 - cnt));
> }
> var c;
> for(var i = 0; i < 1000; i++)
> {
> c = rol(b, 30);
> }
>
> In the above example, V8 compiler would replace cnt and (32-cnt) with
two
> constants operands if function rol() is inlined during optimization.
Therefore,
> the old logic failed to detect it's a rotation.
Well, that's a nano-benchmark again, we would be interested in something
non-synthetic: Is there a real-world application or some other motivation
for
this patch?
The motivations are:
1. To improve current function working properly without adding extra
complexity.
2. Rotation is often used in encryption application such as, secure hash
algorithm. Rotation is much faster than "two shifts OR".
Thanks.
https://codereview.chromium.org/24095002/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.