Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,391
    • Issues 4,391
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 375
    • Merge Requests 375
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Wiki
    • Simd
    • Implementation
  • status

Last edited by Takenobu Tani Jun 11, 2020
Page history New page
This is an old version of this page. You can view the most recent version or browse the history.

status

Current Status

As of 26 June 2017

Tickets

Status: closed (2 matches)

    Ticket (Ticket query: keywords: SIMD, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: id)
  </th>
    Type (Ticket query: keywords: SIMD, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: type)
  </th>
    Summary (Ticket query: keywords: SIMD, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: summary)
  </th>
    Priority (Ticket query: keywords: SIMD, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, desc: 1, order: priority)
  </th>
    Owner (Ticket query: keywords: SIMD, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: owner)
  </th>
                </td>
#8033 (closed)
                </td>
                  task
                </th>
                </td>
add AVX register support to llvm calling convention
                </th>
                </td>
                  normal
                </th>
                </td>
                </th>
          </td></tr>
                </td>
#10286 (closed)
                </td>
                  bug
                </th>
                </td>
native code generator: GHC crash at GHC.Prim SIMD vector
                </th>
                </td>
                  normal
                </th>
                </td>
                </th>
          </td></tr>

Status: new (5 matches)

      </th>
    Ticket (Ticket query: keywords: SIMD, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: id)
  </th>
    Type (Ticket query: keywords: SIMD, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: type)
  </th>
    Summary (Ticket query: keywords: SIMD, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: summary)
  </th>
    Priority (Ticket query: keywords: SIMD, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, desc: 1, order: priority)
  </th>
    Owner (Ticket query: keywords: SIMD, group: status, max: 0, col: id, col: type, col: summary, col: priority, col: owner, order: owner)
  </th>
                </td>
#3557
                </td>
                  feature request
                </th>
                </td>
CPU Vector instructions in GHC.Prim
                </th>
                </td>
                  normal
                </th>
                </td>
                </th>
          </td></tr>
                </td>
#7741
                </td>
                  feature request
                </th>
                </td>
Add SIMD support to x86/x86_64 NCG
                </th>
                </td>
                  normal
                </th>
                </td>
                  abhir00p
                  
                  
                  
                  
                </th>
          </td></tr>
                </td>
#10648
                </td>
                  bug
                </th>
                </td>
Some 64-vector SIMD primitives are absolutely useless
                </th>
                </td>
                  normal
                </th>
                </td>
                </th>
          </td></tr>
                </td>
#13852
                </td>
                  feature request
                </th>
                </td>
Can we have more SIMD primops, corresponding to the untapped AVX etc. instructions?
                </th>
                </td>
                  normal
                </th>
                </td>
                </th>
          </td></tr>
                </td>
#12412 (closed)
                </td>
                  bug
                </th>
                </td>
SIMD things introduce a metric ton of known key things
                </th>
                </td>
                  low
                </th>
                </td>
                </th>
          </td></tr></table>

Vector types

Vectors of the following types are implemented: Int32, Int64, Float, and Double. These types and their associated primops can be found in `GHC.Prim`.

Fixed and variable sized vectors

For each type, currently only one vector width is implemented, namely the width that is appropriate for SSE2. This means that vectors are currently all 16 bytes in size.

Code generators

Only the LLVM code generator (i.e. -fllvm) is supported. However, work is afoot to add support to the NCG as well.

Cmm layer

Our CmmType representation for vectors differs slightly from the proposal. See cmm/CmmType.hs.

See cmm/CmmMachOp.hs for the new vector MachOps.

Core layer

The implementation differs from the proposal in its naming scheme. We wanted to avoid overloading the term "vector," so, e.g., a 4-wide SIMD vector of Float#s is a FloatX4#.

See compiler/prelude/primops.txt.pp for the new primops. Not everything in the proposal is implemented, but we do have a useful subset.

Native vector sizes

This is unimplemented. Instead we define a higher-level Multi data family whose instance is platform-dependent. For example, a Multi Int is represented using an Int32X4# on a 32-bit platform, and by a Int64X2# on a 64-bit platform.

ABIs and calling conventions

Integrating variable-sized vectors with GHC's calling convention is a challenge. How many new registers do we add? Do we add registers for each vector type? The correct approach is unclear, so the current implementation passes all SIMD vectors on the stack.

Memory alignment for vectors

The implementation does not attempt to align memory containing SIMD vectors. SIMD vector loads and stores do not assume alignment.

Other resources of interest

  • This ghc-devs discussion: https://mail.haskell.org/pipermail/ghc-devs/2017-March/013899.html
Clone repository Edit sidebar

GHC Home

Joining In

Newcomers info
Mailing Lists & IRC
The GHC Team

Documentation

GHC Status Info
Working conventions
Building Guide
Commentary

Wiki

Title Index
Recent Changes