Skip to content

Commit

Permalink
Correct Self, use Which
Browse files Browse the repository at this point in the history
  • Loading branch information
Ababwa committed Jan 25, 2024
1 parent c03b112 commit b5e81cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions codegen/templates/vec.rs.tera
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,8 @@ impl {{ self_t }} {
{% endif %}
{% elif is_coresimd %}
{% if dim == 3 %}
simd_swizzle!(self.0, SELF::ZERO.0, [First(0), First(1), First(2), Second(3)]).reduce_sum()
use std::simd::Which::{First, Second};
simd_swizzle!(self.0, Self::ZERO.0, [First(0), First(1), First(2), Second(3)]).reduce_sum()
{% elif dim == 4 %}
self.0.reduce_sum()
{% endif %}
Expand Down Expand Up @@ -841,7 +842,7 @@ impl {{ self_t }} {
{% endif %}
{% elif is_coresimd %}
{% if dim == 3 %}
simd_swizzle!(self.0, SELF::ONE.0, [First(0), First(1), First(2), Second(3)]).reduce_product()
simd_swizzle!(self.0, Self::ONE.0, [First(0), First(1), First(2), Second(3)]).reduce_product()
{% elif dim == 4 %}
self.0.reduce_product()
{% endif %}
Expand Down
5 changes: 3 additions & 2 deletions src/f32/coresimd/vec3a.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,10 @@ impl Vec3A {
#[inline]
#[must_use]
pub fn element_sum(self) -> f32 {
use std::simd::Which::{First, Second};
simd_swizzle!(
self.0,
SELF::ZERO.0,
Self::ZERO.0,
[First(0), First(1), First(2), Second(3)]
)
.reduce_sum()
Expand All @@ -267,7 +268,7 @@ impl Vec3A {
pub fn element_product(self) -> f32 {
simd_swizzle!(
self.0,
SELF::ONE.0,
Self::ONE.0,
[First(0), First(1), First(2), Second(3)]
)
.reduce_product()
Expand Down

0 comments on commit b5e81cc

Please sign in to comment.