Skip to content

Commit 8217464

Browse files
committed
minor: create 64 bit variants for get_xd_noise
1 parent 9e45d7f commit 8217464

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

src/intrinsics/avx2.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ pub unsafe fn turbulence_1d_f64(
213213
pub unsafe fn get_1d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
214214
crate::noise_helpers_32::get_1d_noise::<Avx2>(noise_type)
215215
}
216+
pub unsafe fn get_1d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
217+
crate::noise_helpers_64::get_1d_noise_f64::<Avx2>(noise_type)
218+
}
216219

217220
/// Gets a width sized block of scaled 2d noise
218221
/// `start_x` can be used to provide an offset in the
@@ -326,6 +329,9 @@ pub unsafe fn turbulence_2d_f64(
326329
pub unsafe fn get_2d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
327330
crate::noise_helpers_32::get_2d_noise::<Avx2>(noise_type)
328331
}
332+
pub unsafe fn get_2d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
333+
crate::noise_helpers_64::get_2d_noise_f64::<Avx2>(noise_type)
334+
}
329335

330336
/// Gets a width X height sized block of scaled 2d noise
331337
/// `start_x` and `start_y` can be used to provide an offset in the
@@ -500,6 +506,9 @@ pub unsafe fn turbulence_3d_f64(
500506
pub unsafe fn get_3d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
501507
crate::noise_helpers_32::get_3d_noise::<Avx2>(noise_type)
502508
}
509+
pub unsafe fn get_3d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
510+
crate::noise_helpers_64::get_3d_noise_f64::<Avx2>(noise_type)
511+
}
503512

504513
/// Gets a width X height X depth sized block of scaled 3d noise
505514
/// `start_x`, `start_y` and `start_z` can be used to provide an offset in the
@@ -684,6 +693,9 @@ pub unsafe fn turbulence_4d_f64(
684693
pub unsafe fn get_4d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
685694
crate::noise_helpers_32::get_4d_noise::<Avx2>(noise_type)
686695
}
696+
pub unsafe fn get_4d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
697+
crate::noise_helpers_64::get_4d_noise_f64::<Avx2>(noise_type)
698+
}
687699

688700
/// Gets a width X height X depth X time sized block of scaled 4d noise
689701
/// `start_*` can be used to provide an offset in the

src/intrinsics/scalar.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ pub unsafe fn turbulence_1d_f64(x: f64, lacunarity: f64, gain: f64, octaves: u8,
167167
pub unsafe fn get_1d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
168168
crate::noise_helpers_32::get_1d_noise::<Scalar>(noise_type)
169169
}
170+
pub unsafe fn get_1d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
171+
crate::noise_helpers_64::get_1d_noise_f64::<Scalar>(noise_type)
172+
}
170173

171174
/// Gets a width sized block of scaled 2d noise
172175
/// `start_x` can be used to provide an offset in the
@@ -263,6 +266,9 @@ pub unsafe fn turbulence_2d_f64(
263266
pub unsafe fn get_2d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
264267
crate::noise_helpers_32::get_2d_noise::<Scalar>(noise_type)
265268
}
269+
pub unsafe fn get_2d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
270+
crate::noise_helpers_64::get_2d_noise_f64::<Scalar>(noise_type)
271+
}
266272

267273
/// Gets a width X height sized block of scaled 2d noise
268274
/// `start_x` and `start_y` can be used to provide an offset in the
@@ -415,6 +421,9 @@ pub unsafe fn turbulence_3d_f64(
415421
pub unsafe fn get_3d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
416422
crate::noise_helpers_32::get_3d_noise::<Scalar>(noise_type)
417423
}
424+
pub unsafe fn get_3d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
425+
crate::noise_helpers_64::get_3d_noise_f64::<Scalar>(noise_type)
426+
}
418427

419428
/// Gets a width X height X depth sized block of scaled 3d noise
420429
/// `start_x`, `start_y` and `start_z` can be used to provide an offset in the
@@ -600,6 +609,9 @@ pub unsafe fn turbulence_4d_f64(
600609
pub unsafe fn get_4d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
601610
crate::noise_helpers_32::get_4d_noise::<Scalar>(noise_type)
602611
}
612+
pub unsafe fn get_4d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
613+
crate::noise_helpers_64::get_4d_noise_f64::<Scalar>(noise_type)
614+
}
603615

604616
/// Gets a width X height X depth X time sized block of scaled 4d noise
605617
/// `start_*` can be used to provide an offset in the

src/intrinsics/sse2.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ pub unsafe fn turbulence_1d_f64(
210210
pub unsafe fn get_1d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
211211
crate::noise_helpers_32::get_1d_noise::<Sse2>(noise_type)
212212
}
213+
pub unsafe fn get_1d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
214+
crate::noise_helpers_64::get_1d_noise_f64::<Sse2>(noise_type)
215+
}
213216

214217
/// Gets a width sized block of scaled 2d noise
215218
/// `start_x` can be used to provide an offset in the
@@ -324,6 +327,9 @@ pub unsafe fn turbulence_2d_f64(
324327
pub unsafe fn get_2d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
325328
crate::noise_helpers_32::get_2d_noise::<Sse2>(noise_type)
326329
}
330+
pub unsafe fn get_2d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
331+
crate::noise_helpers_64::get_2d_noise_f64::<Sse2>(noise_type)
332+
}
327333

328334
/// Gets a width X height sized block of scaled 2d noise
329335
/// `start_x` and `start_y` can be used to provide an offset in the
@@ -498,6 +504,9 @@ pub unsafe fn turbulence_3d_f64(
498504
pub unsafe fn get_3d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
499505
crate::noise_helpers_32::get_3d_noise::<Sse2>(noise_type)
500506
}
507+
pub unsafe fn get_3d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
508+
crate::noise_helpers_64::get_3d_noise_f64::<Sse2>(noise_type)
509+
}
501510

502511
/// Gets a width X height X depth sized block of scaled 3d noise
503512
/// `start_x`, `start_y` and `start_z` can be used to provide an offset in the
@@ -682,6 +691,9 @@ pub unsafe fn turbulence_4d_f64(
682691
pub unsafe fn get_4d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
683692
crate::noise_helpers_32::get_4d_noise::<Sse2>(noise_type)
684693
}
694+
pub unsafe fn get_4d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
695+
crate::noise_helpers_64::get_4d_noise_f64::<Sse2>(noise_type)
696+
}
685697

686698
/// Gets a width X height X depth X time sized block of scaled 4d noise
687699
/// `start_*` can be used to provide an offset in the

src/intrinsics/sse41.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ pub unsafe fn turbulence_1d_f64(
212212
pub unsafe fn get_1d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
213213
crate::noise_helpers_32::get_1d_noise::<Sse41>(noise_type)
214214
}
215+
pub unsafe fn get_1d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
216+
crate::noise_helpers_64::get_1d_noise_f64::<Sse41>(noise_type)
217+
}
215218

216219
/// Gets a width sized block of scaled 2d noise
217220
/// `start_x` can be used to provide an offset in the
@@ -340,6 +343,9 @@ pub unsafe fn turbulence_2d_f64(
340343
pub unsafe fn get_2d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
341344
crate::noise_helpers_32::get_2d_noise::<Sse41>(noise_type)
342345
}
346+
pub unsafe fn get_2d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
347+
crate::noise_helpers_64::get_2d_noise_f64::<Sse41>(noise_type)
348+
}
343349

344350
/// Gets a width X height sized block of scaled 2d noise
345351
/// `start_x` and `start_y` can be used to provide an offset in the
@@ -514,6 +520,9 @@ pub unsafe fn turbulence_3d_f64(
514520
pub unsafe fn get_3d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
515521
crate::noise_helpers_32::get_3d_noise::<Sse41>(noise_type)
516522
}
523+
pub unsafe fn get_3d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
524+
crate::noise_helpers_64::get_3d_noise_f64::<Sse41>(noise_type)
525+
}
517526

518527
/// Gets a width X height X depth sized block of scaled 3d noise
519528
/// `start_x`, `start_y` and `start_z` can be used to provide an offset in the
@@ -698,6 +707,9 @@ pub unsafe fn turbulence_4d_f64(
698707
pub unsafe fn get_4d_noise(noise_type: &NoiseType) -> (Vec<f32>, f32, f32) {
699708
crate::noise_helpers_32::get_4d_noise::<Sse41>(noise_type)
700709
}
710+
pub unsafe fn get_4d_noise_64(noise_type: &NoiseType) -> (Vec<f64>, f64, f64) {
711+
crate::noise_helpers_64::get_4d_noise_f64::<Sse41>(noise_type)
712+
}
701713

702714
/// Gets a width X height X depth X time sized block of scaled 4d noise
703715
/// `start_*` can be used to provide an offset in the

0 commit comments

Comments
 (0)