Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Issue 222403002: ARM: Avoid VMSR instruction when converting to clamped uint8 (Closed)

Created:
6 years, 8 months ago by oetuaho-nv
Modified:
6 years, 8 months ago
Reviewers:
Jarin, jbramley, rmcilroy
CC:
v8-dev
Base URL:
git://github.com/v8/v8.git@master
Visibility:
Public.

Description

ARM: Avoid VMSR instruction when converting to clamped uint8 Setting the FPSCR flags is expensive on some CPUs. Instead, do rounding to the nearest integer by adding 0.5 and truncating towards zero. Additional checks are needed to make sure that numbers ending in exactly .5 get rounded to the nearest even number according to WebIDL spec, but this case is relatively rare and even then the benefits outweigh the costs. Performance increases ranging from 2x to 9x were seen in measurements with a hot-loop benchmark depending on the CPU architecture. This new code path is used on VFP3-capable processors, which have the fixed-point conversion functions. Generic ARM assembler, disassembler, and simulator functions are added for the conversion between fixed point and floating point. A bug in encoding the immediate value in the vcvt_f64_s32 instruction is also fixed by this change. This did not cause behavioral issues before, since in existing uses of the function the order of the bits in the immediate value does not matter, as they are all 1. BUG=3253 LOG=N

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -53 lines) Patch
M src/arm/assembler-arm.h View 1 chunk +4 lines, -1 line 0 comments Download
M src/arm/assembler-arm.cc View 2 chunks +46 lines, -12 lines 0 comments Download
M src/arm/constants-arm.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/arm/disasm-arm.cc View 4 chunks +55 lines, -7 lines 0 comments Download
M src/arm/macro-assembler-arm.cc View 1 chunk +51 lines, -22 lines 3 comments Download
M src/arm/simulator-arm.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/arm/simulator-arm.cc View 3 chunks +77 lines, -7 lines 0 comments Download
M test/cctest/test-assembler-arm.cc View 4 chunks +10 lines, -2 lines 0 comments Download
M test/cctest/test-disasm-arm.cc View 1 chunk +6 lines, -2 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
oetuaho-nv
6 years, 8 months ago (2014-04-02 16:03:01 UTC) #1
jbramley
https://codereview.chromium.org/222403002/diff/1/src/arm/macro-assembler-arm.cc File src/arm/macro-assembler-arm.cc (left): https://codereview.chromium.org/222403002/diff/1/src/arm/macro-assembler-arm.cc#oldcode3819 src/arm/macro-assembler-arm.cc:3819: // Set rounding mode to round to the nearest ...
6 years, 8 months ago (2014-04-03 09:22:48 UTC) #2
oetuaho-nv
Thanks for the quick review, one comment inline. I can look into this alternative solution ...
6 years, 8 months ago (2014-04-03 16:02:45 UTC) #3
Rodolph Perfetta
On 2014/04/03 16:02:45, oetuaho-nv wrote: > Thanks for the quick review, one comment inline. > ...
6 years, 8 months ago (2014-04-03 18:29:20 UTC) #4
jbramley
On 2014/04/03 18:29:20, Rodolph Perfetta wrote: > On 2014/04/03 16:02:45, oetuaho-nv wrote: > > Thanks ...
6 years, 8 months ago (2014-04-04 09:43:05 UTC) #5
oetuaho-nv
On 2014/04/04 09:43:05, jbramley wrote: > I can't find any use of vmsr that sets ...
6 years, 8 months ago (2014-04-04 14:14:17 UTC) #6
jbramley
On 2014/04/04 14:14:17, oetuaho-nv wrote: > On 2014/04/04 09:43:05, jbramley wrote: > > I can't ...
6 years, 8 months ago (2014-04-04 14:34:42 UTC) #7
oetuaho-nv
On 2014/04/04 14:34:42, jbramley wrote: > On 2014/04/04 14:14:17, oetuaho-nv wrote: > > On 2014/04/04 ...
6 years, 8 months ago (2014-04-04 15:16:07 UTC) #8
jbramley
On 2014/04/04 15:16:07, oetuaho-nv wrote: > On 2014/04/04 14:34:42, jbramley wrote: > > On 2014/04/04 ...
6 years, 8 months ago (2014-04-04 15:36:56 UTC) #9
oetuaho-nv
6 years, 8 months ago (2014-04-09 14:10:30 UTC) #10
I now uploaded a new cl that implements the suggested approach:
https://codereview.chromium.org/230473005

I'm closing this one.

Powered by Google App Engine
This is Rietveld 408576698