include/arithmetic/SSEPlus_arithmetic_REF.h

Go to the documentation of this file.
00001 //
00002 // Copyright (c) 2006-2008 Advanced Micro Devices, Inc. All Rights Reserved.
00003 // This software is subject to the Apache v2.0 License.
00004 //
00005 #ifndef __SSEPLUS_ARITHMETIC_REF_H__
00006 #define __SSEPLUS_ARITHMETIC_REF_H__
00007 
00008 
00016 SSP_FORCEINLINE __m128 ssp_arithmetic_hadd4_dup_ps_REF( __m128 a )      // Sum all 4 values
00017 {
00018     ssp_m128 A;
00019     ssp_f32 t;
00020     
00021     A.f = a;
00022     t   = A.f32[0] + 
00023           A.f32[1] + 
00024           A.f32[2] + 
00025           A.f32[3];
00026 
00027     A.f32[0] = t;
00028     A.f32[1] = t;
00029     A.f32[2] = t;
00030     A.f32[3] = t;
00031     return A.f;
00032 }  
00033 
00034 SSP_FORCEINLINE __m128i ssp_arithmetic_hadd4_epu16_REF( __m128i a )      // Sum 2 sets of 4 values, dest in 0, and 4
00035 {
00036     ssp_m128 A;
00037     A.i = a;
00038 
00039     A.u16[0] = A.u16[0] + A.u16[1] + + A.u16[2] + + A.u16[3];
00040     A.u16[4] = A.u16[4] + A.u16[5] + + A.u16[6] + + A.u16[7];
00041 
00042     return A.i;
00043 }  
00044 
00046 
00047 
00048 
00049 #endif // __SSEPLUS_ARITHMETIC_REF_H__

Generated on Wed May 21 13:44:11 2008 for "SSEPlus" by  doxygen 1.5.4