[all-commits] [llvm/llvm-project] 2df77a: [clang][X86] Add __cpuidex function to cpuid.h

Aiden Grossman via All-commits all-commits at lists.llvm.org
Tue May 23 23:28:33 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2df77ac20a1ed996706b164b0c4ed5ad140f635f
      https://github.com/llvm/llvm-project/commit/2df77ac20a1ed996706b164b0c4ed5ad140f635f
  Author: Aiden Grossman <agrossman154 at yahoo.com>
  Date:   2023-05-24 (Wed, 24 May 2023)

  Changed paths:
    M clang/lib/Headers/cpuid.h
    A clang/test/Headers/__cpuidex_conflict.c
    M clang/test/Headers/cpuid.c

  Log Message:
  -----------
  [clang][X86] Add __cpuidex function to cpuid.h

MSVC has a `__cpuidex` function implemented to call the underlying cpuid
instruction which accepts a leaf, subleaf, and data array that the output
data is written into. This patch adds this functionality into clang
under the cpuid.h header. This also makes clang match GCC's behavior.
GCC has had `__cpuidex` in its cpuid.h since 2020.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D150646




More information about the All-commits mailing list