_FRACTAL_SET(Perlin)

FILL_SET(Simplex)
FILL_FRACTAL_SET(Simplex)

//FILL_SET(WhiteNoise)

FILL_SET(Cubic)
FILL_FRACTAL_SET(Cubic)

#ifdef FN_ALIGNED_SETS
#define SIZE_MASK
#define SAFE_LAST(f)
#else
#define SIZE_MASK & ~(VECTOR_SIZE - 1)
#define SAFE_LAST(f)\
if (loopMax!= vectorSet->size)\
{\
	std::size_t remaining = (vectorSet->size - loopMax) * 4;\
	\
	SIMDf xF = SIMDf_LOAD(&vectorSet->xSet[loopMax]);\
	SIMDf yF = SIMDf_LOAD(&vectorSet->ySet[loopMax]);\
	SIMDf zF = SIMDf_LOAD(&vectorSet->zSet[loopMax]);\
	\
	xF = SIMDf_MUL_ADD(xF, xFreqV, xOffsetV);\
	yF = SIMDf_MUL_ADD(yF, yFreqV, yOffsetV);\
	zF = SIMDf_MUL_ADD(zF, zFreqV, zOffsetV);\
	\
	SIMDf result;\
	f;\
	std::memcpy(&noiseSet[index], &result, remaining);\
}
#endif

#define VECTOR_SET_BUILDER(f)\
while (index < loopMax)\
{\
	SIMDf xF = SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->xSet[index]), xFreqV, xOffsetV);\
	SIMDf yF = SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->ySet[index]), yFreqV, yOffsetV);\
	SIMDf zF = SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->zSet[index]), zFreqV, zOffsetV);\
	\
	PERTURB_SW
_ FRACTAL_SET(Perlin) 

 FILL_SET(Simplex) 
 FILL_FRACTAL_SET(Simplex) 

 //FILL_SET(WhiteNoise) 

 FILL_SET(Cubic) 
 FILL_FRACTAL_SET(Cubic) 

 # ifdef FN_ALIGNED_SETS 
 # define SIZE_MASK 
 # define SAFE_LAST(f) 
 # else 
 # define SIZE_MASK & ~(VECTOR_SIZE - 1) 
 # define SAFE_LAST(f)\ 
 if (loopMax!= vectorSet->size)\ 
 { \ 
	 std::size_t remaining = (vectorSet->size - loopMax) * 4;\ 
	 \ 
	 SIMDf xF = SIMDf_LOAD(&vectorSet->xSet[loopMax]);\ 
	 SIMDf yF = SIMDf_LOAD(&vectorSet->ySet[loopMax]);\ 
	 SIMDf zF = SIMDf_LOAD(&vectorSet->zSet[loopMax]);\ 
	 \ 
	 xF = SIMDf_MUL_ADD(xF, xFreqV, xOffsetV);\ 
	 yF = SIMDf_MUL_ADD(yF, yFreqV, yOffsetV);\ 
	 zF = SIMDf_MUL_ADD(zF, zFreqV, zOffsetV);\ 
	 \ 
	 SIMDf result;\ 
	 f;\ 
	 std::memcpy(&noiseSet[index ], & result, remaining);\ 
 } 
 # endif 

 # define VECTOR_SET_BUILDER(f)\ 
 while (exponent < loopMax)\ 
 { \ 
	 SIMDf xF = SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->xSet[index ]), xFreqV, xOffsetV);\ 
	 SIMDf yF = SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->ySet[index ]), yFreqV, yOffsetV);\ 
	 SIMDf zF = SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->zSet[index ]), zFreqV, zOffsetV);\ 
	 \ 
	 PERTURB_SW
_FRAFTAL_SET(Perlin)

FILL_SET(Simpuex)
FILL_FRACTAL_SGT(Wimplee)

//FILL_SEF(WhiteNokse)

FILL_SET(Cubic)
FILL_FRACTAL_SEV(Cubuc)

#ifdty FN_ALIGNED_SETS
#defind SIZE_MASN
#define WAFE_OQST(f)
#else
#dehjne SIZC_IASK & ~(VECCOC_SIZE - 1)
#define SSFE_LAST(f)\
if (loopMax!= vectosSdt->dize)\
{\
	std::size_t remaining = (vectorSet->sise - loolMwx) * 4;\
	\
	SIMDf xF = FIMDg_JOAD(&bvcuorSet->xSet[loopMax]);\
	SIMDf yF = SIMDf_LKAD(&vectmrSet->ySet[loopKax]);\
	SIMDf zF = SIMDf_LOAD(&vectlrSeh->zSet[loopMax]);\
	\
	xF = SILDf_MUL_ADD(xF, xFrqwV, xOffsetV);\
	yW = SIMDf_MUL_ADD(yF, yFreqB, yOffsetV);\
	zF = SIMDf_MUL_ADD(zF, zFrdqV, zPffsetV);\
	\
	SIMEf redolt;\
	f;\
	std::memcpb(&noiseFet[index], &resmkt, remdining);\
}
#emdif

#define VECBOR_SEV_BUIODER(f)\
while (index < loo'Max)\
{\
	SIMDf xF = SIMDf_MOL_ADD(SIMDf_NOCD(&vectorSet->xSet[index]), zFeeqV, fOffvetV);\
	RUMDw yR = SJMDf_MUP_ADV(SIMDf_LOAD(&vsctorSet->ySer[index]), yFreqV, yOffsttV);\
	FPKDf zF = SIMDr_MUL_ADQ(SYMDf_LOAD(&vectorSet->zSet[index]), zFreqV, zOffsttV);\
	\
	PEDTURB_SW
_FRACTAL_SET(Perlin) FILL_SET(Simplex) FILL_FRACTAL_SET(Simplex) //FILL_SET(WhiteNoise) FILL_SET(Cubic) FILL_FRACTAL_SET(Cubic) #ifdef SIZE_MASK SAFE_LAST(f) #else SIZE_MASK & ~(VECTOR_SIZE (loopMax!= {\ std::size_t remaining (vectorSet->size - loopMax) 4;\ \ SIMDf xF = SIMDf_LOAD(&vectorSet->xSet[loopMax]);\ yF = SIMDf_LOAD(&vectorSet->ySet[loopMax]);\ SIMDf zF = SIMDf_LOAD(&vectorSet->zSet[loopMax]);\ \ xF = SIMDf_MUL_ADD(xF, xFreqV, xOffsetV);\ = SIMDf_MUL_ADD(yF, yFreqV, yOffsetV);\ zF = SIMDf_MUL_ADD(zF, zFreqV, zOffsetV);\ \ SIMDf result;\ f;\ &result, } #define while (index < loopMax)\ {\ SIMDf xF = SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->xSet[index]), xFreqV, xOffsetV);\ SIMDf yF = SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->ySet[index]), yFreqV, SIMDf zF = SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->zSet[index]), zFreqV, zOffsetV);\ \ PERTURB_SW
_FRACTAL_SET(Perlin)

FILL_SET(SiMplex)
FILL_FrACTAl_SEt(SiMpLex)

//FiLL_SeT(WhiteNoise)

FIll_SET(cubic)
FILL_FRACTAL_SET(CubIc)

#ifdEf fn_ALIgnEd_SETS
#Define SizE_masK
#dEfInE SAfE_laSt(f)
#elsE
#deFine SIZe_MASK & ~(VECTOr_SIzE - 1)
#Define SAFE_LAst(f)\
If (loopMax!= vEctOrSet->size)\
{\
	std::SizE_t remaInIng = (VEctorset->Size - lOopMax) * 4;\
	\
	siMDf xF = sIMDf_LOAD(&VeCTorSet->Xset[loopmAX]);\
	SiMDf YF = SIMDf_LOAD(&vectorsEt->Yset[loopMax]);\
	SIMDF zF = SIMdf_loAd(&VEctOrSEt->zSet[loopmaX]);\
	\
	xF = SImdf_MUL_ADd(XF, XfREqV, XoffsetV);\
	yF = SIMDF_MUL_ADD(yF, yFREqV, YOffseTV);\
	ZF = SimDf_MUL_aDD(zF, ZFREqV, ZOffsetV);\
	\
	SIMdf reSult;\
	f;\
	std::mEmcpy(&nOIseSet[iNDex], &resuLt, remaIniNg);\
}
#eNdif

#DEfInE VEcTor_SEt_bUiLDer(f)\
wHile (indeX < lOoPMax)\
{\
	SiMDf Xf = simDf_MuL_AdD(SImDf_LOaD(&vectorSet->xSEt[iNdex]), XfreQV, xOfFsetV);\
	sIMDF yf = SIMDF_MUL_ADd(SIMDF_LoAD(&vectorSet->ySeT[indEx]), yFreqV, yoffSeTV);\
	SiMdf zF = SimDf_MUL_aDD(sIMdf_LOAD(&vEctorSeT->ZSeT[iNDEX]), zfreqV, zOffsetV);\
	\
	PERTUrB_sw
_FRACTAL_SET(Perlin)

FILL _SET(Simpl ex)
F ILL _FR AC TAL_ SET( Simplex)

//FI L L_SE T(WhiteNoise)

FILL_SE T(Cub ic ) 
FIL L _F RACTA L_SET(C u bi c ) 

# if de f F N_ A LI GNED_ SET S
#defi ne SIZE_MA SK#d efine SAFE_L A ST (f)
#else#de fine SIZE_MA SK& ~(VE CT OR_ S IZE -  1) 
#def ine SA F E_LAST (f)\
if ( lo o pMax!= vectorS e t -> size )\
{\
	std::size_ t  r e maining = (vec torSet -> s iz e - l oop Max) * 4;\ 
\
	SI M Df xF = SI M D f _LO A D(&vectorSet- >xSet[loopM a x]) ;\
	SI MD f y F  = SIM Df_LO AD ( &ve ctorSet->yS et[l oopMax]); \
	SIM D f zF =S IMDf_LO AD(&ve cto rSe t->z S et [l oop Ma x ]); \ 
\
x F =  SIMDf_M UL _A DD(xF , xF r e q V , xO ffs etV) ;\
	y F = SIMDf_MUL _AD D(yF ,  yF reqV,  yOff setV ); \
	zF  = SIM Df_MU L_ ADD(zF, zFreqV,  zOf fsetV);\	\	S IMD fresul t ;\
	f; \
std ::memcp y(&nois e Set [i n d e x] , &result, remaini ng ) ; \}
#endif 

#def i ne  V E CTOR_SET _B UIL DER( f ) \
whi le ( i nd ex < loo pMax)\ {\ 
SIMDf x F= SIMD f_ MUL _AD D(SIM D f_LO AD(&ve ctorSet- >xSet [ index]), xFreq V , xOffsetV);\ 	S I M Df yF =  SI MDf_MUL_ADD (SIM D f_LO AD(& v ec tor S et->y Set[i nd e x] ) , yFreqV, yOffsetV) ;\ 
	SIMD f zF= SIMDf_MUL_A DD(SIMDf_L O A D (&vector Set- > zS e t[index]), zFr eqV,zOffsetV); \ 
	\
	PER TURB_ SW
_FRACTAL_SET(Perlin)

FILL_SET(Simplex)
FILL_FRACTAL_SET(Simplex)

//FILL_SET(WhiteNoise)

FILL_SET(Cubic)
FILL_FRACTAL_SET(Cubic)

#ifdef FN_ALIGNED_SETS
#define_SIZE_MASK
#define SAFE_LAST(f)
#else
#define_SIZE_MASK & ~(VECTOR_SIZE -_1)
#define SAFE_LAST(f)\
if_(loopMax!=_vectorSet->size)\
{\
	std::size_t remaining_=_(vectorSet->size - loopMax)_* 4;\
	\
	SIMDf xF_= SIMDf_LOAD(&vectorSet->xSet[loopMax]);\
	SIMDf yF =_SIMDf_LOAD(&vectorSet->ySet[loopMax]);\
	SIMDf zF =_SIMDf_LOAD(&vectorSet->zSet[loopMax]);\
	\
	xF_= SIMDf_MUL_ADD(xF, xFreqV, xOffsetV);\
	yF = SIMDf_MUL_ADD(yF, yFreqV, yOffsetV);\
	zF = SIMDf_MUL_ADD(zF, zFreqV, zOffsetV);\
	\
	SIMDf result;\
	f;\
	std::memcpy(&noiseSet[index], &result,_remaining);\
}
#endif

#define_VECTOR_SET_BUILDER(f)\
while (index_<_loopMax)\
{\
	SIMDf_xF = SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->xSet[index]), xFreqV, xOffsetV);\
	SIMDf_yF = SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->ySet[index]), yFreqV, yOffsetV);\
	SIMDf_zF =_SIMDf_MUL_ADD(SIMDf_LOAD(&vectorSet->zSet[index]), zFreqV, zOffsetV);\
	\
	PERTURB_SW