Closed
Description
I think for convenience we also want to implement not just the core intrinsics but also convenience macros. For example, there are a number of convenience macros around the _mm_getcsr
intrinsic. For the following macro:
#define _MM_GET_EXCEPTION_MASK() (_mm_getcsr() & _MM_MASK_MASK)
In Rust, we would define the same thing as a function:
#[inline(always)]
#[target_feature = "+sse"]
pub unsafe fn _MM_GET_EXCEPTION_MASK() -> u32 {
_mm_getcsr() & _MM_MASK_MASK;
}
But in Rust we normally wouldn't use all-uppercase for a function name. So, the question here is: Should we
- use C naming convention for familiarity/compatibility with the C API, or
- use Rust naming convention for Rust-internal consistency?
Personally, I'm leaning towards the second option (i.e., lower-case), because most search tools are case-insensitive, so anyone who knows the name will be able to find it.
Activity
alexcrichton commentedon Oct 4, 2017
I might lean a bit towards the C naming convention, as basically everything in this crate is intended to follow the same conventions as C as opposed to following Rust conventions. If we were following Rust conventions we'd probably be using the module system and avoiding weird names :)
Use uppercase naming for C-macro equivalents
Implement _mm_getcsr, _mm_setcsr, _mm_sfence (#88)
alexcrichton commentedon Oct 5, 2017
In #88 ended up landing the upper case names, so closing!