00001
00002
00003
00004
00005 #ifndef __SSEPLUS_NUMBER_REF_H__
00006 #define __SSEPLUS_NUMBER_REF_H__
00007
00008 #include <math.h>
00009
00015 SSP_FORCEINLINE int ssp_number_isValidNumber_F32_REF( ssp_s32* val )
00016 {
00017
00018
00019 if( (*val & 0x7F800000) == 0x7F800000 )
00020 {
00021 return 0;
00022 }
00023 return 1;
00024 }
00025 SSP_FORCEINLINE int ssp_number_isValidNumber_F64_REF( ssp_s64* val )
00026 {
00027
00028
00029 if( (*val & 0x7FF0000000000000ll) == 0x7FF0000000000000ll )
00030 {
00031 return 0;
00032 }
00033 return 1;
00034 }
00035
00036 SSP_FORCEINLINE ssp_f32 ssp_number_changeSNanToQNaN_F32_REF( ssp_s32* val )
00037 {
00038 ssp_f32* retVal = (ssp_f32*)val;
00039
00040 if( (*val & 0x00400000) != 0x00400000 )
00041 {
00042
00043 if( (*val | 0x7F800000) != 0x7F800000 )
00044 {
00045
00046 *retVal = (ssp_f32)( *val | 0x00400000 );
00047 }
00048 }
00049 return *retVal;
00050 }
00051
00052 SSP_FORCEINLINE ssp_f64 ssp_number_changeSNanToQNaN_F64_REF( ssp_s64* val )
00053 {
00054 ssp_f64* retVal = (ssp_f64*)val;
00055
00056 if( (*val & 0x0008000000000000ll) != 0x0008000000000000ll )
00057 {
00058
00059 if( (*val | 0x7FF0000000000000ll) != 0x7FF0000000000000ll )
00060 {
00061
00062 *retVal = (ssp_f64)( *val | 0x0008000000000000ll );
00063 }
00064 }
00065 return *retVal;
00066 }
00067
00072 #endif // __SSEPLUS_NUMBER_REF_H__