Changeset 58 for trunk/lib/sse_simd.h


Ignore:
Timestamp:
Feb 22, 2008, 6:49:38 AM (11 years ago)
Author:
cameron
Message:

simd_splat_16/32

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/sse_simd.h

    r42 r58  
    99
    1010/*------------------------------------------------------------*/
     11#include <stdint.h>
    1112#include <limits.h>
    1213#ifndef LONG_BIT
     
    625626#endif
    626627
     628
     629// Splat the first 16-bit int into all positions.
     630static inline SIMD_type simd_splat_16(SIMD_type x) {
     631  SIMD_type t = _mm_shufflelo_epi16(x,0);
     632  return _mm_shuffle_epi32(t,0);
     633}
     634
     635// Splat the first 32-bit int into all positions.
     636static inline SIMD_type simd_splat_32(SIMD_type x) {
     637  return _mm_shuffle_epi32(x,0);
     638}
     639
     640
     641
     642
    627643void print_bit_block(char * var_name, SIMD_type v) {
    628644  union {SIMD_type vec; unsigned char elems[8];} x;
Note: See TracChangeset for help on using the changeset viewer.