Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Commit

Permalink
Update casts in NEON floor code.
Browse files Browse the repository at this point in the history
  • Loading branch information
QuLogic committed Jan 16, 2018
1 parent 575c004 commit 4ad0855
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions FastNoiseSIMD/FastNoiseSIMD_internal.cpp
Expand Up @@ -190,7 +190,9 @@ static SIMDf VECTORCALL FUNC(FLOOR)(SIMDf a)
{
SIMDf fval = SIMDf_CONVERT_TO_FLOAT(SIMDi_CONVERT_TO_INT(a));

return vsubq_f32(fval, SIMDf_AND(SIMDf_LESS_THAN(a, fval), SIMDf_NUM(1)));
return vsubq_f32(fval,
SIMDf_CAST_TO_FLOAT(vandq_s32(SIMDf_LESS_THAN(a, fval),
SIMDi_CAST_TO_INT(SIMDf_NUM(1)))));
}
#define SIMDf_FLOOR(a) FUNC(FLOOR)(a)
#else
Expand All @@ -199,7 +201,7 @@ static SIMDf VECTORCALL FUNC(FLOOR)(SIMDf a)
#endif

#define SIMDf_ABS(a) vabsq_f32(a)
#define SIMDf_BLENDV(a,b,mask) vbslq_f32( vreinterpretq_u32_s32(mask),b,a)
#define SIMDf_BLENDV(a,b,mask) vbslq_f32(vreinterpretq_u32_s32(mask),b,a)

#define SIMDi_ADD(a,b) vaddq_s32(a,b)
#define SIMDi_SUB(a,b) vsubq_s32(a,b)
Expand Down

0 comments on commit 4ad0855

Please sign in to comment.