gz / rust-x86

Rust library to use x86 (amd64) specific functionality and registers.
https://docs.rs/x86
MIT License
307 stars 61 forks source link

Finish converting to new asm!() syntax. #121

Closed dancrossnyc closed 2 years ago

dancrossnyc commented 2 years ago

I got a number of compile failures with llvm_asm with the latest nightly. Instead of figuring out how to fix that, I just went ahead and finished converting everything to use asm, which has the added bonus of being stable, anyway!

I'm not entirely sure this is all correct; cargo test seems to drag in an explicit dependency on x86-0.44.0, which still fails.

Note also that the SGX modifications are a bit more elaborate than what had been there; apparently LLVM uses the %rbx internally, even though the instructions exposed in that module use that register. I worked around that by pushing %rbx and then copying the leaf operand from %rsi to %rbx and copying %rbx back to %rsi for output and popping the original value of %rbx. The input/output operands are then writen in terms of %rsi.

Signed-off-by: Dan Cross cross@gajendra.net

dancrossnyc commented 2 years ago

Gerd, I definitely took advantage of force pushes to abuse the CI for testing I didn't do locally (32- vs 64-bit); now the failures seem to be related to dependencies on older versions of x86; not sure what to do about that, though.

dancrossnyc commented 2 years ago

Gentle ping @gz ?

gz commented 2 years ago

Thanks for working on this! This is great -- I just reviewed lgtm I'm going to merge and release a new version.

dancrossnyc commented 2 years ago

Thanks! Fingers crossed I didn't introduce any bugs, particularly where memory operands and %rbx are concerned.

gz commented 2 years ago

Yes, unfortunately I'm not aware of anyone using the SGX bits so it's a bit difficult to test it

gz commented 2 years ago

btw released as 0.45

dancrossnyc commented 2 years ago

Thank you!

On Tue, Jan 25, 2022 at 12:40 PM Gerd Zellweger @.***> wrote:

btw released as 0.45

— Reply to this email directly, view it on GitHub https://github.com/gz/rust-x86/pull/121#issuecomment-1021444390, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMEWAAADYCBXBA43WBV5N3UX3OANANCNFSM5MQEEGSA . You are receiving this because you authored the thread.Message ID: @.***>