- Main Page
- Data Structures
- Files

- File List

# E:/DevIL/src-IL/src/altivec_common.c

    00001 //-----------------------------------------------------------------------------
    00002 //
    00003 // ImageLib Sources
    00004 // Last modified: 17/04/2005
    00005 // by Meloni Dario
    00006 //
    00007 // Description: Common altivec function.
    00008 //
    00009 //-----------------------------------------------------------------------------
    00010
    00011 #ifdef HAVE_CONFIG_H
    00012 #include <config.h>
    00013 #endif //HAVE_CONFIG_H
    00014
    00015 #ifdef ALTIVEC_GCC
    00016 #include "altivec_common.h"
    00017
    00018 // from http://developer.apple.com/hardware/ve/alignment.html
    00019 /*vector unsigned char load_unaligned( unsigned char *buffer ) {
    00020         vector unsigned char MSQ, LSQ;
    00021         vector unsigned char mask;
    00022         MSQ = vec_ld(0, buffer); // most significant quadword
    00023         LSQ = vec_ld(15, buffer); // least significant quadword
    00024         mask = vec_lvsl(0, buffer); // create the permute mask
    00025         return vec_perm(MSQ, LSQ, mask);// align the data
    00026 }*/
    00027
    00028 vector float fill_vector_f( float value ) {
    00029         vector_t vec;
    00030         vec.sf[0] = value;
    00031         vector float temp = vec_ld(0,vec.sf);
    00032         return vec_splat(temp,0);
    00033 }
    00034
    00035 inline unsigned int round16( unsigned int v ) {
    00036         return ((int)((v/16)*10)%10) > 0 ? (v/16) : (v/16)+1;
    00037 }
    00038
    00039
    00040 #endif