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

Issue 10829169: Refactor Math.min/max to be a single HInstruction. (Closed)

Created:
8 years, 4 months ago by Jakob Kummerow
Modified:
8 years, 4 months ago
Reviewers:
Erik Corry, Yang
CC:
v8-dev
Visibility:
Public.

Description

Refactor Math.min/max to be a single HInstruction. That allows us to dynamically compute representations and insert appropriate HChange instructions. Committed: https://code.google.com/p/v8/source/detail?r=12265

Patch Set 1 #

Total comments: 11

Patch Set 2 : review feedback; removed VORR instruction #

Unified diffs Side-by-side diffs Delta from patch set Stats (+448 lines, -152 lines) Patch
M src/arm/lithium-arm.h View 4 chunks +14 lines, -1 line 0 comments Download
M src/arm/lithium-arm.cc View 1 chunk +19 lines, -0 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 1 chunk +62 lines, -0 lines 0 comments Download
M src/arm/simulator-arm.h View 1 2 chunks +30 lines, -6 lines 0 comments Download
M src/arm/simulator-arm.cc View 1 1 chunk +25 lines, -67 lines 0 comments Download
M src/hydrogen.cc View 1 3 chunks +13 lines, -75 lines 0 comments Download
M src/hydrogen-instructions.h View 5 chunks +45 lines, -1 line 0 comments Download
M src/hydrogen-instructions.cc View 2 chunks +32 lines, -0 lines 0 comments Download
M src/ia32/assembler-ia32.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/ia32/assembler-ia32.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M src/ia32/disasm-ia32.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 1 chunk +61 lines, -0 lines 0 comments Download
M src/ia32/lithium-ia32.h View 4 chunks +14 lines, -1 line 0 comments Download
M src/ia32/lithium-ia32.cc View 1 chunk +20 lines, -0 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 1 chunk +61 lines, -0 lines 0 comments Download
M src/x64/lithium-x64.h View 4 chunks +14 lines, -1 line 0 comments Download
M src/x64/lithium-x64.cc View 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Jakob Kummerow
Please review. Erik: Please look at the ARM specific changes. Yang: Please look at everything ...
8 years, 4 months ago (2012-08-03 16:13:14 UTC) #1
Erik Corry
ARM part LGTM http://codereview.chromium.org/10829169/diff/1/src/arm/disasm-arm.cc File src/arm/disasm-arm.cc (right): http://codereview.chromium.org/10829169/diff/1/src/arm/disasm-arm.cc#newcode1222 src/arm/disasm-arm.cc:1222: instr->Opc1Value() == 0x2) { This tests ...
8 years, 4 months ago (2012-08-06 10:44:39 UTC) #2
Yang
LGTM with comments. https://chromiumcodereview.appspot.com/10829169/diff/1/src/arm/lithium-codegen-arm.cc File src/arm/lithium-codegen-arm.cc (right): https://chromiumcodereview.appspot.com/10829169/diff/1/src/arm/lithium-codegen-arm.cc#newcode1687 src/arm/lithium-codegen-arm.cc:1687: __ vadd(result_reg, left_reg, right_reg); On 2012/08/06 ...
8 years, 4 months ago (2012-08-06 10:50:41 UTC) #3
Erik Corry
An extra afterthought: There are test-assembler-arm.cc and test-disassembler-arm.cc files and they should have vorr added ...
8 years, 4 months ago (2012-08-06 11:28:39 UTC) #4
Jakob Kummerow
8 years, 4 months ago (2012-08-06 14:08:43 UTC) #5
Addressed feedback.

Also removed support for VORR because it is a NEON instruction.

https://chromiumcodereview.appspot.com/10829169/diff/1/src/arm/disasm-arm.cc
File src/arm/disasm-arm.cc (right):

https://chromiumcodereview.appspot.com/10829169/diff/1/src/arm/disasm-arm.cc#...
src/arm/disasm-arm.cc:1222: instr->Opc1Value() == 0x2) {
On 2012/08/06 10:44:40, Erik Corry wrote:
> This tests bits 20, 21, 23, 24, but ignores bits 25-27 and 22 and 4-7.  Should
> it not say 'Unknown' if they do not match the expectations for vorr?

As discussed, removed vorr completely.

https://chromiumcodereview.appspot.com/10829169/diff/1/src/arm/lithium-codege...
File src/arm/lithium-codegen-arm.cc (right):

https://chromiumcodereview.appspot.com/10829169/diff/1/src/arm/lithium-codege...
src/arm/lithium-codegen-arm.cc:1687: __ vadd(result_reg, left_reg, right_reg);
On 2012/08/06 10:50:41, Yang wrote:
> On 2012/08/06 10:44:40, Erik Corry wrote:
> > Should this be vand?
> 
> I think vadd would work equally well here:
> -0 + -0 = -0
> -0 + 0 = 0
> 0 + -0 = 0
> 0 + 0 = 0

Added a comment explaining why "vadd" is not a typo.

https://chromiumcodereview.appspot.com/10829169/diff/1/src/arm/simulator-arm.cc
File src/arm/simulator-arm.cc (right):

https://chromiumcodereview.appspot.com/10829169/diff/1/src/arm/simulator-arm....
src/arm/simulator-arm.cc:2679: instr->Opc1Value() == 0x2) {
On 2012/08/06 10:44:40, Erik Corry wrote:
> Same question here as in the disassembler?

Same answer: removed vorr.

https://chromiumcodereview.appspot.com/10829169/diff/1/src/hydrogen.cc
File src/hydrogen.cc (right):

https://chromiumcodereview.appspot.com/10829169/diff/1/src/hydrogen.cc#newcod...
src/hydrogen.cc:2559: // the right side.
On 2012/08/06 10:50:41, Yang wrote:
> Please update comment.

Done.

https://chromiumcodereview.appspot.com/10829169/diff/1/src/ia32/lithium-codeg...
File src/ia32/lithium-codegen-ia32.cc (right):

https://chromiumcodereview.appspot.com/10829169/diff/1/src/ia32/lithium-codeg...
src/ia32/lithium-codegen-ia32.cc:1532: __ j(equal, &check_zero, Label::kNear); 
// left == right.
On 2012/08/06 10:50:41, Yang wrote:
> As discussed offline, it might be worth branching on zero-flag first and only
in
> case the zero-flag is set, check for parity flag. For the usual case where
> arguments are not equal, we can save one jump instruction. 

As discussed offline, I'd prefer to keep the architectures in sync. Hopefully
the branch prediction is good enough to mitigate the difference.

Powered by Google App Engine
This is Rietveld 408576698