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

Issue 6840051: ARM: Implement correct rounding in the lithium codegenerator. (Closed)

Created:
9 years, 8 months ago by Karl Klose
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

ARM: Implement correct rounding in the lithium codegenerator. This patch provides testing for values that have a fraction part of 0.5 and uses a different rounding method for them. The original method of VFPTruncating the value with round-to-nearest is not correct because it does not round to the larger number in case of a tie. BUG=http://code.google.com/p/v8/issues/detail?id=958

Patch Set 1 #

Patch Set 2 : Minor edits. #

Total comments: 7

Patch Set 3 : Implement shorter version. #

Patch Set 4 : Minor fix. #

Total comments: 4

Patch Set 5 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -8 lines) Patch
M src/arm/lithium-codegen-arm.cc View 1 2 3 4 2 chunks +45 lines, -5 lines 0 comments Download
M test/mjsunit/mjsunit.status View 1 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Karl Klose
9 years, 8 months ago (2011-04-14 14:11:43 UTC) #1
Lasse Reichstein
LGTM, but I think it can be simplified in the general case. http://codereview.chromium.org/6840051/diff/7001/src/arm/lithium-codegen-arm.cc File src/arm/lithium-codegen-arm.cc ...
9 years, 8 months ago (2011-04-14 19:09:04 UTC) #2
Søren Thygesen Gjesse
LGMT http://codereview.chromium.org/6840051/diff/7001/src/arm/lithium-codegen-arm.cc File src/arm/lithium-codegen-arm.cc (right): http://codereview.chromium.org/6840051/diff/7001/src/arm/lithium-codegen-arm.cc#newcode2904 src/arm/lithium-codegen-arm.cc:2904: // Exponent is greater or equal zero and ...
9 years, 8 months ago (2011-04-15 07:55:34 UTC) #3
Karl Klose
I have uploaded a shorter version based on Lasse's comments. Lasse, can you have a ...
9 years, 8 months ago (2011-04-15 09:24:17 UTC) #4
Rodolph Perfetta
drive by comments http://codereview.chromium.org/6840051/diff/11001/src/arm/lithium-codegen-arm.cc File src/arm/lithium-codegen-arm.cc (right): http://codereview.chromium.org/6840051/diff/11001/src/arm/lithium-codegen-arm.cc#newcode2893 src/arm/lithium-codegen-arm.cc:2893: // Construct and add 0.5 to ...
9 years, 8 months ago (2011-04-15 09:37:54 UTC) #5
Lasse Reichstein
LGTM http://codereview.chromium.org/6840051/diff/11001/src/arm/lithium-codegen-arm.cc File src/arm/lithium-codegen-arm.cc (right): http://codereview.chromium.org/6840051/diff/11001/src/arm/lithium-codegen-arm.cc#newcode2902 src/arm/lithium-codegen-arm.cc:2902: __ and_(scratch1, scratch1, Operand(HeapNumber::kSignMask)); Just eor scratch3 with ...
9 years, 8 months ago (2011-04-15 09:42:04 UTC) #6
Karl Klose
9 years, 8 months ago (2011-04-15 11:26:06 UTC) #7
Thank you for the review. Using the immediate vmov also frees a register, which
means that we don't need a temp register for the instruction.

http://codereview.chromium.org/6840051/diff/11001/src/arm/lithium-codegen-arm.cc
File src/arm/lithium-codegen-arm.cc (right):

http://codereview.chromium.org/6840051/diff/11001/src/arm/lithium-codegen-arm...
src/arm/lithium-codegen-arm.cc:2893: // Construct and add 0.5 to the input.
On 2011/04/15 09:37:54, Rodolph Perfetta wrote:
> there is a vmov immediate instruction which for 0.5 will translate into one
VFP
> instruction.

Done.

http://codereview.chromium.org/6840051/diff/11001/src/arm/lithium-codegen-arm...
src/arm/lithium-codegen-arm.cc:2902: __ and_(scratch1, scratch1,
Operand(HeapNumber::kSignMask));
On 2011/04/15 09:42:04, Lasse Reichstein wrote:
> Just eor scratch3 with scratch1 and make sure it sets the flags - if the
result
> is negative, the sign changed.

Done.

Powered by Google App Engine
This is Rietveld 408576698