Changes between Version 6 and Version 7 of ParabixTransform


Ignore:
Timestamp:
Apr 22, 2014, 4:44:26 PM (3 years ago)
Author:
cameron
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ParabixTransform

    v6 v7  
    8989Unfortunately, the {{{hsimd<{2,4,8}>::pack{h,l}(e1, e2)}}} family of operations for
    9090ideal transposition are not to be found within the SIMD instruction set of current
    91 commodity processors.  However, if *bit shuffle* operations are to be found instead,
     91commodity processors.  However, if ''bit shuffle'' operations are to be found instead,
    9292then the pack operations can be expressed directly in terms of equivalent
    9393bit shuffles.   Bit shuffles can be found both at the intermediate representation
     
    142142}}}
    143143
     144Alternatively, we may implement {{{hsimd<{4,8}>::pack{h,l}(e1, e2)}}} using
     145{{{shufflevector}}} with {{{i2}}} and {{{i4}}} vectors.
    144146
     147{{{
     148define <4 x i2> @hsimd_packh_4(<4 x i2> %x, <4 x i2> %y) {
     149   %result = shufflevector <4 x i2> %x, <4 x i2> %y,
     150                <4 x i32> <i32 1, i32 3, i32 5, i32 7>
     151   return <4 x i2> result
     152}
     153define <4 x i2> @hsimd_packl_4(<4 x i2> %x, <4 x i2> %y) {
     154   %result = shufflevector <4 x i2> %x, <4 x i2> %y,
     155                <4 x i32> <i32 0, i32 2, i32 4, i32 6>
     156   return <4 x i2> result
     157}
     158
     159define <2 x i4> @hsimd_packh_8(<2 x i4> %x, <2 x i4> %y) {
     160   %result = shufflevector <2 x i4> %x, <2 x i4> %y,
     161                <2 x i32> <i32 1, i32 3>
     162   return <2 x i4> result
     163}
     164define <2 x i4> @hsimd_packl_8(<2 x i4> %x, <2 x i4> %y) {
     165   %result = shufflevector <2 x i4> %x, <2 x i4> %y,
     166                <2 x i32> <i32 0, i32 2>
     167   return <2 x i4> result
     168}
     169}}}