[Lldb-commits] [PATCH] D30918: [debugserver] This is a small cleanup patch to AVX support detection
Chris Bieneman via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 13 15:50:21 PDT 2017
beanz created this revision.
Herald added a subscriber: mgorny.
The first Sandybridge iMacs with AVX support shipped in Spring 2011 with Snow Leopard as their OS. Unfortunately due to a kernel bug debugging AVX code was not really possible until 10.7.4.
The old code here checked the kernel build number to determine when to support AVX, but that code was incorrect. It verified that the kernel build number was greater than xnu-2020, which is the build of the kernel that had the fix for 10.8. The fix was also back ported to 10.7.4. Which means all publicly available OS builds 10.7.4 and later have working AVX support.
This new patch verifies that the host OS is greater than or equal to 10.7.4 by checking that the build number is greater than or equal to 11Exx.
The patch also removes the HasAVX assembly blob in favor of querying the kernel via sysctl for the hardware features.
Using sysctl is slower, however since the code is executed once and the result cached it is a better approach because it is possible for the kernel to disable AVX support on hardware that supports it, so listening to the kernel is a better approach for the debugger to take.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 14133 bytes
Desc: not available
More information about the lldb-commits