Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <mmintrin.h>
    __m64 _m_punpcklbw(__m64 *m1, __m64 *m2);

Description:
    The _m_punpcklbw function performs an interleaved unpack of the
    low-order data elements of m1 and m2.  It ignores the high-order bytes.
    When unpacking from a memory operand, 32 bits are accessed and all are
    utilized by the instruction.  By choosing m1 or m2 to be zero, an
    unpacking of byte elements into word elements is performed.


                     m2                         m1
         -------------------------  -------------------------
         |           |b3|b2|b1|b0|  |b7|b6|b5|b4|b3|b2|b1|b0|
         -------------------------  -------------------------
                      |  |  |  |                 |  |  |  |
                      V  V  V  V                 V  V  V  V
                      b7 b5 b3 b1                b6 b4 b2 b0

                       -------------------------
                       |b7|b6|b5|b4|b3|b2|b1|b0|
                       -------------------------
                             result


Returns:
    The result of the interleaved unpacking of the high-order bytes of two
    multimedia values is returned.

Example:
    #include <stdio.h>
    #include <mmintrin.h>

    #define AS_BYTES "%2.2x %2.2x %2.2x %2.2x " \
                     "%2.2x %2.2x %2.2x %2.2x"

    __m64   a;
    __m64   b = { 0x000200013478bcf0 };
    __m64   c = { 0x0080007f12569ade };

    void main()
      {
        a = _m_punpcklbw( b, c );
        printf( "m2="AS_BYTES" "
                "m1="AS_BYTES"\n"
                "mm="AS_BYTES"\n",
            c._8[7], c._8[6], c._8[5], c._8[4],
            c._8[3], c._8[2], c._8[1], c._8[0],
            b._8[7], b._8[6], b._8[5], b._8[4],
            b._8[3], b._8[2], b._8[1], b._8[0],
            a._8[7], a._8[6], a._8[5], a._8[4],
            a._8[3], a._8[2], a._8[1], a._8[0] );
      }

    produces the following:

    m2=00 80 00 7f 12 56 9a de m1=00 02 00 01 34 78 bc f0
    mm=12 34 56 78 9a bc de f0

Classification:
    Intel

Systems:
    MACRO

See Also:
    _m_empty, _m_punpckhbw, _m_punpckhdq, _m_punpckhwd, _m_punpckldq,
    _m_punpcklwd

See Also: _m_empty _m_punpckhbw

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson