Skip to content

Commit

Permalink
More alignment test fixes for when SSE2 is not avaialable.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitshifter committed Jul 15, 2021
1 parent 1da7d64 commit c6dc702
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 1 addition & 2 deletions tests/affine2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ mod affine2 {
#[test]
fn test_align() {
use std::mem;
// TODO: With SSE2 Mat2/Affine2 is 16 byte aligned. Should this be true when no SSE2?
if cfg!(all(target_feature = "sse2", not(feature = "scalar-math"))) {
if cfg!(not(feature = "scalar-math")) {
assert_eq!(32, mem::size_of::<Affine2>());
assert_eq!(16, mem::align_of::<Affine2>());
} else {
Expand Down
13 changes: 8 additions & 5 deletions tests/vec4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,14 +830,17 @@ mod vec4 {
fn test_align() {
use std::mem;
assert_eq!(16, mem::size_of::<Vec4>());
if cfg!(any(not(target_feature = "sse2"), feature = "scalar-math")) {
assert_eq!(4, mem::align_of::<Vec4>());
assert_eq!(4, mem::size_of::<Vec4Mask>());
assert_eq!(1, mem::align_of::<Vec4Mask>());
} else {
if cfg!(not(feature = "scalar-math")) {
assert_eq!(16, mem::align_of::<Vec4>());
} else {
assert_eq!(4, mem::align_of::<Vec4>());
}
if cfg!(all(target_feature = "sse2", not(feature = "scalar-math"))) {
assert_eq!(16, mem::size_of::<Vec4Mask>());
assert_eq!(16, mem::align_of::<Vec4Mask>());
} else {
assert_eq!(4, mem::size_of::<Vec4Mask>());
assert_eq!(1, mem::align_of::<Vec4Mask>());
}
}

Expand Down

0 comments on commit c6dc702

Please sign in to comment.