o
    7f?$                  
   @  s  U d Z ddlmZ ddlmZ ddlmZmZmZm	Z	m
Z
 ddlmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZmZmZmZmZmZ dD ](Zeeedd	 eeeged
ed eeegeded eeeegeded qKedegededdZ edegededd ee	fd_ddZ!e!dd  e!d!d" e!d#d$ e!d%d& e!d'd( e!d)d* e!d+d,ed- e!d.d/ed- e!d0d1ed- e!d2d3ed- e!d4d5eed6 e!d7d  e!d8d" e!d9d$ e!d:d& e!d;d( e!d<d* e!d=d,ed- e!d>d/ed- e!d?d1ed- e!d@d3ed- d`dBdCZ"e"d!dDZ#e"dEdFZ$G dGdH dHeZ%eeegedIe	dJZ&eeegedKe	dJZ'e%e
j(e&dLdLe%e
j)e&dMdLe%e
j*e'dLdLe%e
j+e'dMdMe%e
j,e'dLdMe%e
j-e'dMdLdNZ.dOe/dP< eeegedQedJZ0eeegedRedJZ1eeegedSedJZ2eeegedTedJZ3eeegedUedJZ4eeegedVedJZ5eegedWedJZ6eegedXedJZ7eegedYedJZ8eegedZedJZ9eg ed[edJZ:eg ed\edJZ;eg ed]edJZ<d^S )aa<  Arbitrary-precision integer primitive ops.

These mostly operate on (usually) unboxed integers that use a tagged pointer
representation (CPyTagged) and correspond to the Python 'int' type.

See also the documentation for mypyc.rtypes.int_rprimitive.

Use mypyc.ir.ops.IntOp for operations on fixed-width/C integers.
    )annotations)
NamedTuple)
ERR_ALWAYS	ERR_MAGICERR_MAGIC_OVERLAPPING	ERR_NEVERComparisonOp)RTypebit_rprimitivebool_rprimitivec_pyssize_t_rprimitivefloat_rprimitiveint16_rprimitiveint32_rprimitiveint64_rprimitiveint_rprimitiveobject_rprimitivestr_rprimitive
void_rtype)CFunctionDescription	binary_op	custom_opfunction_opload_address_opunary_op)zbuiltins.intzmypy_extensions.i64zmypy_extensions.i32zmypy_extensions.i16zmypy_extensions.u8PyLong_Type)nametypesrcCPyTagged_FromFloatr   	arg_typesreturn_typec_function_name
error_kindCPyLong_FromStrCPyLong_FromStrWithBasezbuiltins.strCPyTagged_Str   )r   r!   r"   r#   r$   priorityCPyBool_Str   r   strr#   r"   r	   r$   intreturnNonec                 C  s   t | ttg|||d d S )Nr    )r   r   )r   r#   r"   r$    r0   Q/home/ertert/spirit/venv/lib/python3.10/site-packages/mypyc/primitives/int_ops.pyint_binary_oph   s   
r2   +CPyTagged_Add-CPyTagged_Subtract*CPyTagged_Multiply&CPyTagged_And|CPyTagged_Or^CPyTagged_Xorz//CPyTagged_FloorDivide)r$   %CPyTagged_Remainderz>>CPyTagged_Rshiftz<<CPyTagged_Lshift/CPyTagged_TrueDivide)r"   r$   z+=z-=z*=z&=z|=z^=z//=z%=z>>=z<<=r   c                 C  s   t | tt|tdS )N)r   arg_typer"   r#   r$   )r   r   r   )r   r#   r0   r0   r1   int_unary_op   s   rG   CPyTagged_Negate~CPyTagged_Invertc                   @  s.   e Zd ZU ded< ded< ded< ded< dS )	IntComparisonOpDescriptionr-   binary_op_variantr   c_func_descriptionboolc_func_negatedc_func_swap_operandsN)__name__
__module____qualname____annotations__r0   r0   r0   r1   rK      s
   
 rK   CPyTagged_IsEq_)r!   r"   r#   r$   CPyTagged_IsLt_FT)z==z!=<z<=>z>=z%dict[str, IntComparisonOpDescription]int_comparison_op_mappingCPyInt64_DivideCPyInt64_RemainderCPyInt32_DivideCPyInt32_RemainderCPyInt16_DivideCPyInt16_RemainderCPyLong_AsInt64CPyTagged_FromSsize_tCPyTagged_FromInt64CPyLong_AsInt32CPyInt32_OverflowCPyInt16_OverflowCPyUInt8_OverflowN)
r   r,   r#   r,   r"   r	   r$   r-   r.   r/   )r   r,   r#   r,   r.   r   )=__doc__
__future__r   typingr   mypyc.ir.opsr   r   r   r   r   mypyc.ir.rtypesr	   r
   r   r   r   r   r   r   r   r   r   r   mypyc.primitives.registryr   r   r   r   r   r   int_nameint_to_str_opr2   rG   
int_neg_opint_invert_oprK   
int_equal_int_less_than_EQNEQSLTSLESGTSGErY   rT   int64_divide_opint64_mod_opint32_divide_opint32_mod_opint16_divide_opint16_mod_opint_to_int64_opssize_t_to_int_opint64_to_int_opint_to_int32_opint32_overflowint16_overflowuint8_overflowr0   r0   r0   r1   <module>   sX   
8 			

















	
