[commit: ghc] master: Add new mbmi and mbmi2 compiler flags (f855769)

git at git.haskell.org git at git.haskell.org
Mon Jan 22 01:39:38 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f855769690eb998ea25818ee794714957852af48/ghc

>---------------------------------------------------------------

commit f855769690eb998ea25818ee794714957852af48
Author: John Ky <newhoggy at gmail.com>
Date:   Sun Jan 21 11:55:45 2018 -0500

    Add new mbmi and mbmi2 compiler flags
    
    This adds support for the bit deposit and extraction operations provided
    by the BMI and BMI2 instruction set extensions on modern amd64 machines.
    
    Implement x86 code generator for pdep and pext.  Properly initialise
    bmiVersion field.
    
    pdep and pext test cases
    
    Fix pattern match for pdep and pext instructions
    
    Fix build of pdep and pext code for 32-bit architectures
    
    Test Plan: Validate
    
    Reviewers: austin, simonmar, bgamari, angerman
    
    Reviewed By: bgamari
    
    Subscribers: trommler, carter, angerman, thomie, rwbarton, newhoggy
    
    GHC Trac Issues: #14206
    
    Differential Revision: https://phabricator.haskell.org/D4236


>---------------------------------------------------------------

f855769690eb998ea25818ee794714957852af48
 compiler/cmm/CmmMachOp.hs                          |   2 +
 compiler/cmm/CmmParse.y                            |  10 ++
 compiler/cmm/PprC.hs                               |   2 +
 compiler/codeGen/StgCmmPrim.hs                     |  28 +++++
 compiler/coreSyn/MkCore.hs                         |   1 -
 compiler/llvmGen/LlvmCodeGen/CodeGen.hs            |  97 +++++++++++++----
 compiler/main/DriverPipeline.hs                    |   2 +
 compiler/main/DynFlags.hs                          |  27 +++++
 compiler/nativeGen/CPrim.hs                        |  20 ++++
 compiler/nativeGen/PPC/CodeGen.hs                  |   2 +
 compiler/nativeGen/SPARC/CodeGen.hs                |   2 +
 compiler/nativeGen/X86/CodeGen.hs                  |  69 +++++++++++++
 compiler/nativeGen/X86/Instr.hs                    |   9 ++
 compiler/nativeGen/X86/Ppr.hs                      |  13 +++
 compiler/prelude/primops.txt.pp                    |  22 ++++
 libraries/ghc-prim/cbits/pdep.c                    |  48 +++++++++
 libraries/ghc-prim/cbits/pext.c                    |  44 ++++++++
 libraries/ghc-prim/ghc-prim.cabal                  |   2 +
 testsuite/tests/codeGen/should_run/all.T           |   2 +
 testsuite/tests/codeGen/should_run/cgrun075.hs     | 115 +++++++++++++++++++++
 .../{cgrun071.stdout => cgrun075.stdout}           |   0
 testsuite/tests/codeGen/should_run/cgrun076.hs     | 115 +++++++++++++++++++++
 .../{cgrun071.stdout => cgrun076.stdout}           |   0
 23 files changed, 611 insertions(+), 21 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f855769690eb998ea25818ee794714957852af48


More information about the ghc-commits mailing list