ó
™^c           @   s@  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l m Z d  d l m Z m	 Z	 d  d l
 m Z m Z d d d „  ƒ  YZ d e f d „  ƒ  YZ d	 d d
 „  ƒ  YZ d d d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d d d „  ƒ  YZ d d d „  ƒ  YZ d d d „  ƒ  YZ d „  Z d d  d „  ƒ  YZ d S(!   iÿÿÿÿN(   t   Instruction(   t   check_operandt   format_operand_type(   t   parse_assigned_variable_namet   parse_with_variable_namet   Labelc           B   s5   e  Z d d  „ Z d „  Z d „  Z e d „  ƒ Z RS(   c            sÁ   d d l  m ‰  | d  k rO d d  l } ˆ  d t | j ƒ  d ƒ ƒ f |  _ ne t | t ƒ r’ t	 ‡  f d †  | Dƒ ƒ s† t
 d ƒ ‚ | |  _ n" ˆ  j | ƒ ˆ  d | ƒ f |  _ d  |  _ d  S(   Niÿÿÿÿ(   t   Namet   prenameR   c         3   s   |  ] } t  | ˆ  ƒ Vq d  S(   N(   t
   isinstance(   t   .0t   part(   R   (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pys	   <genexpr>   s    s-   Name must a string or a tuple or Name objectst   name(   t   peachpy.nameR   t   Nonet   inspectR   t   stackR   R   t   tuplet   allt   AssertionErrort
   check_namet   line_number(   t   selfR   R   (    (   R   sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyt   __init__   s    '	c         C   s   d j  t t |  j ƒ ƒ S(   s+   Returns a string representation of the namet   .(   t   joint   mapt   strR   (   R   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyt   __str__   s    c         C   sT   | d d d d h k s$ t  d ƒ ‚ | d k rF t |  ƒ j d d ƒ St |  ƒ Sd  S(   Nt   peachpyt   gast   nasmt   gos=   Supported assembly formats are 'peachpy', 'gas', 'nasm', 'go'R   t   _(   R   R   t   replace(   R   t   assembly_format(    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyt   format!   s
    	c         C   s   t  d „  |  j Dƒ ƒ S(   Nc         s   s   |  ] } | j  d  k Vq d  S(   N(   R   R   (   R	   R
   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pys	   <genexpr>-   s    (   t   anyR   (   R   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyt   is_named+   s    N(   t   __name__t
   __module__R   R   R   R#   t   propertyR%   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR      s   		
t   LABELc           B   s>   e  Z d d  „ Z d „  Z e d d „ Z d „  Z d „  Z RS(   c         C   s–   t  | ƒ } t t |  ƒ j d d | ƒ| f |  _ t | t ƒ sR t d ƒ ‚ n  | j |  _	 t
 ƒ  |  _ t j j d  k	 r’ t j j j |  ƒ n  d  S(   NR)   t   origins:   Invalid operand for LABEL statement: Label object expected(   R   t   superR)   R   t   operandsR   R   t   SyntaxErrorR   t
   identifiert   sett   input_branchesR   t   streamt   active_streamR   t   add_instruction(   R   t   labelR*   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR   1   s    c         C   s   d j  t t |  j ƒ ƒ d S(   NR   t   :(   R   R   R   R.   (   R   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR   <   s    c         C   s´   | d d d d h k s$ t  d ƒ ‚ | d k rM d j t t |  j ƒ ƒ d S| d k r¦ |  j d j d  k r� d	 t |  ƒ d St |  j d j ƒ d
 t |  ƒ Sn
 t |  ƒ Sd  S(   NR   R   R   R   s=   Supported assembly formats are 'peachpy', 'gas', 'nasm', 'go'R    R5   i    R   s   : # (   R   R   R   R   R.   R,   R   R   (   R   R"   t   indentR   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR#   ?   s    	%c         C   s   |  S(   N(    (   R   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyt	   __enter__O   s    c         C   s   | d  k	 r ‚  n  d  S(   N(   R   (   R   t   exc_typet	   exc_valuet	   traceback(    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyt   __exit__R   s    N(	   R&   R'   R   R   R   t   FalseR#   R7   R;   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR)   0   s
   		t   Loopc           B   s&   e  Z d d  „ Z d „  Z d „  Z RS(   c            s&  d d l  m ‰  | d  k ry d d  l } t | j ƒ  d ƒ } | d  k ra t | j ƒ  d ƒ } n  ˆ  d | ƒ f |  _ ne t | t	 ƒ r¼ t
 ‡  f d †  | Dƒ ƒ s° t d ƒ ‚ | |  _ n" ˆ  j | ƒ ˆ  d | ƒ f |  _ t |  j ˆ  d d ƒ f ƒ |  _ t |  j ˆ  d d	 ƒ f ƒ |  _ d  S(
   Niÿÿÿÿ(   R   R=   R   c         3   s   |  ] } t  | ˆ  ƒ Vq d  S(   N(   R   (   R	   R
   (   R   (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pys	   <genexpr>a   s    s-   Name must a string or a tuple or Name objectsR   t   begint   end(   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R>   R?   (   R   R   R   R   (    (   R   sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR   X   s    	"c         C   s?   t  |  j ƒ d d l m } | d  k	 r; | j d 7_ n  |  S(   Niÿÿÿÿ(   t   active_functioni   (   R)   R>   t   peachpy.common.functionR@   R   t   _indent_level(   R   R@   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR7   j   s
    c         C   sQ   d d l  m } | d  k	 r. | j d 8_ n  | d  k rJ t |  j ƒ n ‚  d  S(   Niÿÿÿÿ(   R@   i   (   RA   R@   R   RB   R)   R?   (   R   R8   R9   t   exc_tracebackR@   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR;   r   s    N(   R&   R'   R   R   R7   R;   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR=   W   s   	t   Blockc           B   s&   e  Z d d  „ Z d „  Z d „  Z RS(   c            s&  d d l  m ‰  | d  k ry d d  l } t | j ƒ  d ƒ } | d  k ra t | j ƒ  d ƒ } n  ˆ  d | ƒ f |  _ ne t | t	 ƒ r¼ t
 ‡  f d †  | Dƒ ƒ s° t d ƒ ‚ | |  _ n" ˆ  j | ƒ ˆ  d | ƒ f |  _ t |  j ˆ  d d ƒ f ƒ |  _ t |  j ˆ  d d	 ƒ f ƒ |  _ d  S(
   Niÿÿÿÿ(   R   RD   R   c         3   s   |  ] } t  | ˆ  ƒ Vq d  S(   N(   R   (   R	   R
   (   R   (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pys	   <genexpr>‡   s    s-   Name must a string or a tuple or Name objectsR   R>   R?   (   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R>   R?   (   R   R   R   R   (    (   R   sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR   ~   s    	"c         C   s?   t  |  j ƒ d d l m } | d  k	 r; | j d 7_ n  |  S(   Niÿÿÿÿ(   R@   i   (   R)   R>   RA   R@   R   RB   (   R   R@   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR7   �   s
    c         C   sQ   d d l  m } | d  k	 r. | j d 8_ n  | d  k rJ t |  j ƒ n ‚  d  S(   Niÿÿÿÿ(   R@   i   (   RA   R@   R   RB   R)   R?   (   R   R8   R9   RC   R@   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR;   ˜   s    N(   R&   R'   R   R   R7   R;   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyRD   }   s   	t   ALIGNc           B   s#   e  Z d Z d d „ Z d „  Z RS(	   i   i   i   i   i    c         C   s¥   t  t |  ƒ j d d | ƒt | t ƒ s: t d ƒ ‚ n  | t j k rp t d j | d j	 t j ƒ ƒ ƒ ‚ n  | |  _
 t j j d  k	 r¡ t j j j |  ƒ n  d  S(   NRE   R*   s&   The alignment value must be an integersH   The alignment value {0} is not in the list of supported alignments ({1})s   , (   R+   RE   R   R   t   intt	   TypeErrort   supported_alignmentst
   ValueErrorR#   R   t	   alignmentR   R1   R2   R   R3   (   R   RJ   R*   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR   ¦   s    		c         C   s   d j  |  j ƒ S(   Ns	   align {0}(   R#   RJ   (   R   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR   ±   s    (   i   i   i   i   i    N(   R&   R'   RH   R   R   R   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyRE   £   s   t   RETURNc           B   s)   e  Z d  „  Z d „  Z e d d „ Z RS(   c         O   s[  d d l  m } d d l m } m } m } m } | j d ƒ } | j d ƒ }	 | d  k r� |	 d  k r� t	 j
 j j ƒ  d k r� t j ƒ  } n  t t |  ƒ j d d | ƒt t t | ƒ ƒ |  _ t |  j ƒ d k rÿ t ƒ  |  _ t ƒ  |  _ t ƒ  |  _ n0t |  j ƒ d k r#d d	 l m }
 m } | j d  k rHt d
 ƒ ‚ n  | j j s`| j j  râ|
 |  j d ƒ r'| j j! d  k rž| |  j d ƒ d k sÏ| j j! d  k	 r | j j! | |  j d ƒ k  r t d j" t# |  j d ƒ t# | j ƒ ƒ ƒ ‚ n  t$ f |  _ t$ f |  _ t$ f |  _ q t% |  j d | ƒ r±| j j! |  j d j! k  rŠt d j" t# |  j d ƒ t# | j ƒ ƒ ƒ ‚ n  t& f |  _ t$ f |  _ t$ f |  _ q t' d j" t# |  j d ƒ t# | j ƒ ƒ ƒ ‚ q/| j j( r\t% |  j d | ƒ r+t& f |  _ t$ f |  _ t$ f |  _ q t' d j" t# |  j d ƒ t# | j ƒ ƒ ƒ ‚ q/| j j) rût% |  j d | | | f ƒ rÊ| j j! |  j d j! k rÊt& f |  _ t$ f |  _ t$ f |  _ q t' d j" t# |  j d ƒ t# | j ƒ ƒ ƒ ‚ q/t* d d j+ t t, |  j ƒ ƒ ƒ ‚ n t* d ƒ ‚ t	 j- j. d  k	 rWt	 j- j. j/ |  ƒ n  d  S(   Niÿÿÿÿ(   R@   (   t   GeneralPurposeRegistert   MMXRegistert   XMMRegistert   YMMRegisterR*   t	   prototypei    RK   i   (   t   is_int64t   int_sizes'   Void function should not return a valuei   s5   Value {0} can not be represented with return type {1}s4   Register {0} can not be converted to return type {1}s1   Invalid operand type: RETURN {0} for {1} functions   Invalid operand type: RETURN s   , s4   Pseudo-instruction "RETURN" requires 0 or 1 operands(0   RA   R@   t   peachpy.x86_64.registersRL   RM   RN   RO   t   getR   R   t   x86_64t   optionst   get_debug_levelR   R   R+   RK   R   R   R   R   R,   t   lent   in_regst   out_regst   out_operandst   peachpy.utilRQ   RR   t   result_typeRI   t
   is_integert
   is_pointert   sizeR#   R   R<   R   t   TrueRG   t   is_floating_pointt	   is_vectorR-   R   R   R1   R2   R3   (   R   t   argst   kwargsR@   RL   RM   RN   RO   R*   RP   RQ   RR   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR   ¶   sl    "0+	(	(	(	(	((c         C   s:   t  |  j ƒ d k r d Sd d j t t |  j ƒ ƒ Sd  S(   Ni    RK   s   RETURN s   , (   RX   R,   R   R   R   (   R   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR   ö   s    c         C   s@   | r d n d } | d k r, | t  |  ƒ St d | ƒ ‚ d  S(   Ns   	t    R   s   Invalid assembly format "%s"(   R   R-   (   R   R"   R6   R   t   text(    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR#   ü   s    N(   R&   R'   R   R   R<   R   R#   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyRK   µ   s   	@	t   LOADc           B   s   e  Z d  e f d „  ƒ  YZ RS(   t   ARGUMENTc           B   s    e  Z d  „  Z e d d „ Z RS(   c         O   s†  d d l  m } d d l m } m } m } d d l m } | j d ƒ } | j d ƒ }	 | d  k r™ |	 d  k r™ t
 j j j ƒ  d k r™ t j ƒ  } n  t t j |  ƒ j d d | ƒt t t | ƒ ƒ |  _ t t f |  _ t t f |  _ t |  j ƒ d	 k rt d
 ƒ ‚ n  t |  j d t
 j ƒ s:t  d ƒ ‚ n  | j! |  j d ƒ }
 |
 d  k r|t" d t# |  j d ƒ ƒ ‚ n  t |  j d | ƒ rï|
 j$ s¤|
 j% rï|
 j& d  k	 rZ|  j d j& |
 j& k  rZt" d |  j d |
 f ƒ ‚ qZnk t |  j d | | f ƒ r|
 j' rnC t |  j d | | f ƒ rN|
 j( rN|
 j) | k rNn t" d ƒ ‚ t
 j* j+ d  k	 r‚t
 j* j+ j, |  ƒ n  d  S(   Niÿÿÿÿ(   R@   (   RL   RN   RO   (   t   m64R*   RP   i    s   LOAD.ARGUMENTi   s/   Instruction "LOAD.ARGUMENT" requires 2 operandsi   s<   The source operand to LOAD.ARGUMENT must be of Argument types,   %s is not an argument of the active functions9   Destination register %s is too narrow for the argument %ss/   Unsupported combination of instruction operands(-   RA   R@   RS   RL   RN   RO   t   peachpy.x86_64Rj   RT   R   R   RU   RV   RW   R   R   R+   Rh   Ri   R   R   R   R   R,   Ra   R<   RZ   RY   RX   R-   R   t   ArgumentRG   t   _find_argumentRI   R   R^   R_   R`   Rb   Rc   t   c_typeR1   R2   R3   (   R   Rd   Re   R@   RL   RN   RO   Rj   R*   RP   t   argument(    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR     s<    0 ((%c         C   s9  | d d h k s t  d ƒ ‚ | r* d n d } | d k r'd d l m } m } m } m } m }	 m }
 m } m	 } t
 |  j d |	 |
 | f ƒ s¡ t  d	 ƒ ‚ t
 |  j d | ƒ rð | d
 |  j d j |  j d j |  j d j d ƒ f St
 |  j d | ƒ rši d t d f 6d t d f 6d t d f 6d t d f 6|  j d j |  j d j f } | d | |  j d j |  j d j |  j d j d ƒ f St
 |  j d | ƒ r^i d t d f 6d t d f 6d t d f 6d t d f 6d t d f 6d t d f 6|  j d j |  j d j f } | d | |  j d j |  j d j |  j d j d ƒ f St
 |  j d | ƒ r<i d t d f 6d t d f 6d t d f 6d t d f 6d t d f 6d t d f 6d t d f 6d t d f 6|  j d j |  j d j f } | d | |  j d j |  j d j |  j d j d ƒ f St
 |  j d |
 ƒ r°i d d 6d d 6|  j d j } | d | |  j d j |  j d j |  j d j d ƒ f St
 |  j d | ƒ r5i d d 6d d 6|  j d j } | d | |  j d j |  j d j |  j d j d ƒ f Sn | t |  ƒ Sd  S(   NR   R   s1   Supported assembly formats are 'peachpy' and 'go's   	Rf   iÿÿÿÿ(   t   GeneralPurposeRegister64t   GeneralPurposeRegister32t   GeneralPurposeRegister16t   GeneralPurposeRegister8RL   RM   RN   RO   i    sD   LOAD.ARGUMENT must load into a general-purpose, mmx, or xmm registers   MOVB %s+%d(FP), %si   t   MOVWLSXt   MOVWi   t   MOVWLZXs   %s %s+%d(FP), %st   MOVBLSXt   MOVLi   t   MOVBLZXt   MOVBQSXt   MOVWQSXt   MOVLQSXt   MOVQi   t   MOVBQZXt   MOVWQZXt   MOVLQZXt   MOVD(   R   RS   Rp   Rq   Rr   Rs   RL   RM   RN   RO   R   R,   R   t   stack_offsetR#   Ra   R<   t   is_signed_integerR`   R   (   R   R"   R6   R   Rg   Rp   Rq   Rr   Rs   RL   RM   RN   RO   t   mov_name(    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR#   -  st    	:"	3!6!6!669N(   R&   R'   R   R<   R   R#   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyRi     s   	'(   R&   R'   R    Ri   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyRh     s   t   STOREc           B   s   e  Z d  e f d „  ƒ  YZ RS(   t   RESULTc           B   s    e  Z d  „  Z e d d „ Z RS(   c         O   s  d d l  m } d d l m } m } m } m } d d l m } m	 }	 d d l
 m }
 m } | j d ƒ } | j d ƒ } | d  k r» | d  k r» t j j j ƒ  d k r» t j ƒ  } n  t t j |  ƒ j d	 d | ƒt t t | ƒ ƒ |  _ t f |  _ t f |  _  t! |  j ƒ d
 k r.t" d ƒ ‚ n  | } d  } | d  k r|| j d ƒ } | j# |
 | h k spt$ ‚ | j% } n  | j& d  k ršt' d ƒ ‚ n  | j& |  _( |  j( j) |  _* | |  _+ t, |  j d | ƒ r|  j d j) |  j* k rßt' d t- |  j d ƒ t- |  j( ƒ f ƒ ‚ qßnÀt, |  j d | ƒ r||  j* d d h k rßt' d t- |  j d ƒ t- |  j( ƒ f ƒ ‚ qßnct, |  j d | ƒ rÙ|  j* d d h k rßt' d t- |  j d ƒ t- |  j( ƒ f ƒ ‚ qßnt, |  j d | ƒ rþt' d ƒ ‚ ná |	 |  j d ƒ rß|  j( j. sFt' d |  j d t- |  j( ƒ f ƒ ‚ n  | |  j d ƒ r‘|  j* d k  r‘t' d |  j d t- |  j( ƒ f ƒ ‚ n  |	 |  j d ƒ rß|  j* d k  rßt' d |  j d t- |  j( ƒ f ƒ ‚ qßn  t j/ j0 d  k	 rt j/ j0 j1 |  ƒ n  d  S(   Niÿÿÿÿ(   R@   (   RL   RM   RN   RO   (   t   is_int16t   is_int32(   t   goasm_amd64_abit   goasm_amd64p32_abiR*   RP   i    s   STORE.RESULTi   s-   Instruction "STORE.RESULT" requires 1 operandt   target_functions.   STORE.RESULT can't be used with void functionssF   Can not store result in register %s: size mismatch with return type %si   i   s>   Can not store result in register %s: unsupported register typesB   Can not store integer result %d: type mismatch with result type %si   sB   Can not store integer result %d: size mismatch with result type %s(2   RA   R@   RS   RL   RM   RN   RO   R\   R‡   Rˆ   t   peachpy.x86_64.abiR‰   RŠ   RT   R   R   RU   RV   RW   R   R   R+   R…   R†   R   R   R   R   R,   R<   RZ   Ra   RY   RX   R-   t   abiR   t   result_offsetR]   RI   t   destination_typeR`   t   destination_sizet   destination_offsetR   R   R^   R1   R2   R3   (   R   Rd   Re   R@   RL   RM   RN   RO   R‡   Rˆ   R‰   RŠ   R*   RP   R‹   R‘   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR   p  sf    "0	,,,#"#"&c   	      C   sW  | d d h k s t  d ƒ ‚ | r* d n d } | d k rEd d l m } m } d d l m } t |  j d	 | ƒ r– i d
 d 6d d 6|  j } n‡ t |  j d	 | ƒ rô |  j	 j
 rÖ i d d 6d d 6|  j } qi d
 d 6d d 6|  j } n) i d d 6d d 6d d 6d d 6|  j } | d | | |  j d	 d ƒ |  j f S| t |  ƒ Sd  S(   NR   R   s1   Supported assembly formats are 'peachpy' and 'go's   	Rf   iÿÿÿÿ(   RM   RN   (   t   format_operandi    R�   i   R}   i   t   MOVSSt   MOVSDt   MOVBi   Ru   i   Rx   s   %s %s, ret+%d(FP)(   R   RS   RM   RN   t   peachpy.x86_64.operandR’   R   R,   R�   R�   Rb   R‘   R   (	   R   R"   R6   R   Rg   RM   RN   R’   R„   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR#   ª  s<    	
"N(   R&   R'   R   R<   R   R#   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR†   o  s   	:(   R&   R'   R    R†   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR…   n  s   t   SWAPc           B   s   e  Z e d  „  ƒ Z RS(   c         C   s²   d d l  m } t |  | ƒ r¢ t | | ƒ r¢ |  j | j k r‡ |  j | j k r‡ | j |  j |  _ | _ | j |  j |  _ | _ q® t d j |  | ƒ ƒ ‚ n t	 d ƒ ‚ d  S(   Niÿÿÿÿ(   t   Registers6   Registers {0} and {1} have incompatible register typess%   Arguments must be of register regtype(
   RS   R˜   R   t   kindR`   t
   virtual_idt   physical_idRI   R#   RG   (   t
   register_xt
   register_yR˜   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyt	   REGISTERSÒ  s    $	(   R&   R'   t   staticmethodRž   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR—   Ñ  s   c         C   s•   t  | t t f ƒ s$ t d ƒ ‚ n  d } x` | t | ƒ k  rŒ x= t | t | ƒ d | ƒ D] } |  | | | | | ƒ q\ W| d 9} q- W| d S(   Ns#   List or tuple of registers expectedi   i   i    (   R   R   t   listRI   RX   t   range(   t   reduction_instructiont	   registerst   offsett   i(    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyt   REDUCEà  s    #t   IACAc           B   s4   e  Z d  e f d „  ƒ  YZ d e f d „  ƒ  YZ RS(   t   STARTc           B   s   e  Z d  „  Z RS(   c         O   s!  | j  d ƒ } | j  d ƒ } | d  k r] | d  k r] t j j j ƒ  d k r] t j ƒ  } n  t t	 j
 |  ƒ j d d | ƒt t t | ƒ ƒ |  _ t |  j ƒ d k ré t ƒ  |  _ t ƒ  |  _ t ƒ  |  _ |  j j d d „  f ƒ n t d ƒ ‚ t j j d  k	 rt j j j |  ƒ n  d  S(   NR*   RP   i    s
   IACA.STARTc         S   s(   t  d d d d d d d d d d g
 ƒ S(	   Ni   i   i»   io   i    id   ig   i�   (   t	   bytearray(   t   op(    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyt   <lambda>û  Rf   s3   Pseudo-instruction "IACA.START" requires 0 operands(   RT   R   R   RU   RV   RW   R   R   R+   R§   R¨   R   R   R   R   R,   RX   RY   RZ   R[   t	   encodingst   appendR-   R1   R2   R3   (   R   Rd   Re   R*   RP   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR   î  s    0(   R&   R'   R   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR¨   í  s   t   ENDc           B   s   e  Z d  „  Z RS(   c         O   s!  | j  d ƒ } | j  d ƒ } | d  k r] | d  k r] t j j j ƒ  d k r] t j ƒ  } n  t t	 j
 |  ƒ j d d | ƒt t t | ƒ ƒ |  _ t |  j ƒ d k ré t ƒ  |  _ t ƒ  |  _ t ƒ  |  _ |  j j d d „  f ƒ n t d ƒ ‚ t j j d  k	 rt j j j |  ƒ n  d  S(   NR*   RP   i    s   IACA.ENDc         S   s(   t  d d d d d d d d d d g
 ƒ S(	   Ni»   iÞ   i    id   ig   i�   i   i   (   R©   (   Rª   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR«     Rf   s1   Pseudo-instruction "IACA.END" requires 0 operands(   RT   R   R   RU   RV   RW   R   R   R+   R§   R®   R   R   R   R   R,   RX   RY   RZ   R[   R¬   R­   R-   R1   R2   R3   (   R   Rd   Re   R*   RP   (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR     s    0(   R&   R'   R   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR®     s   (   R&   R'   R    R¨   R®   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyR§   ë  s   (    (    (    (    (    (    (    (   R   t   peachpy.streamR   t   peachpy.x86_64.optionst   peachpy.x86_64.isat   peachpy.x86_64.instructionsR    R–   R   R   t   peachpy.parseR   R   R   R)   R=   RD   RE   RK   Rh   R…   R—   R¦   R§   (    (    (    sB   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/pseudo.pyt   <module>   s"   "'&&Ojc	