File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -2799,6 +2799,34 @@ counter's true frequency will need to be provided by the user.
2799
2799
2800
2800
Query for this feature with ``__has_builtin(__builtin_readsteadycounter) ``.
2801
2801
2802
+ ``__builtin_cpu_supports ``
2803
+ --------------------------
2804
+
2805
+ **Syntax **:
2806
+
2807
+ .. code-block :: c++
2808
+
2809
+ int __builtin_cpu_supports (const char *features);
2810
+
2811
+ **Example of Use: **:
2812
+
2813
+ .. code-block :: c++
2814
+
2815
+ if (__builtin_cpu_supports ("sve"))
2816
+ sve_code ();
2817
+
2818
+ **Description **:
2819
+
2820
+ The ``__builtin_cpu_supports `` function detects if the run-time CPU supports
2821
+ features specified in string argument. It returns a positive integer if all
2822
+ features are supported and 0 otherwise. Feature names are target specific. On
2823
+ AArch64 features are combined using ``+ `` like this
2824
+ ``__builtin_cpu_supports("flagm+sha3+lse+rcpc2+fcma+memtag+bti+sme2") ``.
2825
+ If a feature name is not supported, Clang will issue a warning and replace
2826
+ builtin by the constant 0.
2827
+
2828
+ Query for this feature with ``__has_builtin(__builtin_cpu_supports) ``.
2829
+
2802
2830
``__builtin_dump_struct ``
2803
2831
-------------------------
2804
2832
You can’t perform that action at this time.
0 commit comments