x86: Always generate add instruction in MO_Add2 (#9013)

Authored by rwbarton on Aug 10 2014, 1:26 PM.


Test Plan
  • ran validate
  • ran T9013 test with all ways
  • ran CarryOverflow test with all ways, for good measure

Diff Detail

rGHC Glasgow Haskell Compiler
Lint Skipped
Unit Tests Skipped
rwbarton updated this revision to Diff 302.Aug 10 2014, 1:26 PM
rwbarton retitled this revision from to x86: Always generate add instruction in MO_Add2 (#9013).
rwbarton updated this object.
rwbarton edited the test plan for this revision. (Show Details)
rwbarton added a reviewer: simonmar.
rwbarton updated the Trac tickets for this revision.

I am eager to fix Trac #9013 not just for its own sake but also because I intend to implement x86-specific code generation for addIntC# and subIntC# using the overflow flag. (In my small Integer addition microbenchmark I get around a 6% speedup.) That code will be similar to the code for plusWord2# and subject to the same issue.

Also, there is quite a lot of code duplication between genCCall32 and genCCall64. I would be happy to look into factoring out the common parts in a separate commit.

Whoops, Build B367: Diff 302 (D137) has failed! Full logs available at F12329.

rwbarton added inline comments.Aug 10 2014, 1:39 PM

I intend to add SUB_CC and perhaps MUL_CC in the future, if that helps explain the placement of this constructor.

Actually, the refactoring of genCCall looks quite trivial. Please hold off on this, I will do the refactoring first and then revise this revision.

rwbarton updated this revision to Diff 313.Aug 10 2014, 3:59 PM
rwbarton edited edge metadata.

Rebased on top of genCCall code deduplication

Whoops, Build B381: Diff 313 (D137) has failed! Full logs available at F12333.

hvr added a subscriber: hvr.Aug 10 2014, 5:20 PM
simonmar accepted this revision.Aug 11 2014, 3:30 AM
simonmar edited edge metadata.

Yeah, I think this is the best (least worst) way to fix the problem.


rwbarton closed this revision.Aug 11 2014, 9:01 AM
rwbarton updated this revision to Diff 320.

Closed by commit rGHC71bd4e310793 (authored by @rwbarton).