#include "../../cmd/ld/textflag.h"
TEXT ·Hypot(SB),NOSPLIT,$0
MOVL p_hi+4(FP), AX
ANDL $0x7ff00000, AX
CMPL AX, $0x7ff00000
JEQ not_finite
MOVL q_hi+12(FP), AX
ANDL $0x7ff00000, AX
CMPL AX, $0x7ff00000
JEQ not_finite
FMOVD p+0(FP), F0
FABS
FMOVD q+8(FP), F0
FABS
FUCOMI F0, F1
JCC 2(PC)
FXCHD F0, F1
FTST
FSTSW AX
ANDW $0x4000, AX
JNE 10(PC)
FXCHD F0, F1
FDIVD F1, F0
FMULD F0, F0
FLD1
FADDDP F0, F1
FSQRT
FMULDP F0, F1
FMOVDP F0, ret+16(FP)
RET
FMOVDP F0, F1
FMOVDP F0, ret+16(FP)
RET
not_finite:
MOVL p_hi+4(FP), AX
ORL p_lo+0(FP), AX
ANDL $0x7fffffff, AX
CMPL AX, $0x7ff00000
JEQ is_inf
MOVL q_hi+12(FP), AX
ORL q_lo+8(FP), AX
ANDL $0x7fffffff, AX
CMPL AX, $0x7ff00000
JEQ is_inf
MOVL $0x7ff80000, ret_hi+20(FP)
MOVL $0x00000001, ret_lo+16(FP)
RET
is_inf:
MOVL AX, ret_hi+20(FP)
MOVL $0x00000000, ret_lo+16(FP)
RET