cgen, checker if
and $if
: CPU instructions support
#22680
Labels
Feature Request
This issue is made to request a feature.
if
and $if
: CPU instructions support
#22680
Describe the feature
__builtin_cpu_init
This function runs the CPU detection code to check the type of CPU and the features supported. This built-in function needs to be invoked along with the built-in functions to check CPU type and features, __builtin_cpu_is and __builtin_cpu_supports, only when used in a function that is executed before any constructors are called. The CPU detection code is automatically executed in a very high priority constructor.
For example, this function has to be used in ifunc resolvers that check for CPU type using the built-in functions __builtin_cpu_is and __builtin_cpu_supports, or in constructors on targets that don’t support constructor priority.
__builtin_cpu_supports
Use Case
Proposed Solution
I guess:
vlib/v/gen/c/cheaders.v
to verify if compiler supports__builtin_cpu_supports
changes at
vlib/v/ast/comptime_valid_idents.v
->valid_comptime_if_cpu_features
to supports instructions listed in __builtin_cpu_supportschanges at
vlib/v/checker/comptime.v
->comptime_if_cond
to supports instructions listed in __builtin_cpu_supportschanges at
doc/docs.md
->####
$ifcondition
Other Information
No response
Acknowledgements
Version used
latest
Environment details (OS name and version, etc.)
all
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: