]> granicus.if.org Git - clang/commit
Add new intrinsic support for MONITORX and MWAITX instructions
authorAshutosh Nema <ashu1212@gmail.com>
Wed, 18 May 2016 11:56:23 +0000 (11:56 +0000)
committerAshutosh Nema <ashu1212@gmail.com>
Wed, 18 May 2016 11:56:23 +0000 (11:56 +0000)
commita809e07c012b7e9d2d04fdc23acc8fae5aa04011
tree39e200dacf321f5acaaba9ca452a9a586bd9013b
parente14f516c9893018fbb95be27f62778a38761a9a4
Add new intrinsic support for MONITORX and MWAITX instructions

Summary:
MONITORX/MWAITX instructions provide similar capability to the MONITOR/MWAIT
pair while adding a timer function, such that another termination of the MWAITX
instruction occurs when the timer expires. The presence of the MONITORX and
MWAITX instructions is indicated by CPUID 8000_0001, ECX, bit 29.

The MONITORX and MWAITX instructions are intercepted by the same bits that
intercept MONITOR and MWAIT. MONITORX instruction establishes a range to be
monitored. MWAITX instruction causes the processor to stop instruction
execution and enter an implementation-dependent optimized state until
occurrence of a class of events.

Opcode of MONITORX instruction is "0F 01 FA". Opcode of MWAITX instruction is
"0F 01 FB". These opcode information is used in adding tests for the
disassembler.

These instructions are enabled for AMD's bdver4 architecture.

Patch by Ganesh Gopalasubramanian!

Reviewers: echristo, craig.topper

Subscribers: RKSimon, joker.eph, llvm-commits, cfe-commits

Differential Revision: http://reviews.llvm.org/D19796

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269907 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/BuiltinsX86.def
include/clang/Driver/Options.td
lib/Basic/Targets.cpp
lib/Headers/CMakeLists.txt
lib/Headers/module.modulemap
lib/Headers/mwaitxintrin.h [new file with mode: 0644]
lib/Headers/x86intrin.h
test/CodeGen/builtins-x86.c