Skip to content

caspark/rust-feature-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A quick test to check which instructions are available in the x86-64-v2 target arch, for purposes of figuring out whether the feature detection that the crc32fast crate does (and some other tests that other crates to) is happening at runtime or compile-time.

Examine assembly with cargo asm --target-cpu=x86-64-v2 'test' and look for a branch (je or jne).

Results:

  1. sse2 is available in x86-64-v1 (default target CPU)
  2. sse4.1 is available in x86-64-v2
  3. pclmulqdq is not available even in x86-64-v4, even though in practice it seems the pclmulqdq instruction is actually available on all consumer CPUs from 2013 onwards (2010 for Intel).
  4. f16c for the half crate is available in x86-64-v3

Points 1 and 2 and 4 are expected based on https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels - but point 3 I wasn't sure of.

See also:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages