[all-commits] [llvm/llvm-project] 8cd8bd: Implement __cpuid and __cpuidex as Clang builtins

Alan Zhao via All-commits all-commits at lists.llvm.org
Fri Mar 18 10:14:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8cd8bd4a5ca702024b9df53a9c7984bb700488a0
      https://github.com/llvm/llvm-project/commit/8cd8bd4a5ca702024b9df53a9c7984bb700488a0
  Author: Alan Zhao <ayzhao at google.com>
  Date:   2022-03-18 (Fri, 18 Mar 2022)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsX86.def
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/Headers/intrin.h
    M clang/test/CodeGen/ms-intrinsics-cpuid.c

  Log Message:
  -----------
  Implement __cpuid and __cpuidex as Clang builtins

https://reviews.llvm.org/D23944 implemented the #pragma intrinsic from
MSVC. This causes the statement #pragma intrinsic(cpuid) to fail [0]
on Clang because cpuid is currently implemented in intrin.h instead
of a Clang builtin. Reimplementing cpuid (as well as it's releated
function, cpuidex) should resolve this.

[0]: https://crbug.com/1279344

Differential revision: https://reviews.llvm.org/D121653




More information about the All-commits mailing list