...
Run Format

Text file src/math/expm1_s390x.s

Documentation: math

     1	// Copyright 2017 The Go Authors. All rights reserved.
     2	// Use of this source code is governed by a BSD-style
     3	// license that can be found in the LICENSE file.
     4	
     5	#include "textflag.h"
     6	
     7	// Minimax polynomial approximation and other constants
     8	DATA ·expm1rodataL22<> + 0(SB)/8, $-1.0
     9	DATA ·expm1rodataL22<> + 8(SB)/8, $800.0E+00
    10	DATA ·expm1rodataL22<> + 16(SB)/8, $1.0
    11	DATA ·expm1rodataL22<> + 24(SB)/8, $-.231904681384629956E-16
    12	DATA ·expm1rodataL22<> + 32(SB)/8, $0.50000000000000029671E+00
    13	DATA ·expm1rodataL22<> + 40(SB)/8, $0.16666666666666676570E+00
    14	DATA ·expm1rodataL22<> + 48(SB)/8, $0.83333333323590973444E-02
    15	DATA ·expm1rodataL22<> + 56(SB)/8, $0.13889096526400683566E-02
    16	DATA ·expm1rodataL22<> + 64(SB)/8, $0.41666666661701152924E-01
    17	DATA ·expm1rodataL22<> + 72(SB)/8, $0.19841562053987360264E-03
    18	DATA ·expm1rodataL22<> + 80(SB)/8, $-.693147180559945286E+00
    19	DATA ·expm1rodataL22<> + 88(SB)/8, $0.144269504088896339E+01
    20	DATA ·expm1rodataL22<> + 96(SB)/8, $704.0E+00
    21	GLOBL ·expm1rodataL22<> + 0(SB), RODATA, $104
    22	
    23	DATA ·expm1xmone<> + 0(SB)/8, $0xbff0000000000000
    24	GLOBL ·expm1xmone<> + 0(SB), RODATA, $8
    25	DATA ·expm1xinf<> + 0(SB)/8, $0x7ff0000000000000
    26	GLOBL ·expm1xinf<> + 0(SB), RODATA, $8
    27	DATA ·expm1x4ff<> + 0(SB)/8, $0x4ff0000000000000
    28	GLOBL ·expm1x4ff<> + 0(SB), RODATA, $8
    29	DATA ·expm1x2ff<> + 0(SB)/8, $0x2ff0000000000000
    30	GLOBL ·expm1x2ff<> + 0(SB), RODATA, $8
    31	DATA ·expm1xaddexp<> + 0(SB)/8, $0xc2f0000100003ff0
    32	GLOBL ·expm1xaddexp<> + 0(SB), RODATA, $8
    33	
    34	// Log multipliers table
    35	DATA ·expm1tab<> + 0(SB)/8, $0.0
    36	DATA ·expm1tab<> + 8(SB)/8, $-.171540871271399150E-01
    37	DATA ·expm1tab<> + 16(SB)/8, $-.306597931864376363E-01
    38	DATA ·expm1tab<> + 24(SB)/8, $-.410200970469965021E-01
    39	DATA ·expm1tab<> + 32(SB)/8, $-.486343079978231466E-01
    40	DATA ·expm1tab<> + 40(SB)/8, $-.538226193725835820E-01
    41	DATA ·expm1tab<> + 48(SB)/8, $-.568439602538111520E-01
    42	DATA ·expm1tab<> + 56(SB)/8, $-.579091847395528847E-01
    43	DATA ·expm1tab<> + 64(SB)/8, $-.571909584179366341E-01
    44	DATA ·expm1tab<> + 72(SB)/8, $-.548312665987204407E-01
    45	DATA ·expm1tab<> + 80(SB)/8, $-.509471843643441085E-01
    46	DATA ·expm1tab<> + 88(SB)/8, $-.456353588448863359E-01
    47	DATA ·expm1tab<> + 96(SB)/8, $-.389755254243262365E-01
    48	DATA ·expm1tab<> + 104(SB)/8, $-.310332908285244231E-01
    49	DATA ·expm1tab<> + 112(SB)/8, $-.218623539150173528E-01
    50	DATA ·expm1tab<> + 120(SB)/8, $-.115062908917949451E-01
    51	GLOBL ·expm1tab<> + 0(SB), RODATA, $128
    52	
    53	// Expm1 returns e**x - 1, the base-e exponential of x minus 1.
    54	// It is more accurate than Exp(x) - 1 when x is near zero.
    55	//
    56	// Special cases are:
    57	//      Expm1(+Inf) = +Inf
    58	//      Expm1(-Inf) = -1
    59	//      Expm1(NaN) = NaN
    60	// Very large values overflow to -1 or +Inf.
    61	// The algorithm used is minimax polynomial approximation using a table of
    62	// polynomial coefficients determined with a Remez exchange algorithm.
    63	
    64	TEXT	·expm1Asm(SB), NOSPLIT, $0-16
    65		FMOVD	x+0(FP), F0
    66		MOVD	$·expm1rodataL22<>+0(SB), R5
    67		WORD	$0xB3120000	//ltdbr	%f0,%f0
    68		BLTU	L20
    69		FMOVD	F0, F2
    70	L2:
    71		WORD	$0xED205060	//cdb	%f2,.L23-.L22(%r5)
    72		BYTE	$0x00
    73		BYTE	$0x19
    74		BGE	L16
    75		BVS	L16
    76		WFCEDBS	V2, V2, V2
    77		BVS	LEXITTAGexpm1
    78		MOVD	$·expm1xaddexp<>+0(SB), R1
    79		FMOVD	88(R5), F1
    80		FMOVD	0(R1), F2
    81		WFMSDB	V0, V1, V2, V1
    82		FMOVD	80(R5), F6
    83		WFADB	V1, V2, V4
    84		FMOVD	72(R5), F2
    85		FMADD	F6, F4, F0
    86		FMOVD	64(R5), F3
    87		FMOVD	56(R5), F6
    88		FMOVD	48(R5), F5
    89		FMADD	F2, F0, F6
    90		WFMADB	V0, V5, V3, V5
    91		WFMDB	V0, V0, V2
    92		WORD	$0xB3CD0011	//lgdr	%r1,%f1
    93		WFMADB	V6, V2, V5, V6
    94		FMOVD	40(R5), F3
    95		FMOVD	32(R5), F5
    96		WFMADB	V0, V3, V5, V3
    97		FMOVD	24(R5), F5
    98		WFMADB	V2, V6, V3, V2
    99		FMADD	F5, F4, F0
   100		FMOVD	16(R5), F6
   101		WFMADB	V0, V2, V6, V2
   102		WORD	$0xEC3139BC	//risbg	%r3,%r1,57,128+60,3
   103		BYTE	$0x03
   104		BYTE	$0x55
   105		WORD	$0xB3130022	//lcdbr	%f2,%f2
   106		MOVD	$·expm1tab<>+0(SB), R2
   107		WORD	$0x68432000	//ld	%f4,0(%r3,%r2)
   108		FMADD	F4, F0, F0
   109		SLD	$48, R1, R2
   110		WFMSDB	V2, V0, V4, V0
   111		WORD	$0xB3C10042	//ldgr	%f4,%r2
   112		WORD	$0xB3130000	//lcdbr	%f0,%f0
   113		FSUB	F4, F6
   114		WFMSDB	V0, V4, V6, V0
   115		FMOVD	F0, ret+8(FP)
   116		RET
   117	L16:
   118		WFCEDBS	V2, V2, V4
   119		BVS	LEXITTAGexpm1
   120		WORD	$0xED205008	//cdb	%f2,.L34-.L22(%r5)
   121		BYTE	$0x00
   122		BYTE	$0x19
   123		BLT	L6
   124		WFCEDBS	V2, V0, V0
   125		BVS	L7
   126		MOVD	$·expm1xinf<>+0(SB), R1
   127		FMOVD	0(R1), F0
   128		FMOVD	F0, ret+8(FP)
   129		RET
   130	L20:
   131		WORD	$0xB3130020	//lcdbr	%f2,%f0
   132		BR	L2
   133	L6:
   134		MOVD	$·expm1xaddexp<>+0(SB), R1
   135		FMOVD	88(R5), F5
   136		FMOVD	0(R1), F4
   137		WFMSDB	V0, V5, V4, V5
   138		FMOVD	80(R5), F3
   139		WFADB	V5, V4, V1
   140		VLEG	$0, 48(R5), V16
   141		WFMADB	V1, V3, V0, V3
   142		FMOVD	56(R5), F4
   143		FMOVD	64(R5), F7
   144		FMOVD	72(R5), F6
   145		WFMADB	V3, V16, V7, V16
   146		WFMADB	V3, V6, V4, V6
   147		WFMDB	V3, V3, V4
   148		MOVD	$·expm1tab<>+0(SB), R2
   149		WFMADB	V6, V4, V16, V6
   150		VLEG	$0, 32(R5), V16
   151		FMOVD	40(R5), F7
   152		WFMADB	V3, V7, V16, V7
   153		VLEG	$0, 24(R5), V16
   154		WFMADB	V4, V6, V7, V4
   155		WFMADB	V1, V16, V3, V1
   156		FMOVD	16(R5), F6
   157		FMADD	F4, F1, F6
   158		WORD	$0xB3CD0015	//lgdr	%r1,%f5
   159		WORD	$0xB3130066	//lcdbr	%f6,%f6
   160		WORD	$0xEC3139BC	//risbg	%r3,%r1,57,128+60,3
   161		BYTE	$0x03
   162		BYTE	$0x55
   163		WORD	$0x68432000	//ld	%f4,0(%r3,%r2)
   164		FMADD	F4, F1, F1
   165		MOVD	$0x4086000000000000, R2
   166		FMSUB	F1, F6, F4
   167		WORD	$0xB3130044	//lcdbr	%f4,%f4
   168		WFCHDBS	V2, V0, V0
   169		BEQ	L21
   170		ADDW	$0xF000, R1
   171		WORD	$0xEC21000F	//risbgn	%r2,%r1,64-64+0,64-64+0+16-1,64-0-16
   172		BYTE	$0x30
   173		BYTE	$0x59
   174		WORD	$0xB3C10002	//ldgr	%f0,%r2
   175		FMADD	F0, F4, F0
   176		MOVD	$·expm1x4ff<>+0(SB), R3
   177		FMOVD	0(R5), F4
   178		FMOVD	0(R3), F2
   179		WFMADB	V2, V0, V4, V0
   180		FMOVD	F0, ret+8(FP)
   181		RET
   182	L7:
   183		MOVD	$·expm1xmone<>+0(SB), R1
   184		FMOVD	0(R1), F0
   185		FMOVD	F0, ret+8(FP)
   186		RET
   187	L21:
   188		ADDW	$0x1000, R1
   189		WORD	$0xEC21000F	//risbgn	%r2,%r1,64-64+0,64-64+0+16-1,64-0-16
   190		BYTE	$0x30
   191		BYTE	$0x59
   192		WORD	$0xB3C10002	//ldgr	%f0,%r2
   193		FMADD	F0, F4, F0
   194		MOVD	$·expm1x2ff<>+0(SB), R3
   195		FMOVD	0(R5), F4
   196		FMOVD	0(R3), F2
   197		WFMADB	V2, V0, V4, V0
   198		FMOVD	F0, ret+8(FP)
   199		RET
   200	LEXITTAGexpm1:
   201		FMOVD	F0, ret+8(FP)
   202		RET

View as plain text