
    xKg                     R    d dl mZ d dlmZmZ  G d de      Z G d de      Zd Zy)	    )ir)VisitorCallVisitorc                   0    e Zd ZdZ eg d      Zd Zd Zy)FastFloatBinOpVisitorzb
    A pass to add fastmath flag to float-binop instruction if they don't have
    any flags.
    )faddfsubfmulfdivfremfcmpc                     || _         y Nflagsselfr   s     [/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/numba/core/fastmathpass.py__init__zFastFloatBinOpVisitor.__init__   	    
    c                     |j                   | j                  v r:|j                  s-| j                  D ]  }|j                  j                  |        y y y r   )opnamefloat_binopsr   appendr   instrflags      r   visit_Instructionz'FastFloatBinOpVisitor.visit_Instruction   sE    <<4,,,;; JJDKK&&t, '  -r   N)__name__
__module____qualname____doc__	frozensetr   r   r    r   r   r   r      s     MNL-r   r   c                       e Zd ZdZd Zd Zy)FastFloatCallVisitorzD
    A pass to change all float function calls to use fastmath.
    c                     || _         y r   r   r   s     r   r   zFastFloatCallVisitor.__init__   r   r   c                     |j                   t        j                         t        j                         fv r-| j                  D ]  }|j
                  j                  |        y y r   )typer   	FloatType
DoubleTyper   fastmathaddr   s      r   
visit_CallzFastFloatCallVisitor.visit_Call   sD    ::",,."--/::

""4( # ;r   N)r    r!   r"   r#   r   r/   r%   r   r   r'   r'      s    )r   r'   c                     |j                   }t        |      j                  |        t        |      j                  |        y)zC
    Rewrite the given LLVM module to use fastmath everywhere.
    N)r   r   visitr'   )modoptionsr   s      r   rewrite_moduler4   %   s3     MME% &&s+%%c*r   N)llvmliter   llvmlite.ir.transformsr   r   r   r'   r4   r%   r   r   <module>r7      s(     7-G -"); )+r   