[GHC] #15249: Add support for cmpeq and cmpgt MMX intrinsics

#15249: Add support for cmpeq and cmpgt MMX intrinsics -------------------------------------+------------------------------------- Reporter: newhoggy | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Keywords: primops | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Add primop support for the following MMX intrinsics: {{{#!c __m64 _mm_cmpeq_pi16 (__m64 a, __m64 b) __m64 _mm_cmpeq_pi32 (__m64 a, __m64 b) __m64 _mm_cmpeq_pi8 (__m64 a, __m64 b) __m64 _mm_cmpeq_pi8 (__m64 a, __m64 b) __m64 _mm_cmpgt_pi16 (__m64 a, __m64 b) __m64 _mm_cmpgt_pi32 (__m64 a, __m64 b) __m64 _mm_cmpgt_pi8 (__m64 a, __m64 b) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15249 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15249: Add support for cmpeq and cmpgt MMX intrinsics -------------------------------------+------------------------------------- Reporter: newhoggy | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: primops Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by newhoggy): More information about these intrinsics here: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=cmp&expand=765,767,802&cats=Compare&techs=MMX -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15249#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15249: Add support for cmpeq and cmpgt MMX intrinsics -------------------------------------+------------------------------------- Reporter: newhoggy | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: primops Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by newhoggy): I need this instruction to optimise my succinct data structure based CSV parser. If this instruction was available to me, I would be able to replace code that generates six instructions with code that generates one. https://github.com/haskell-works/hw-dsv/pull/12/files -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15249#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15249: Add support for cmpeq and cmpgt MMX intrinsics -------------------------------------+------------------------------------- Reporter: newhoggy | Owner: newhoggy Type: task | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: primops Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by newhoggy): * owner: (none) => newhoggy -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15249#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15249: Add support for cmpeq and cmpgt MMX intrinsics -------------------------------------+------------------------------------- Reporter: newhoggy | Owner: newhoggy Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: primops Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by newhoggy): For motivation, SIMD instructions are really good for writing very high performance parsers. For example, the following C example shows a short C program using AVX2 intrinsics to produce a Rank-Select-Bit-String from a CSV file that can be used to index into the CSV file: https://github.com/haskell-works/hw-dsv/tree/simd The program is able to index a 7G CSV file in under 4s: {{{ $ time ./simd ./simd 1.10s user 2.34s system 89% cpu 3.840 total }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15249#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15249: Add support for cmpeq and cmpgt MMX intrinsics -------------------------------------+------------------------------------- Reporter: newhoggy | Owner: newhoggy Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: primops Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by newhoggy): To implement this in pure haskell, I would need equivalent primops for the following CPU intrinsics: {{{ _mm256_set1_epi8 _mm256_cmpeq_epi8 _mm256_movemask_epi8 _mm256_cmpeq_epi8 _mm256_movemask_epi8 _mm256_maskload_epi64 _mm256_maskstore_epi64 }}} See: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=vpmaskmovq&expand=765,767,802,5241,3295,3296,3297 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15249#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC