| .file "scalbf.s" |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| FR_Big = f6 |
| FR_NBig = f7 |
| FR_Floating_X = f8 |
| FR_Result = f8 |
| FR_Floating_N = f9 |
| FR_Result2 = f9 |
| FR_Result3 = f10 |
| FR_Norm_X = f11 |
| FR_Two_N = f12 |
| FR_N_float_int = f13 |
| FR_Norm_N = f14 |
| |
| GR_neg_ov_limit= r14 |
| GR_big_exp = r14 |
| GR_N_Biased = r15 |
| GR_Big = r16 |
| GR_exp_Result = r18 |
| GR_pos_ov_limit= r19 |
| GR_exp_sure_ou = r19 |
| GR_Bias = r20 |
| GR_N_as_int = r21 |
| GR_signexp_X = r22 |
| GR_exp_X = r23 |
| GR_exp_mask = r24 |
| GR_max_exp = r25 |
| GR_min_exp = r26 |
| GR_min_den_exp = r27 |
| GR_Scratch = r28 |
| GR_signexp_N = r29 |
| GR_exp_N = r30 |
| |
| GR_SAVE_B0 = r32 |
| GR_SAVE_GP = r33 |
| GR_SAVE_PFS = r34 |
| GR_Parameter_X = r35 |
| GR_Parameter_Y = r36 |
| GR_Parameter_RESULT = r37 |
| GR_Tag = r38 |
| |
| .section .text |
| GLOBAL_IEEE754_ENTRY(scalbf) |
| |
| |
| |
| |
| |
| { .mfi |
| getf.exp GR_signexp_N = FR_Floating_N |
| fclass.m p6,p0 = FR_Floating_X, 0xe7 |
| mov GR_Bias = 0x0ffff |
| } |
| { .mfi |
| mov GR_Big = 35000 |
| fcvt.fx.trunc.s1 FR_N_float_int = FR_Floating_N |
| nop.i 0 |
| } |
| ;; |
| |
| { .mfi |
| getf.exp GR_signexp_X = FR_Floating_X |
| fclass.m p7,p0 = FR_Floating_N, 0x0b |
| nop.i 0 |
| } |
| |
| |
| |
| { .mfi |
| mov GR_exp_mask = 0x1ffff |
| fnorm.s1 FR_Norm_N = FR_Floating_N |
| nop.i 0 |
| } |
| ;; |
| |
| |
| |
| |
| { .mfi |
| mov GR_big_exp = 0x1003e |
| fclass.m p9,p0 = FR_Floating_N, 0xe7 |
| mov GR_max_exp = 0x1007e |
| } |
| |
| |
| |
| { .mfb |
| nop.m 0 |
| fnorm.s1 FR_Norm_X = FR_Floating_X |
| (p7) br.cond.spnt SCALBF_N_UNORM |
| } |
| ;; |
| |
| SCALBF_COMMON1: |
| |
| |
| { .mfb |
| nop.m 0 |
| fcmp.lt.s1 p7,p0 = FR_Floating_N, f0 |
| (p6) br.cond.spnt SCALBF_NAN_INF_ZERO |
| } |
| ;; |
| |
| |
| { .mfi |
| getf.sig GR_N_as_int = FR_N_float_int |
| fclass.m p8,p0 = FR_Floating_X, 0x0b |
| mov GR_exp_sure_ou = 0x1000e |
| } |
| { .mfb |
| mov GR_min_exp = 0x0ff81 |
| fcvt.xf FR_N_float_int = FR_N_float_int |
| (p9) br.cond.spnt SCALBF_NAN_INF_ZERO |
| } |
| ;; |
| |
| { .mmi |
| and GR_exp_N = GR_exp_mask, GR_signexp_N |
| (p7) sub GR_Big = r0, GR_Big |
| nop.i 0 |
| } |
| ;; |
| |
| { .mib |
| cmp.lt p9,p0 = GR_exp_N, GR_big_exp |
| cmp.ge p6,p0 = GR_exp_N, GR_exp_sure_ou |
| (p8) br.cond.spnt SCALBF_X_UNORM |
| } |
| ;; |
| |
| SCALBF_COMMON2: |
| |
| |
| { .mmi |
| (p6) mov GR_N_as_int = GR_Big |
| ;; |
| add GR_N_Biased = GR_Bias,GR_N_as_int |
| nop.i 0 |
| } |
| ;; |
| |
| { .mfi |
| setf.exp FR_Two_N = GR_N_Biased |
| (p9) fcmp.neq.unc.s1 p9,p0 = FR_Norm_N, FR_N_float_int |
| and GR_exp_X = GR_exp_mask, GR_signexp_X |
| } |
| ;; |
| |
| |
| |
| |
| |
| { .mib |
| add GR_exp_Result = GR_exp_X, GR_N_as_int |
| mov GR_min_den_exp = 0x0ff81 - 23 |
| (p9) br.cond.spnt SCALBF_N_NOT_INT |
| } |
| ;; |
| |
| |
| |
| |
| |
| { .mfi |
| cmp.lt p7,p6 = GR_exp_Result, GR_max_exp |
| fcmp.ge.s0 p0,p11 = FR_Floating_X,FR_Floating_N |
| cmp.lt p9,p0 = GR_exp_Result, GR_min_den_exp |
| } |
| { .mfb |
| nop.m 0 |
| fma.s.s0 FR_Result = FR_Two_N,FR_Norm_X,f0 |
| (p9) br.cond.spnt SCALBF_UNDERFLOW |
| } |
| ;; |
| |
| { .mib |
| (p6) cmp.gt.unc p6,p8 = GR_exp_Result, GR_max_exp |
| (p7) cmp.ge.unc p7,p9 = GR_exp_Result, GR_min_exp |
| (p7) br.ret.sptk b0 |
| } |
| ;; |
| |
| { .bbb |
| (p6) br.cond.spnt SCALBF_OVERFLOW |
| (p8) br.cond.spnt SCALBF_POSSIBLE_OVERFLOW |
| (p9) br.cond.spnt SCALBF_POSSIBLE_UNDERFLOW |
| } |
| ;; |
| |
| |
| |
| SCALBF_POSSIBLE_UNDERFLOW: |
| |
| |
| |
| SCALBF_POSSIBLE_OVERFLOW: |
| |
| |
| |
| |
| |
| |
| |
| { .mfi |
| mov GR_pos_ov_limit = 0x1007f |
| fsetc.s3 0x7F,0x41 |
| nop.i 0 |
| } |
| { .mfi |
| mov GR_neg_ov_limit = 0x3007f |
| fsetc.s2 0x7F,0x42 |
| nop.i 0 |
| } |
| ;; |
| |
| |
| |
| |
| { .mfi |
| setf.exp FR_NBig = GR_neg_ov_limit |
| fma.s.s3 FR_Result3 = FR_Two_N,FR_Norm_X,f0 |
| nop.i 0 |
| } |
| { .mfi |
| setf.exp FR_Big = GR_pos_ov_limit |
| fma.s.s2 FR_Result2 = FR_Two_N,FR_Norm_X,f0 |
| nop.i 0 |
| } |
| ;; |
| |
| |
| |
| |
| |
| { .mfi |
| nop.m 0 |
| fsetc.s3 0x7F,0x40 |
| nop.i 0 |
| } |
| { .mfi |
| nop.m 0 |
| fsetc.s2 0x7F,0x40 |
| nop.i 0 |
| } |
| ;; |
| |
| |
| |
| |
| { .mfi |
| nop.m 0 |
| fclass.m p6, p0 = FR_Result3, 0x007 |
| nop.i 0 |
| } |
| { .mfi |
| nop.m 0 |
| fcmp.ge.s1 p7, p8 = FR_Result2 , FR_Big |
| nop.i 0 |
| } |
| ;; |
| |
| |
| |
| |
| { .mfi |
| nop.m 0 |
| (p6) fcmp.neq.unc.s1 p6, p0 = FR_Result , FR_Result2 |
| nop.i 0 |
| } |
| ;; |
| |
| |
| |
| |
| |
| { .mfb |
| nop.m 0 |
| (p8) fcmp.le.unc.s1 p9, p10 = FR_Result2 , FR_NBig |
| (p6) br.cond.spnt SCALBF_UNDERFLOW |
| } |
| ;; |
| |
| |
| |
| |
| { .bbb |
| (p7) br.cond.spnt SCALBF_OVERFLOW |
| (p9) br.cond.spnt SCALBF_OVERFLOW |
| br.ret.sptk b0 |
| } |
| ;; |
| |
| |
| SCALBF_OVERFLOW: |
| { .mib |
| alloc r32=ar.pfs,3,0,4,0 |
| addl GR_Tag = 55, r0 |
| br.cond.sptk __libm_error_region |
| } |
| ;; |
| |
| |
| SCALBF_UNDERFLOW: |
| { .mib |
| alloc r32=ar.pfs,3,0,4,0 |
| addl GR_Tag = 56, r0 |
| br.cond.sptk __libm_error_region |
| } |
| ;; |
| |
| SCALBF_NAN_INF_ZERO: |
| |
| |
| |
| |
| |
| |
| |
| { .mfi |
| getf.sig GR_N_as_int = FR_N_float_int |
| fclass.m p6,p0 = FR_Floating_N, 0xc3 |
| nop.i 0 |
| } |
| { .mfi |
| addl GR_Scratch = 1,r0 |
| fcvt.xf FR_N_float_int = FR_N_float_int |
| nop.i 0 |
| } |
| ;; |
| |
| { .mfi |
| nop.m 0 |
| fclass.m p7,p0 = FR_Floating_X, 0xc3 |
| shl GR_Scratch = GR_Scratch,63 |
| } |
| ;; |
| |
| { .mfi |
| nop.m 0 |
| fclass.m p8,p0 = FR_Floating_N, 0x21 |
| nop.i 0 |
| } |
| { .mfi |
| nop.m 0 |
| fclass.m p9,p0 = FR_Floating_N, 0x22 |
| nop.i 0 |
| } |
| ;; |
| |
| |
| |
| |
| { .mfb |
| nop.m 0 |
| (p6) fma.s.s0 FR_Result = FR_Floating_N,FR_Floating_X,f0 |
| (p6) br.ret.spnt b0 |
| } |
| ;; |
| |
| { .mfb |
| nop.m 0 |
| (p7) fma.s.s0 FR_Result = FR_Floating_N,FR_Floating_X,f0 |
| (p7) br.ret.spnt b0 |
| } |
| ;; |
| |
| |
| |
| |
| |
| { .mfb |
| nop.m 0 |
| (p8) fma.s.s0 FR_Result = FR_Floating_X, FR_Floating_N,f0 |
| (p8) br.ret.spnt b0 |
| } |
| { .mfi |
| nop.m 0 |
| (p9) fnma.s.s0 FR_Floating_N = FR_Floating_N, f1, f0 |
| nop.i 0 |
| } |
| ;; |
| |
| |
| |
| |
| { .mfb |
| cmp.ne p7,p0 = GR_N_as_int,GR_Scratch |
| (p9) frcpa.s0 FR_Result,p0 = FR_Floating_X,FR_Floating_N |
| (p9) br.ret.spnt b0 |
| } |
| ;; |
| |
| |
| |
| |
| { .mfi |
| nop.m 0 |
| (p7) fcmp.neq.unc.s1 p7,p0 = FR_Norm_N, FR_N_float_int |
| nop.i 0 |
| } |
| ;; |
| |
| |
| |
| |
| { .mfb |
| nop.m 0 |
| (p7) frcpa.s0 FR_Result,p0 = f0,f0 |
| (p7) br.ret.spnt b0 |
| } |
| ;; |
| |
| |
| |
| |
| { .mfb |
| nop.m 0 |
| fma.s.s0 FR_Result = FR_Floating_X,f1,f0 |
| br.ret.sptk b0 |
| } |
| ;; |
| |
| |
| |
| SCALBF_N_NOT_INT: |
| { .mfb |
| nop.m 0 |
| frcpa.s0 FR_Result,p0 = f0,f0 |
| br.ret.sptk b0 |
| } |
| ;; |
| |
| |
| SCALBF_N_UNORM: |
| { .mfb |
| getf.exp GR_signexp_N = FR_Norm_N |
| fcvt.fx.trunc.s1 FR_N_float_int = FR_Norm_N |
| br.cond.sptk SCALBF_COMMON1 |
| } |
| ;; |
| |
| |
| SCALBF_X_UNORM: |
| { .mib |
| getf.exp GR_signexp_X = FR_Norm_X |
| nop.i 0 |
| br.cond.sptk SCALBF_COMMON2 |
| } |
| ;; |
| |
| GLOBAL_IEEE754_END(scalbf) |
| LOCAL_LIBM_ENTRY(__libm_error_region) |
| |
| |
| |
| |
| .prologue |
| { .mfi |
| add GR_Parameter_Y=-32,sp |
| nop.f 0 |
| .save ar.pfs,GR_SAVE_PFS |
| mov GR_SAVE_PFS=ar.pfs |
| } |
| |
| |
| |
| { .mfi |
| .fframe 64 |
| add sp=-64,sp |
| nop.f 0 |
| mov GR_SAVE_GP=gp |
| };; |
| |
| |
| |
| |
| |
| { .mmi |
| stfs [GR_Parameter_Y] = FR_Norm_N,16 |
| add GR_Parameter_X = 16,sp |
| .save b0, GR_SAVE_B0 |
| mov GR_SAVE_B0=b0 |
| };; |
| |
| |
| |
| |
| |
| .body |
| { .mib |
| stfs [GR_Parameter_X] = FR_Norm_X |
| add GR_Parameter_RESULT = 0,GR_Parameter_Y |
| nop.b 0 |
| } |
| { .mib |
| stfs [GR_Parameter_Y] = FR_Result |
| add GR_Parameter_Y = -16,GR_Parameter_Y |
| br.call.sptk b0=__libm_error_support# |
| };; |
| |
| |
| |
| |
| { .mmi |
| add GR_Parameter_RESULT = 48,sp |
| nop.m 0 |
| nop.i 0 |
| };; |
| |
| |
| |
| |
| { .mmi |
| ldfs FR_Result = [GR_Parameter_RESULT] |
| .restore sp |
| add sp = 64,sp |
| mov b0 = GR_SAVE_B0 |
| };; |
| |
| |
| |
| |
| { .mib |
| mov gp = GR_SAVE_GP |
| mov ar.pfs = GR_SAVE_PFS |
| br.ret.sptk b0 |
| };; |
| |
| LOCAL_LIBM_END(__libm_error_region) |
| |
| .type __libm_error_support#,@function |
| .global __libm_error_support# |