ó
\K]c           @   sm   d  Z  d d l m Z d d l m Z d d l m Z m Z e d „  ƒ Z e d „  ƒ Z	 e d „  ƒ Z
 d S(	   s™   
This file provides internal compiler utilities that support certain special
operations with bytes and workarounds for limitations enforced in userland.
iÿÿÿÿ(   t	   intrinsic(   t   ir(   t   typest   cgutilsc         C   s+   d „  } t  j t  j t  j ƒ } | | f S(   Nc         S   sO   | \ } } | j  | t j d ƒ j ƒ  ƒ } | j | j | | g ƒ ƒ } | S(   Ni   (   t   bitcastR   t   IntTypet
   as_pointert   loadt   gep(   t   contextt   buildert	   signaturet   argst   datat   idxt   ptrt   ch(    (    s1   lib/python2.7/site-packages/numba/unsafe/bytes.pyt   impl   s    !(   R   t   uint8t   voidptrt   intp(   t	   typingctxR   t   offsetR   t   sig(    (    s1   lib/python2.7/site-packages/numba/unsafe/bytes.pyt	   grab_byte   s    	c         C   s+   d „  } t  j t  j t  j ƒ } | | f S(   Nc         S   sO   | \ } } | j  | t j d ƒ j ƒ  ƒ } | j | j | | g ƒ ƒ } | S(   Ni@   (   R   R   R   R   R   R   (   R	   R
   R   R   R   R   R   R   (    (    s1   lib/python2.7/site-packages/numba/unsafe/bytes.pyR      s    !(   R   t   uint64R   R   (   R   R   R   R   R   (    (    s1   lib/python2.7/site-packages/numba/unsafe/bytes.pyt   grab_uint64_t   s    	c   	      C   sC   d „  } t  j t  j t  j t  j t  j t  j t  j ƒ } | | f S(   s;   Copy nbytes from *(src + src_offset) to *(dst + dst_offset)c         S   se   | \ } } } } } }	 | j  | | g ƒ }
 | j  | | g ƒ } t j | | |
 | |	 ƒ |  j ƒ  S(   N(   R   R   t
   raw_memcpyt   get_dummy_value(   R	   R
   R   R   t   dst_valt   dst_offset_valt   src_valt   src_offset_valt
   nbytes_valt	   align_valt   src_ptrt   dst_ptr(    (    s1   lib/python2.7/site-packages/numba/unsafe/bytes.pyt   codegen'   s
    (   R   t   voidR   R   (	   R   t   dstt
   dst_offsett   srct
   src_offsett   nbytest   alignR%   R   (    (    s1   lib/python2.7/site-packages/numba/unsafe/bytes.pyt   memcpy_region$   s    	0N(   t   __doc__t   numba.extendingR    t   llvmliteR   t   numbaR   R   R   R   R-   (    (    (    s1   lib/python2.7/site-packages/numba/unsafe/bytes.pyt   <module>   s   