-
Notifications
You must be signed in to change notification settings - Fork 273
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
Imlement rdrand and rdseed intrinsics #325
Comments
I don't quite get how to link to the LLVM intrinsic |
You cannot link to this intrinsic this way, because it returns {i1,
i<width>}, which is not expressible in a stable manner (there's no
guarantee that any rust type will lower down into that particular LLVM
type).
…On Feb 19, 2018 01:10, "Artyom Pavlov" ***@***.***> wrote:
I don't quite get how to link to the LLVM intrinsic llvm.x86.rdrand.64,
IUUC correctly it has two return values i64 and i32. All options which
I've tried result in "Intrinsic has incorrect return type!". Can someone
help with it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#325 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AApc0oLMPYmMjtO3qBZQ0DeIzwVaoQ9-ks5tWK39gaJpZM4SJsfv>
.
|
I misremembered. The type is {I<width>, i32} but the general point about it
not being expressible stands.
…On Feb 19, 2018 07:49, "Simonas Kazlauskas" ***@***.***> wrote:
You cannot link to this intrinsic this way, because it returns {i1,
i<width>}, which is not expressible in a stable manner (there's no
guarantee that any rust type will lower down into that particular LLVM
type).
On Feb 19, 2018 01:10, "Artyom Pavlov" ***@***.***> wrote:
> I don't quite get how to link to the LLVM intrinsic llvm.x86.rdrand.64,
> IUUC correctly it has two return values i64 and i32. All options which
> I've tried result in "Intrinsic has incorrect return type!". Can someone
> help with it?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#325 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AApc0oLMPYmMjtO3qBZQ0DeIzwVaoQ9-ks5tWK39gaJpZM4SJsfv>
> .
>
|
@newpavlov I think it's ok to use a |
rustc has the dedicated intrinsic. It is used by the rdrand crate.
…On Feb 20, 2018 03:10, "Alex Crichton" ***@***.***> wrote:
@newpavlov <https://github.com/newpavlov> I think it's ok to use a asm!
block temporarily for this, but yeah as @nagisa
<https://github.com/nagisa> mentioned we'll need to add a dedicated
intrinsic to rustc for this otherwise to get the ABI to work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#325 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AApc0rbh2ZTcbUqS9gEcqps5Bf-WYDreks5tWht-gaJpZM4SJsfv>
.
|
@alexcrichton |
The change wouldn’t be backwards compatible, but since anything related to it is unstable in the first place, I do not see any reason to do the epoch dance. |
Rename rdrnd target feature to rdrand Plus minor cleanup. Related stdsimd [issue](rust-lang/stdarch#325).
Rename rdrnd target feature to rdrand Plus minor cleanup. Related stdsimd [issue](rust-lang/stdarch#325).
@alexcrichton |
Yep :/
You can build those in a wrapper outside stdsimd. |
@newpavlov FWIW I have such a wrapper here: https://github.com/gnzlbg/typed_arch |
_rdrand16_step
_rdrand32_step
_rdrand64_step
_rdseed16_step
_rdseed32_step
_rdseed64_step
It will require addition of two target features
rdrand
andrdseed
to the language.cc @nagisa
The text was updated successfully, but these errors were encountered: