[PATCH] D42205: [X86] Add intrinsic support for the RDPID instruction

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 15:25:22 PST 2018


craig.topper created this revision.
craig.topper added reviewers: AndreiGrischenko, RKSimon, spatel.

This adds a new instrinsic to support the rdpid instruction. The implementation is a bit weird because the intrinsic is defined as always returning 32-bits, but the assembler support thinks the instruction produces a 64-bit register in 64-bit mode. But really it zeros the upper 32 bits. So I had to add separate patterns where 64-bit mode uses an extract_subreg.

Clang patch will follow.


https://reviews.llvm.org/D42205

Files:
  include/llvm/IR/IntrinsicsX86.td
  lib/Support/Host.cpp
  lib/Target/X86/X86.td
  lib/Target/X86/X86InstrInfo.td
  lib/Target/X86/X86InstrSystem.td
  lib/Target/X86/X86Subtarget.cpp
  lib/Target/X86/X86Subtarget.h
  test/CodeGen/X86/rdpid.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42205.130290.patch
Type: text/x-patch
Size: 6127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180117/4560e01d/attachment.bin>


More information about the llvm-commits mailing list