Skip to content

Conversation

@ahomescu
Copy link
Contributor

No description provided.

@ahomescu ahomescu force-pushed the ahomescu/restore_cross_checks_part2 branch from b2e9e11 to dae5616 Compare January 29, 2026 02:03
Comment on lines +43 to +45
let ch1 = unsafe { core::arch::x86_64::_mm_hadd_epi32(cmul.into(), cmul.into()) };
let ch2 = unsafe { core::arch::x86_64::_mm_hadd_epi32(ch1, ch1) };
let cval = unsafe { core::arch::x86_64::_mm_extract_epi32(ch2, 0) };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to worry about aarch64 portability here, or is this gated to x86[_64] only at a higher level?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This specific function is gated on the djb2-ssse3 feature for SSSE3 which I assumed people wouldn't even try to enable on aarch64 (and we didn't even have that back then). I could add extra build time checks to error out on that corner case, but is it worth it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's critical, was just curious what scaffolding we had in place here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched to a target_feature check per @kkysen 's suggestion. Doesn't that make the aarch64 check redundant?

Copy link
Contributor

@fw-immunant fw-immunant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. asm! changes seem semantics-preserving--volatile and clobbering flags is the default in rust unless opted out.

@ahomescu ahomescu force-pushed the ahomescu/restore_cross_checks_part2 branch from dae5616 to 9bea7c8 Compare January 30, 2026 23:32
@ahomescu ahomescu force-pushed the ahomescu/restore_cross_checks_part2 branch from 9bea7c8 to 332ba16 Compare January 30, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants