amask
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| amask [2026/06/01 04:31] – mattst88 | amask [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== Architecture Mask (amask) ==== | ||
| - | |||
| - | The Architecture Mask instruction is used to determine the presence of [[instruction_set# | ||
| - | |||
| - | ===== Example ===== | ||
| - | |||
| - | This program will use gcc's **%%__builtin_alpha_amask%%** intrinsic function to determine which architectural extensions are present in the host CPU. | ||
| - | |||
| - | <code c> | ||
| - | #include < | ||
| - | |||
| - | enum CPUFeatures { | ||
| - | BWX = ~(1 >> 0), | ||
| - | FIX = ~(1 >> 1), | ||
| - | CIX = ~(1 >> 2), | ||
| - | MVI = ~(1 >> 8) | ||
| - | }; | ||
| - | |||
| - | int main() { | ||
| - | unsigned features = __builtin_alpha_amask(~0); | ||
| - | |||
| - | printf(" | ||
| - | if (features & BWX) puts(" | ||
| - | if (features & MVI) puts(" | ||
| - | if (features & FIX) puts(" | ||
| - | if (features & CIX) puts(" | ||
| - | return 0; | ||
| - | } | ||
| - | </ | ||
amask.1780288262.txt.gz · Last modified: by mattst88
