Make better use of the x86 addressing mode
AbandonedPublic

Authored by tibbe on Jun 9 2014, 4:57 AM.

Details

Reviewers
simonmar
Summary

We now emit

movq %rdi,16(%r14,%rsi,8)

instead of

leaq 16(%r14),%rax
movq %rdi,(%rax,%rsi,8)

This helps e.g. byte array indexing.

Add more primops for atomic ops on byte arrays

Adds the following primops:

  • atomicReadIntArray#
  • atomicWriteIntArray#
  • fetchSubIntArray#
  • fetchOrIntArray#
  • fetchXorIntArray#
  • fetchAndIntArray#

Makes these pre-existing out-of-line primops inline:

  • fetchAddIntArray#
  • casIntArray#
Test Plan

Ran new unit test. Looked at generated assembly code.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Branch
atomics
Lint
No Linters Available
Unit
No Unit Test Coverage
tibbe updated this revision to Diff 27.Jun 9 2014, 4:57 AM
tibbe retitled this revision from to Make better use of the x86 addressing mode.
tibbe updated this object.
tibbe edited the test plan for this revision. (Show Details)
tibbe added a reviewer: simonmar.
hvr added a subscriber: hvr.Jun 9 2014, 6:18 AM
simonmar requested changes to this revision.Jun 9 2014, 7:59 AM
simonmar edited edge metadata.

Could you separate these into two diffs please?

This revision now requires changes to proceed.Jun 9 2014, 7:59 AM