-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bextri #180
Fix bextri #180
Conversation
src/x86/runtime.rs
Outdated
edx[2], | ||
edx[3], | ||
]; | ||
let vendor_id_amd: [u8; 12] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could use a byte literal for this? e.g., b"AuthenticAMD"
. Unlike string literals, the type of a byte literal is a fixed sized u8
array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, fixed :)
src/x86/macros.rs
Outdated
@@ -350,3 +350,4109 @@ macro_rules! assert_approx_eq { | |||
*a, *b, $eps, (*a - *b).abs()); | |||
}) | |||
} | |||
|
|||
|
|||
macro_rules! constify_bextri { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So... What kind of hit does this have on compile times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprisingly low. The version using 65000 match arms took more than 2 hours to compile, and this version with 4000 match arms compiles just as fast as without the macro. There might be some quadratic or exponential behavior in rustc somewhere. I need to fill a bug.
7a6ad1c
to
39c5b77
Compare
@alexcrichton something weird is going on here with the |
d07b542
to
99fd26e
Compare
Closes rust-lang#26 .
d8f5817
to
f6c3b6b
Compare
All tests are green now. @BurntSushi this PR does increase the compile time. Since we don't have any AMD builds, it is hard to say whether the increase that we are seeing is the real increase (or whether it gets larger once the intrinsic is used a couple of times in a program). We might be hitting the ceiling of what the Ideally, all those arguments that belong in immediate-mode registers would be pub unsafe fn _bextri2_u64(a: u64, control: const u64) -> u64; so that we don't need the EDIT: All Intel CPUs support @alexcrichton I've disabled the |
@gnzlbg hm disabling "test everything" seems pretty worrisome as that's the whole point of that bot? It's using Intel's own intstruction emulator which presumably supports everything, right? |
Intel's own instruction emulator does not support the TBM instruction set. This is not surprising given that Intel CPUs do not support TBM either, only AMD CPUs do. |
If the objective of that bot was to test all x86 intrinsics in a single build bot I think that we either need to use a better emulator, or a different approach. I could add an "intel_only" dev feature to the library, use it to disable |
@alexcrichton so i've done that and all looks green. We probably want to remove |
@alexcrichton another feature that is AMD only and probably won't work in the emulator is SSE4a support. |
I've moved these changes to #175 because I don't have the throughput to maintain 3 versions of the run-time detection one (the current one here, the cleaner one in that pull-request, and the one that also does run-time detection for ARM in my arm_rt branch). |
@gnzlbg oh sorry I had no idea! That's fascinating... Something that forces only intel tests to run sounds great though and we could look at AMD testing later |
It seems that AMD has an emulator but that's proprietary... maybe I can get a qemu-system-x86_64 with an AMD cpu up and running to test those. |
Closes #26 .