
    h	                     |    S r SSKJrJr  0 r " S S5      rS r\" \5      rS r\S 5       r	\S 5       r
\S	 5       rg
)z'Aliases for microarchitecture features.   )TARGETS_JSONLazyDictionaryc                   $    \ rS rSrSrS rS rSrg)FeatureAliasTest   zA test that must be passed for a feature alias to succeed.

Args:
    rules (dict): dictionary of rules to be met. Each key must be a
        valid alias predicate
c                     Xl         / U l        UR                  5        H-  u  p#U R                  R                  [        U   " U5      5        M/     g N)rules
predicatesitemsappend_FEATURE_ALIAS_PREDICATE)selfr
   nameargss       2lib/python3.13/site-packages/archspec/cpu/alias.py__init__FeatureAliasTest.__init__   s=    
++-JDOO""#;D#A$#GH (    c                 B   ^ [        U4S jU R                   5       5      $ )Nc              3   2   >#    U  H  o" T5      v   M     g 7fr	    ).0feature_testmicroarchitectures     r   	<genexpr>,FeatureAliasTest.__call__.<locals>.<genexpr>   s     W|< 122s   )allr   )r   r   s    `r   __call__FeatureAliasTest.__call__   s    WtWWWr   )r   r
   N)__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__r   r   r   r   r      s    IXr   r   c                  h    [         S   n 0 nU R                  5        H  u  p#[        U5      X'   M     U$ )z6Returns the dictionary of all defined feature aliases.feature_aliases)r   r   r   )	json_dataaliasesaliasr
   s       r   _feature_aliasesr,      s6    ./IG!))%0 *Nr   c                 f    U R                   nU[        ;   a  SU S3n[        U5      eU [        U'   U $ )zPDecorator to register a predicate that can be used to evaluate
feature aliases.
zthe alias predicate "z" already exists)r!   r   KeyError)funcr   msgs      r   alias_predicater1   *   sA     ==D ''%dV+;<sm%)T"Kr   c                     S $ )zThis predicate returns always True and it's there to allow writing
a documentation string in the JSON file to explain why an alias is needed.
c                     g)NTr   )xs    r   <lambda>reason.<locals>.<lambda>?   s    Tr   r   )_s    r   reasonr8   :   s
    
 r   c                    ^  U 4S jnU$ )z~Returns a predicate that is True if any of the feature in the
list is in the microarchitecture being tested, False otherwise.
c                 0   >^  [        U 4S jT 5       5      $ )Nc              3   ,   >#    U  H	  oT;   v   M     g 7fr	   r   )r   r4   r   s     r   r   (any_of.<locals>._impl.<locals>.<genexpr>I   s     D3Ca))3Cs   )any)r   list_of_featuress   `r   _implany_of.<locals>._implH   s    D3CDDDr   r   )r>   r?   s   ` r   any_ofrA   B   s    E Lr   c                    ^  U 4S jnU$ )zReturns a predicate that is True if the architecture family of
the microarchitecture being tested is in the list, False otherwise.
c                 4   > [        U R                  5      T;   $ r	   )strfamily)r   list_of_familiess    r   r?   families.<locals>._implT   s    $++,0@@@r   r   )rF   r?   s   ` r   familiesrH   N   s    A Lr   N)r%   schemar   r   r   r   r,   FEATURE_ALIASESr1   r8   rA   rH   r   r   r   <module>rK      sr   
 . 0 X X& !!12       r   