Skip to content

Implement Intel HLE and RTM intrinsics #718

Description

@gnzlbg

@mtak- mentioned _xbegin recently, we should probably expose them all via core::arch.

The Intel RTM (Restricted Transactional Memory) intrinsics (Intel Intrinsic Guide, clang header, CPUID: RTM, EAX=7, ECX=0: Extended Features, EBX=11):

  • void _xabort (const unsigned int imm8) (assert_instr(xabort), `llvm.x86.xabort)
  • unsigned int _xbegin (void) (assert_instr(xbegin), llvm.x86.xbegin, note: can return multiple times)
  • void _xend (void) (assert_instr(xend), llvm.x86.xend)
  • unsigned char _xtest (void) (assert_instr(xtest), llvm.x86.xtest)

We'd need to whitelist the rtm feature in rust-lang/rust as part of this.

I've asked on the LLVM bugzilla whether xbegin needs to be marked returns_twice: https://bugs.llvm.org/show_bug.cgi?id=41493, Craig Topper suggested on IRC to submit an LLVM patch to mark this intrinsic / clang intrinsic as returns_twice (cc @ctopper - hope I get the github id right), but @TNorthover mentioned that this might not be necessary or enough. We don't have to figure this out for the initial implementation, as @mtack- mentions, clang does not do this, but we should not forget about this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions