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 at runtime if target CPU
2821
+ supports features specified in string argument. It returns positive integer
2822
+ if all features are supported and 0 otherwise. Names of features and format is
2823
+ target specific. For example on AArch64 features are combined using ``+ `` like
2824
+ this ``__builtin_cpu_supports("flagm+sha3+lse+rcpc2+fcma+memtag+bti+sme2") ``.
2825
+ If feature name is not supported or format is wrong, compiler will issue a
2826
+ warning and replace builtin by 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