Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Copy link

Copilot AI commented Dec 11, 2025

Expanded x86 user-level ISA detection to include additional AVX-512 variants, crypto/bit-manipulation features, and AMD-specific instructions for fuller CPUID-leaf coverage.

  • New probes: Added detection for avx512bitalg, avx512vpopcntdq, avx512vp2intersect, vpclmulqdq, adx, lzcnt, tbm, clzero, and rdpru, registered in the ISA map and exposed via ruapu_supports.
  • CLI sample: main.c now reports the new x86 capabilities alongside existing ones.
  • Docs: README x86 support table lists the newly detectable extensions.

Example:

ruapu_init();
if (ruapu_supports("avx512vp2intersect")) {
    // use vp2intersect safely
}
Original prompt

This section details on the original issue you should resolve

<issue_title>ruapu项目x86扩展指令集探测功能增强</issue_title>
<issue_description>ruapu项目x86扩展指令集探测功能增强

任务背景
你是一个资深x86架构工程师,需要协助完善ruapu项目(一个用于检测CPU指令集支持情况的开源库)的指令集探测功能。当前项目可能缺少对一些较新或较冷门的x86扩展指令集的检测支持。

核心任务
请基于x86 CPUID指令的分类方式,系统性地罗列所有用户态可用的x86扩展指令集,识别当前ruapu项目缺失的探测功能,并以符合项目现有代码风格的实现方式添加这些检测功能。

具体任务分解

  1. 全面罗列x86扩展指令集
    请首先按照CPUID功能叶和子叶的分类方式,整理所有用户态可用的x86扩展指令集,包括但不限于:

基础指令集扩展:x87 FPU、CMOV、CX8等
SIMD指令集家族:MMX、SSE系列、AVX系列(AVX、AVX2、AVX512各种变种)、AMX等
加密指令扩展:AES-NI、SHA、SM系列等
虚拟化相关:VMX、SVM(仅限用户态可检测部分)
其他专用指令:CLZERO、RDPRU、INVPCID等
平台特性指令:MPX、SGX、TSC相关指令等

特别注意:需要排除内核态专用指令(如特定MSR操作指令),只保留用户态可用的指令集。

  1. 识别当前ruapu项目的缺失项
    对比你已知的x86扩展指令集与ruapu项目现有代码(假设当前项目已实现常见指令集检测),列出所有缺失的指令集探测功能,特别是:

较新的AVX-512变种
AMD专用扩展
专用加密指令
其他较冷门但用户态可用的指令扩展

  1. 实现缺失的探测功能
    对每个缺失的指令集探测功能,编写相应的检测代码,并确保:

代码风格与现有代码保持一致:函数命名、代码结构、注释风格等
寄存器使用规范:优先使用前4个寄存器(xmm0-xmm3、ymm0-ymm3、zmm0-zmm3等)

  1. 更新项目文档和测试

更新README.md:在支持指令集列表中添加新实现的探测功能
更新main.c测试代码:添加对新探测功能的测试用例
确保向后兼容:不破坏现有接口和功能

代码风格要求
函数命名约定:使用ruapu_xxx_detected()或类似现有命名模式
寄存器限制:尽可能使用xmm0-3、ymm0-3、zmm0-3等前4个向量寄存器
代码简洁性:遵循项目的代码简洁风格,避免不必要的复杂逻辑
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Enhance detection functionality for x86 instruction sets Enhance x86 ISA detection coverage Dec 11, 2025
Copilot AI requested a review from nihui December 11, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ruapu项目x86扩展指令集探测功能增强

2 participants