ó
™^c           @   s’   d  d l  m Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d d d	 „  ƒ  YZ d
 e f d „  ƒ  YZ d d d „  ƒ  YZ d S(   iÿÿÿÿ(   t   Enumt   SectionTypec           B   s   e  Z d  Z d Z RS(   i    i   (   t   __name__t
   __module__t   codet
   const_data(    (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyR      s   t   Sectionc           B   sV   e  Z d  Z d d „ Z d „  Z e d „  ƒ Z e j d „  ƒ Z d „  Z	 d „  Z
 RS(   i   c         C   sµ   d d l  m } t | t ƒ s8 t d t | ƒ ƒ ‚ n  | d  k rM d } n% | | ƒ sr t d t | ƒ ƒ ‚ n  | |  _ | |  _ t	 ƒ  |  _
 t ƒ  |  _ t ƒ  |  _ d |  _ d  S(   Niÿÿÿÿ(   t   is_uint8s)   Type %s is not in SectionType enumerationi    s2   Alignment byte %s is not an 8-bit unsigned integeri   (   t   peachpy.utilR   t
   isinstanceR   t	   TypeErrort   strt   Nonet   typet   alignment_bytet	   bytearrayt   contentt   listt   symbolst   relocationst
   _alignment(   t   selfR   R   R   (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyt   __init__   s    			c         C   s   t  |  j ƒ S(   N(   t   lenR   (   R   (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyt   __len__   s    c         C   s   |  j  S(   N(   R   (   R   (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyt	   alignment"   s    c         C   sÈ   d d l  m } | | ƒ s5 t d t | ƒ ƒ ‚ n  | d k  rT t d | ƒ ‚ n  | | d @d k r{ t d | ƒ ‚ n  | t j k r¦ t d | t j f ƒ ‚ n  | d k r» d } n  | |  _ d  S(	   Niÿÿÿÿ(   t   is_ints   Alignment %s is not an integeri    s&   Alignment %d is not a positive integeri   s    Alignment %d is not a power of 2s+   Alignment %d exceeds maximum alignment (%d)(   R   R   R
   R   t
   ValueErrorR   t   max_alignmentR   (   R   R   R   (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyR   &   s    	c         C   s<   t  | t ƒ s( t d t | ƒ ƒ ‚ n  |  j j | ƒ d  S(   Ns+   Symbol %s is not an instance of Symbol type(   R	   t   SymbolR
   R   R   t   append(   R   t   symbol(    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyt
   add_symbol5   s    c         C   s<   t  | t ƒ s( t d t | ƒ ƒ ‚ n  |  j j | ƒ d  S(   Ns3   Relocation %s is not an instance of Relocation type(   R	   t
   RelocationR
   R   R   R   (   R   t
   relocation(    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyt   add_relocation:   s    N(   R   R   R   R   R   R   t   propertyR   t   setterR    R#   (    (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyR      s   		t   RelocationTypec           B   s   e  Z d  Z d Z RS(   s)   Relocation for RIP-relative disp32 offseti    (   R   R   t   __doc__t
   rip_disp32(    (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyR&   @   s   R!   c           B   s   e  Z d d d  „ Z RS(   c         C   s,  d d l  m } | | ƒ s5 t d t | ƒ ƒ ‚ n  | d k  rT t d | ƒ ‚ n  t | t ƒ s| t d t | ƒ ƒ ‚ n  | d  k	 r± t | t ƒ r± t d t | ƒ ƒ ‚ n  | d  k	 r| | ƒ sâ t d t | ƒ ƒ ‚ n  | d k  rt d	 | ƒ ‚ qn  | |  _	 | |  _
 | |  _ | |  _ d  S(
   Niÿÿÿÿ(   R   s   Offset %s is not an integeri    s   Offset %d is negatives7   Relocation type %s is not in RelocationType enumerations+   Symbol %s is not an instance of Symbol types$   Program counter %s is not an integers   Program counter %d is negative(   R   R   R
   R   R   R	   R&   R   R   t   offsetR   R   t   program_counter(   R   R)   R   R   R*   R   (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyR   F   s$    			N(   R   R   R   R   (    (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyR!   E   s   t
   SymbolTypec           B   s   e  Z d  Z d Z d Z RS(   s   Literal constanti    i   (   R   R   R'   t   literal_constantt   label(    (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyR+   \   s   R   c           B   s   e  Z d d d  „ Z RS(   c            sj  d d l  m } | | ƒ s5 t d t | ƒ ƒ ‚ n  | d k  rT t d | ƒ ‚ n  t | t ƒ s| t d t | ƒ ƒ ‚ n  d d l m ‰  | d  k	 rÝ t | t
 ƒ oÀ t ‡  f d †  | Dƒ ƒ rÝ t d	 t | ƒ ƒ ‚ n  | d  k	 r0| | ƒ st d
 t | ƒ ƒ ‚ n  | d k  r0t d | ƒ ‚ q0n  | |  _ | |  _ d j t t | ƒ ƒ |  _ | |  _ d  S(   Niÿÿÿÿ(   R   s   Offset %s is not an integeri    s   Offset %d is negatives/   Symbol type %s is not in SymbolType enumeration(   t   Namec         3   s   |  ] } t  | ˆ  ƒ Vq d  S(   N(   R	   (   t   .0t   part(   R.   (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pys	   <genexpr>m   s    s'   Name %s must be a tuple of Name objectss   Size %s is not an integers   Size %d is negativet   .(   R   R   R
   R   R   R	   R+   t   peachpy.nameR.   R   t   tuplet   allR)   R   t   joint   mapt   namet   size(   R   R)   R   R7   R8   R   (    (   R.   s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyR   d   s&    8		N(   R   R   R   R   (    (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyR   c   s   N(    (    (	   t   enumR    R   t   objectR   R&   R!   R+   R   (    (    (    s@   /torch/pytorch/third_party/python-peachpy/peachpy/x86_64/meta.pyt   <module>   s   4