PPC NCG: Improve pointer de-tagging code

Authored by trommler on Apr 8 2016, 12:40 PM.



Generate a clrr[wd]i instruction to clear the tag bits in a pointer.
This saves one instruction and one temporary register.

Optimize signed comparison with zero after andi. operation
This saves one instruction when comparing a pointer tag with zero.

This reduces code size by 0.6 % in all nofib benchmarks.

Test Plan

validate on AIX and 32-bit Linux

Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
trommler retitled this revision from to PPC NCG: Improve pointer de-tagging code.Apr 8 2016, 12:40 PM
trommler updated this object.
trommler edited the test plan for this revision. (Show Details)
trommler added reviewers: erikd, hvr, austin, bgamari.
trommler updated this revision to Diff 7219.Apr 8 2016, 12:48 PM
  • Fix typo and break long line.
This comment was removed by trommler.
trommler updated this revision to Diff 7220.Apr 8 2016, 1:28 PM
trommler removed rGHC Glasgow Haskell Compiler as the repository for this revision.

Replace diff to recover lost commits.

erikd accepted this revision.Apr 8 2016, 10:02 PM

LGTM. Builds fine on 32 bit PowerPC.

This revision is now accepted and ready to land.Apr 8 2016, 10:02 PM
hvr accepted this revision.Apr 9 2016, 1:54 AM

same on AIX with IBM's as

hvr added a comment.Apr 9 2016, 1:56 AM

FWiw, the overall size of the stripped ghc-stage2 executable seems smaller by roughly 0.5% as well

This revision was automatically updated to reflect the committed changes.