From patchwork Mon Mar 7 15:00:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Pandey X-Patchwork-Id: 51675 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A9153385840E for ; Mon, 7 Mar 2022 15:44:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9153385840E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1646667861; bh=TvLUuETCw/k5NDNy8zoTk+uIbtc9A33QAsDqk4snjDg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gB7F5bJPtVNrbjAEFmTe7WJjq5FZofZOIZNULXrnvR/6nAHW5yOBaHv46+mSw/EQL FoGlN0kT23UUABUxvTMWZS6YO3utzYH6B8OiZedgyL5zTROxIaxkjM62KMBRBawACB lae1k53z6l2UM+r4uSVDh1y0aWXPakfTFlyjq4Ag= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by sourceware.org (Postfix) with ESMTPS id 25DA5385841B for ; Mon, 7 Mar 2022 15:02:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 25DA5385841B X-IronPort-AV: E=McAfee;i="6200,9189,10278"; a="254138358" X-IronPort-AV: E=Sophos;i="5.90,162,1643702400"; d="scan'208";a="254138358" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 07:02:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,162,1643702400"; d="scan'208";a="595526477" Received: from scymds01.sc.intel.com ([10.148.94.138]) by fmsmga008.fm.intel.com with ESMTP; 07 Mar 2022 07:02:04 -0800 Received: from gskx-1.sc.intel.com (gskx-1.sc.intel.com [172.25.149.211]) by scymds01.sc.intel.com with ESMTP id 227F21e8016772; Mon, 7 Mar 2022 07:02:04 -0800 To: libc-alpha@sourceware.org Subject: [PATCH 034/126] x86_64: Fix svml_d_atan22_core_sse4.S code formatting Date: Mon, 7 Mar 2022 07:00:29 -0800 Message-Id: <20220307150201.10590-35-skpgkp2@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220307150201.10590-1-skpgkp2@gmail.com> References: <20220307150201.10590-1-skpgkp2@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, KAM_DMARC_NONE, KAM_DMARC_STATUS, NML_ADSP_CUSTOM_MED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sunil K Pandey via Libc-alpha From: Sunil Pandey Reply-To: Sunil K Pandey Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This commit contains following formatting changes 1. Instructions proceeded by a tab. 2. Instruction less than 8 characters in length have a tab between it and the first operand. 3. Instruction greater than 7 characters in length have a space between it and the first operand. 4. Tabs after `#define`d names and their value. 5. 8 space at the beginning of line replaced by tab. 6. Indent comments with code. 7. Remove redundent .text section. --- .../fpu/multiarch/svml_d_atan22_core_sse4.S | 861 +++++++++--------- 1 file changed, 430 insertions(+), 431 deletions(-) diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_atan22_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_d_atan22_core_sse4.S index 138ff2ffa0..e1298b5bfa 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_atan22_core_sse4.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_atan22_core_sse4.S @@ -30,467 +30,466 @@ /* Offsets for data table __svml_datan2_data_internal */ -#define dPI 0 -#define dPIO2 16 -#define dA19 32 -#define dA18 48 -#define dA17 64 -#define dA16 80 -#define dA15 96 -#define dA14 112 -#define dA13 128 -#define dA12 144 -#define dA11 160 -#define dA10 176 -#define dA09 192 -#define dA08 208 -#define dA07 224 -#define dA06 240 -#define dA05 256 -#define dA04 272 -#define dA03 288 -#define dA02 304 -#define dA01 320 -#define dA00 336 -#define dSIGN_MASK 352 -#define iCHK_WORK_SUB 368 -#define iCHK_WORK_CMP 384 -#define dABS_MASK 400 -#define dZERO 416 +#define dPI 0 +#define dPIO2 16 +#define dA19 32 +#define dA18 48 +#define dA17 64 +#define dA16 80 +#define dA15 96 +#define dA14 112 +#define dA13 128 +#define dA12 144 +#define dA11 160 +#define dA10 176 +#define dA09 192 +#define dA08 208 +#define dA07 224 +#define dA06 240 +#define dA05 256 +#define dA04 272 +#define dA03 288 +#define dA02 304 +#define dA01 320 +#define dA00 336 +#define dSIGN_MASK 352 +#define iCHK_WORK_SUB 368 +#define iCHK_WORK_CMP 384 +#define dABS_MASK 400 +#define dZERO 416 #include - .text - .section .text.sse4,"ax",@progbits + .section .text.sse4, "ax", @progbits ENTRY(_ZGVbN2vv_atan2_sse4) - subq $88, %rsp - cfi_def_cfa_offset(96) - movaps %xmm1, %xmm11 - -/* - * #define NO_VECTOR_ZERO_ATAN2_ARGS - * Declarations - * Variables - * Constants - * The end of declarations - * Implementation - * Get r0~=1/B - * Cannot be replaced by VQRCP(D, dR0, dB); - * Argument Absolute values - */ - movups dABS_MASK+__svml_datan2_data_internal(%rip), %xmm1 - movaps %xmm0, %xmm10 - movaps %xmm1, %xmm9 - andps %xmm10, %xmm1 - andps %xmm11, %xmm9 - movaps %xmm1, %xmm4 - cmpnltpd %xmm9, %xmm4 - -/* Argument signs */ - movups dSIGN_MASK+__svml_datan2_data_internal(%rip), %xmm5 - movaps %xmm4, %xmm0 - movaps %xmm5, %xmm8 - movaps %xmm5, %xmm7 - -/* - * 1) If yx then a=-x, b=y, PIO2=Pi/2 - */ - orps %xmm9, %xmm5 - andnps %xmm1, %xmm0 - andps %xmm4, %xmm5 - andps %xmm11, %xmm8 - movups dPIO2+__svml_datan2_data_internal(%rip), %xmm6 - orps %xmm5, %xmm0 - movaps %xmm4, %xmm5 - andps %xmm4, %xmm6 - andnps %xmm9, %xmm5 - andps %xmm1, %xmm4 - orps %xmm4, %xmm5 - andps %xmm10, %xmm7 - divpd %xmm5, %xmm0 - movq iCHK_WORK_SUB+__svml_datan2_data_internal(%rip), %xmm2 - xorl %edx, %edx - -/* Check if y and x are on main path. */ - pshufd $221, %xmm9, %xmm3 - xorl %eax, %eax - pshufd $221, %xmm1, %xmm13 - psubd %xmm2, %xmm3 - psubd %xmm2, %xmm13 - movdqa %xmm3, %xmm4 - movq iCHK_WORK_CMP+__svml_datan2_data_internal(%rip), %xmm12 - movdqa %xmm13, %xmm14 - pcmpgtd %xmm12, %xmm4 - pcmpeqd %xmm12, %xmm3 - pcmpgtd %xmm12, %xmm14 - pcmpeqd %xmm12, %xmm13 - -/* Polynomial. */ - movaps %xmm0, %xmm12 - por %xmm3, %xmm4 - mulpd %xmm0, %xmm12 - -/* P = A19*R2 + A18 */ - movups dA19+__svml_datan2_data_internal(%rip), %xmm15 - movaps %xmm11, %xmm2 - mulpd %xmm12, %xmm15 - addpd dA18+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A17 */ - mulpd %xmm12, %xmm15 - addpd dA17+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A16 */ - mulpd %xmm12, %xmm15 - addpd dA16+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A15 */ - mulpd %xmm12, %xmm15 - addpd dA15+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A14 */ - mulpd %xmm12, %xmm15 - addpd dA14+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A13 */ - mulpd %xmm12, %xmm15 - addpd dA13+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A12 */ - mulpd %xmm12, %xmm15 - addpd dA12+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A11 */ - mulpd %xmm12, %xmm15 - addpd dA11+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A10 */ - mulpd %xmm12, %xmm15 - addpd dA10+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A09 */ - mulpd %xmm12, %xmm15 - addpd dA09+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A08 */ - mulpd %xmm12, %xmm15 - addpd dA08+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A07 */ - mulpd %xmm12, %xmm15 - addpd dA07+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A06 */ - mulpd %xmm12, %xmm15 - addpd dA06+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A05 */ - mulpd %xmm12, %xmm15 - addpd dA05+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A04 */ - mulpd %xmm12, %xmm15 - addpd dA04+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A03 */ - mulpd %xmm12, %xmm15 - addpd dA03+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A02 */ - mulpd %xmm12, %xmm15 - addpd dA02+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 + A01 */ - mulpd %xmm12, %xmm15 - addpd dA01+__svml_datan2_data_internal(%rip), %xmm15 - -/* P = P*R2 */ - mulpd %xmm15, %xmm12 - -/* - * Reconstruction. - * dP=(R+R*dP) + dPIO2 - */ - mulpd %xmm0, %xmm12 - addpd %xmm12, %xmm0 - -/* if x<0, dPI = Pi, else dPI =0 */ - movups dZERO+__svml_datan2_data_internal(%rip), %xmm3 - por %xmm13, %xmm14 - cmplepd %xmm3, %xmm2 - addpd %xmm6, %xmm0 - andps __svml_datan2_data_internal(%rip), %xmm2 - orps %xmm8, %xmm0 - addpd %xmm2, %xmm0 - por %xmm14, %xmm4 - orps %xmm7, %xmm0 - movmskps %xmm4, %ecx - -/* Special branch for fast (vector) processing of zero arguments */ - testb $3, %cl - -/* Go to auxilary branch */ - jne L(AUX_BRANCH) - # LOE rbx rbp r12 r13 r14 r15 eax edx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8 xmm9 xmm10 xmm11 - -/* Return from auxilary branch - * for out of main path inputs - */ + subq $88, %rsp + cfi_def_cfa_offset(96) + movaps %xmm1, %xmm11 + + /* + * #define NO_VECTOR_ZERO_ATAN2_ARGS + * Declarations + * Variables + * Constants + * The end of declarations + * Implementation + * Get r0~=1/B + * Cannot be replaced by VQRCP(D, dR0, dB); + * Argument Absolute values + */ + movups dABS_MASK+__svml_datan2_data_internal(%rip), %xmm1 + movaps %xmm0, %xmm10 + movaps %xmm1, %xmm9 + andps %xmm10, %xmm1 + andps %xmm11, %xmm9 + movaps %xmm1, %xmm4 + cmpnltpd %xmm9, %xmm4 + + /* Argument signs */ + movups dSIGN_MASK+__svml_datan2_data_internal(%rip), %xmm5 + movaps %xmm4, %xmm0 + movaps %xmm5, %xmm8 + movaps %xmm5, %xmm7 + + /* + * 1) If yx then a=-x, b=y, PIO2=Pi/2 + */ + orps %xmm9, %xmm5 + andnps %xmm1, %xmm0 + andps %xmm4, %xmm5 + andps %xmm11, %xmm8 + movups dPIO2+__svml_datan2_data_internal(%rip), %xmm6 + orps %xmm5, %xmm0 + movaps %xmm4, %xmm5 + andps %xmm4, %xmm6 + andnps %xmm9, %xmm5 + andps %xmm1, %xmm4 + orps %xmm4, %xmm5 + andps %xmm10, %xmm7 + divpd %xmm5, %xmm0 + movq iCHK_WORK_SUB+__svml_datan2_data_internal(%rip), %xmm2 + xorl %edx, %edx + + /* Check if y and x are on main path. */ + pshufd $221, %xmm9, %xmm3 + xorl %eax, %eax + pshufd $221, %xmm1, %xmm13 + psubd %xmm2, %xmm3 + psubd %xmm2, %xmm13 + movdqa %xmm3, %xmm4 + movq iCHK_WORK_CMP+__svml_datan2_data_internal(%rip), %xmm12 + movdqa %xmm13, %xmm14 + pcmpgtd %xmm12, %xmm4 + pcmpeqd %xmm12, %xmm3 + pcmpgtd %xmm12, %xmm14 + pcmpeqd %xmm12, %xmm13 + + /* Polynomial. */ + movaps %xmm0, %xmm12 + por %xmm3, %xmm4 + mulpd %xmm0, %xmm12 + + /* P = A19*R2 + A18 */ + movups dA19+__svml_datan2_data_internal(%rip), %xmm15 + movaps %xmm11, %xmm2 + mulpd %xmm12, %xmm15 + addpd dA18+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A17 */ + mulpd %xmm12, %xmm15 + addpd dA17+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A16 */ + mulpd %xmm12, %xmm15 + addpd dA16+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A15 */ + mulpd %xmm12, %xmm15 + addpd dA15+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A14 */ + mulpd %xmm12, %xmm15 + addpd dA14+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A13 */ + mulpd %xmm12, %xmm15 + addpd dA13+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A12 */ + mulpd %xmm12, %xmm15 + addpd dA12+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A11 */ + mulpd %xmm12, %xmm15 + addpd dA11+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A10 */ + mulpd %xmm12, %xmm15 + addpd dA10+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A09 */ + mulpd %xmm12, %xmm15 + addpd dA09+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A08 */ + mulpd %xmm12, %xmm15 + addpd dA08+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A07 */ + mulpd %xmm12, %xmm15 + addpd dA07+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A06 */ + mulpd %xmm12, %xmm15 + addpd dA06+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A05 */ + mulpd %xmm12, %xmm15 + addpd dA05+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A04 */ + mulpd %xmm12, %xmm15 + addpd dA04+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A03 */ + mulpd %xmm12, %xmm15 + addpd dA03+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A02 */ + mulpd %xmm12, %xmm15 + addpd dA02+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 + A01 */ + mulpd %xmm12, %xmm15 + addpd dA01+__svml_datan2_data_internal(%rip), %xmm15 + + /* P = P*R2 */ + mulpd %xmm15, %xmm12 + + /* + * Reconstruction. + * dP=(R+R*dP) + dPIO2 + */ + mulpd %xmm0, %xmm12 + addpd %xmm12, %xmm0 + + /* if x<0, dPI = Pi, else dPI =0 */ + movups dZERO+__svml_datan2_data_internal(%rip), %xmm3 + por %xmm13, %xmm14 + cmplepd %xmm3, %xmm2 + addpd %xmm6, %xmm0 + andps __svml_datan2_data_internal(%rip), %xmm2 + orps %xmm8, %xmm0 + addpd %xmm2, %xmm0 + por %xmm14, %xmm4 + orps %xmm7, %xmm0 + movmskps %xmm4, %ecx + + /* Special branch for fast (vector) processing of zero arguments */ + testb $3, %cl + + /* Go to auxilary branch */ + jne L(AUX_BRANCH) + # LOE rbx rbp r12 r13 r14 r15 eax edx xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8 xmm9 xmm10 xmm11 + + /* Return from auxilary branch + * for out of main path inputs + */ L(AUX_BRANCH_RETURN): -/* - * Special branch for fast (vector) processing of zero arguments - * The end of implementation - */ - testl %edx, %edx + /* + * Special branch for fast (vector) processing of zero arguments + * The end of implementation + */ + testl %edx, %edx -/* Go to special inputs processing branch */ - jne L(SPECIAL_VALUES_BRANCH) - # LOE rbx rbp r12 r13 r14 r15 eax edx xmm0 xmm10 xmm11 + /* Go to special inputs processing branch */ + jne L(SPECIAL_VALUES_BRANCH) + # LOE rbx rbp r12 r13 r14 r15 eax edx xmm0 xmm10 xmm11 -/* Restore registers - * and exit the function - */ + /* Restore registers + * and exit the function + */ L(EXIT): - addq $88, %rsp - cfi_def_cfa_offset(8) - ret - cfi_def_cfa_offset(96) + addq $88, %rsp + cfi_def_cfa_offset(8) + ret + cfi_def_cfa_offset(96) -/* Branch to process - * special inputs - */ + /* Branch to process + * special inputs + */ L(SPECIAL_VALUES_BRANCH): - movups %xmm10, 32(%rsp) - movups %xmm11, 48(%rsp) - movups %xmm0, 64(%rsp) - # LOE rbx rbp r12 r13 r14 r15 eax edx xmm0 - - movq %r12, 16(%rsp) - cfi_offset(12, -80) - movl %eax, %r12d - movq %r13, 8(%rsp) - cfi_offset(13, -88) - movl %edx, %r13d - movq %r14, (%rsp) - cfi_offset(14, -96) - # LOE rbx rbp r15 r12d r13d - -/* Range mask - * bits check - */ + movups %xmm10, 32(%rsp) + movups %xmm11, 48(%rsp) + movups %xmm0, 64(%rsp) + # LOE rbx rbp r12 r13 r14 r15 eax edx xmm0 + + movq %r12, 16(%rsp) + cfi_offset(12, -80) + movl %eax, %r12d + movq %r13, 8(%rsp) + cfi_offset(13, -88) + movl %edx, %r13d + movq %r14, (%rsp) + cfi_offset(14, -96) + # LOE rbx rbp r15 r12d r13d + + /* Range mask + * bits check + */ L(RANGEMASK_CHECK): - btl %r12d, %r13d + btl %r12d, %r13d -/* Call scalar math function */ - jc L(SCALAR_MATH_CALL) - # LOE rbx rbp r15 r12d r13d + /* Call scalar math function */ + jc L(SCALAR_MATH_CALL) + # LOE rbx rbp r15 r12d r13d -/* Special inputs - * processing loop - */ + /* Special inputs + * processing loop + */ L(SPECIAL_VALUES_LOOP): - incl %r12d - cmpl $2, %r12d - -/* Check bits in range mask */ - jl L(RANGEMASK_CHECK) - # LOE rbx rbp r15 r12d r13d - - movq 16(%rsp), %r12 - cfi_restore(12) - movq 8(%rsp), %r13 - cfi_restore(13) - movq (%rsp), %r14 - cfi_restore(14) - movups 64(%rsp), %xmm0 - -/* Go to exit */ - jmp L(EXIT) - cfi_offset(12, -80) - cfi_offset(13, -88) - cfi_offset(14, -96) - # LOE rbx rbp r12 r13 r14 r15 xmm0 - -/* Scalar math fucntion call - * to process special input - */ + incl %r12d + cmpl $2, %r12d + + /* Check bits in range mask */ + jl L(RANGEMASK_CHECK) + # LOE rbx rbp r15 r12d r13d + + movq 16(%rsp), %r12 + cfi_restore(12) + movq 8(%rsp), %r13 + cfi_restore(13) + movq (%rsp), %r14 + cfi_restore(14) + movups 64(%rsp), %xmm0 + + /* Go to exit */ + jmp L(EXIT) + cfi_offset(12, -80) + cfi_offset(13, -88) + cfi_offset(14, -96) + # LOE rbx rbp r12 r13 r14 r15 xmm0 + + /* Scalar math fucntion call + * to process special input + */ L(SCALAR_MATH_CALL): - movl %r12d, %r14d - movsd 32(%rsp,%r14,8), %xmm0 - movsd 48(%rsp,%r14,8), %xmm1 - call atan2@PLT - # LOE rbx rbp r14 r15 r12d r13d xmm0 - - movsd %xmm0, 64(%rsp,%r14,8) - -/* Process special inputs in loop */ - jmp L(SPECIAL_VALUES_LOOP) - cfi_restore(12) - cfi_restore(13) - cfi_restore(14) - # LOE rbx rbp r15 r12d r13d - -/* Auxilary branch - * for out of main path inputs - */ + movl %r12d, %r14d + movsd 32(%rsp, %r14, 8), %xmm0 + movsd 48(%rsp, %r14, 8), %xmm1 + call atan2@PLT + # LOE rbx rbp r14 r15 r12d r13d xmm0 -L(AUX_BRANCH): -/* Check if both X & Y are not NaNs: iXYnotNAN */ - movaps %xmm11, %xmm13 - movaps %xmm10, %xmm12 - cmpordpd %xmm11, %xmm13 - cmpordpd %xmm10, %xmm12 + movsd %xmm0, 64(%rsp, %r14, 8) -/* Check if at least on of Y or Y is zero: iAXAYZERO */ - cmpeqpd %xmm3, %xmm9 - cmpeqpd %xmm3, %xmm1 + /* Process special inputs in loop */ + jmp L(SPECIAL_VALUES_LOOP) + cfi_restore(12) + cfi_restore(13) + cfi_restore(14) + # LOE rbx rbp r15 r12d r13d -/* - * Path for zero arguments (at least one of both) - * Check if both args are zeros (den. is zero) - */ - cmpeqpd %xmm3, %xmm5 - andps %xmm12, %xmm13 - orps %xmm1, %xmm9 - pshufd $221, %xmm9, %xmm1 - pshufd $221, %xmm13, %xmm9 - -/* Check if at least on of Y or Y is zero and not NaN: iAXAYZEROnotNAN */ - pand %xmm9, %xmm1 - -/* Exclude from previous callout mask zero (and not NaN) arguments */ - movdqa %xmm1, %xmm14 - pandn %xmm4, %xmm14 - -/* Set sPIO2 to zero if den. is zero */ - movaps %xmm5, %xmm4 - andnps %xmm6, %xmm4 - andps %xmm3, %xmm5 - -/* Res = sign(Y)*(X<0)?(PIO2+PI):PIO2 */ - pshufd $221, %xmm3, %xmm3 - orps %xmm5, %xmm4 - pshufd $221, %xmm11, %xmm5 - orps %xmm8, %xmm4 - pcmpgtd %xmm5, %xmm3 - pshufd $80, %xmm3, %xmm6 - andps %xmm2, %xmm6 - addpd %xmm6, %xmm4 - -/* Go to callout */ - movmskps %xmm14, %edx - -/* Merge results from main and spec path */ - pshufd $80, %xmm1, %xmm2 - orps %xmm7, %xmm4 - movdqa %xmm2, %xmm7 - andps %xmm2, %xmm4 - andnps %xmm0, %xmm7 - andl $3, %edx - movaps %xmm7, %xmm0 - orps %xmm4, %xmm0 - -/* Return to main vector processing path */ - jmp L(AUX_BRANCH_RETURN) - # LOE rbx rbp r12 r13 r14 r15 eax edx xmm0 xmm10 xmm11 + /* Auxilary branch + * for out of main path inputs + */ + +L(AUX_BRANCH): + /* Check if both X & Y are not NaNs: iXYnotNAN */ + movaps %xmm11, %xmm13 + movaps %xmm10, %xmm12 + cmpordpd %xmm11, %xmm13 + cmpordpd %xmm10, %xmm12 + + /* Check if at least on of Y or Y is zero: iAXAYZERO */ + cmpeqpd %xmm3, %xmm9 + cmpeqpd %xmm3, %xmm1 + + /* + * Path for zero arguments (at least one of both) + * Check if both args are zeros (den. is zero) + */ + cmpeqpd %xmm3, %xmm5 + andps %xmm12, %xmm13 + orps %xmm1, %xmm9 + pshufd $221, %xmm9, %xmm1 + pshufd $221, %xmm13, %xmm9 + + /* Check if at least on of Y or Y is zero and not NaN: iAXAYZEROnotNAN */ + pand %xmm9, %xmm1 + + /* Exclude from previous callout mask zero (and not NaN) arguments */ + movdqa %xmm1, %xmm14 + pandn %xmm4, %xmm14 + + /* Set sPIO2 to zero if den. is zero */ + movaps %xmm5, %xmm4 + andnps %xmm6, %xmm4 + andps %xmm3, %xmm5 + + /* Res = sign(Y)*(X<0)?(PIO2+PI):PIO2 */ + pshufd $221, %xmm3, %xmm3 + orps %xmm5, %xmm4 + pshufd $221, %xmm11, %xmm5 + orps %xmm8, %xmm4 + pcmpgtd %xmm5, %xmm3 + pshufd $80, %xmm3, %xmm6 + andps %xmm2, %xmm6 + addpd %xmm6, %xmm4 + + /* Go to callout */ + movmskps %xmm14, %edx + + /* Merge results from main and spec path */ + pshufd $80, %xmm1, %xmm2 + orps %xmm7, %xmm4 + movdqa %xmm2, %xmm7 + andps %xmm2, %xmm4 + andnps %xmm0, %xmm7 + andl $3, %edx + movaps %xmm7, %xmm0 + orps %xmm4, %xmm0 + + /* Return to main vector processing path */ + jmp L(AUX_BRANCH_RETURN) + # LOE rbx rbp r12 r13 r14 r15 eax edx xmm0 xmm10 xmm11 END(_ZGVbN2vv_atan2_sse4) - .section .rodata, "a" - .align 16 + .section .rodata, "a" + .align 16 #ifdef __svml_datan2_data_internal_typedef typedef unsigned int VUINT32; typedef struct { - __declspec(align(16)) VUINT32 dPI[2][2]; - __declspec(align(16)) VUINT32 dPIO2[2][2]; - __declspec(align(16)) VUINT32 dA19[2][2]; - __declspec(align(16)) VUINT32 dA18[2][2]; - __declspec(align(16)) VUINT32 dA17[2][2]; - __declspec(align(16)) VUINT32 dA16[2][2]; - __declspec(align(16)) VUINT32 dA15[2][2]; - __declspec(align(16)) VUINT32 dA14[2][2]; - __declspec(align(16)) VUINT32 dA13[2][2]; - __declspec(align(16)) VUINT32 dA12[2][2]; - __declspec(align(16)) VUINT32 dA11[2][2]; - __declspec(align(16)) VUINT32 dA10[2][2]; - __declspec(align(16)) VUINT32 dA09[2][2]; - __declspec(align(16)) VUINT32 dA08[2][2]; - __declspec(align(16)) VUINT32 dA07[2][2]; - __declspec(align(16)) VUINT32 dA06[2][2]; - __declspec(align(16)) VUINT32 dA05[2][2]; - __declspec(align(16)) VUINT32 dA04[2][2]; - __declspec(align(16)) VUINT32 dA03[2][2]; - __declspec(align(16)) VUINT32 dA02[2][2]; - __declspec(align(16)) VUINT32 dA01[2][2]; - __declspec(align(16)) VUINT32 dA00[2][2]; - __declspec(align(16)) VUINT32 dSIGN_MASK[2][2]; - __declspec(align(16)) VUINT32 iCHK_WORK_SUB[4][1]; - __declspec(align(16)) VUINT32 iCHK_WORK_CMP[4][1]; - __declspec(align(16)) VUINT32 dABS_MASK[2][2]; - __declspec(align(16)) VUINT32 dZERO[2][2]; + __declspec(align(16)) VUINT32 dPI[2][2]; + __declspec(align(16)) VUINT32 dPIO2[2][2]; + __declspec(align(16)) VUINT32 dA19[2][2]; + __declspec(align(16)) VUINT32 dA18[2][2]; + __declspec(align(16)) VUINT32 dA17[2][2]; + __declspec(align(16)) VUINT32 dA16[2][2]; + __declspec(align(16)) VUINT32 dA15[2][2]; + __declspec(align(16)) VUINT32 dA14[2][2]; + __declspec(align(16)) VUINT32 dA13[2][2]; + __declspec(align(16)) VUINT32 dA12[2][2]; + __declspec(align(16)) VUINT32 dA11[2][2]; + __declspec(align(16)) VUINT32 dA10[2][2]; + __declspec(align(16)) VUINT32 dA09[2][2]; + __declspec(align(16)) VUINT32 dA08[2][2]; + __declspec(align(16)) VUINT32 dA07[2][2]; + __declspec(align(16)) VUINT32 dA06[2][2]; + __declspec(align(16)) VUINT32 dA05[2][2]; + __declspec(align(16)) VUINT32 dA04[2][2]; + __declspec(align(16)) VUINT32 dA03[2][2]; + __declspec(align(16)) VUINT32 dA02[2][2]; + __declspec(align(16)) VUINT32 dA01[2][2]; + __declspec(align(16)) VUINT32 dA00[2][2]; + __declspec(align(16)) VUINT32 dSIGN_MASK[2][2]; + __declspec(align(16)) VUINT32 iCHK_WORK_SUB[4][1]; + __declspec(align(16)) VUINT32 iCHK_WORK_CMP[4][1]; + __declspec(align(16)) VUINT32 dABS_MASK[2][2]; + __declspec(align(16)) VUINT32 dZERO[2][2]; } __svml_datan2_data_internal; #endif __svml_datan2_data_internal: - .quad 0x400921FB54442D18, 0x400921FB54442D18 //dPI - .align 16 - .quad 0x3FF921FB54442D18, 0x3FF921FB54442D18 //dPIO2 - .align 16 - .quad 0xBEF4FDB537ABC7A3, 0xBEF4FDB537ABC7A3 // dA19 - .align 16 - .quad 0x3F2CED0A36665209, 0x3F2CED0A36665209 // dA18 - .align 16 - .quad 0xBF52E67C93954C23, 0xBF52E67C93954C23 // dA17 - .align 16 - .quad 0x3F6F5A1DAE82AFB3, 0x3F6F5A1DAE82AFB3 // dA16 - .align 16 - .quad 0xBF82B2EC618E4BAD, 0xBF82B2EC618E4BAD // dA15 - .align 16 - .quad 0x3F914F4C661116A5, 0x3F914F4C661116A5 // dA14 - .align 16 - .quad 0xBF9A5E83B081F69C, 0xBF9A5E83B081F69C // dA13 - .align 16 - .quad 0x3FA169980CB6AD4F, 0x3FA169980CB6AD4F // dA12 - .align 16 - .quad 0xBFA4EFA2E563C1BC, 0xBFA4EFA2E563C1BC // dA11 - .align 16 - .quad 0x3FA7EC0FBC50683B, 0x3FA7EC0FBC50683B // dA10 - .align 16 - .quad 0xBFAAD261EAA09954, 0xBFAAD261EAA09954 // dA09 - .align 16 - .quad 0x3FAE1749BD612DCF, 0x3FAE1749BD612DCF // dA08 - .align 16 - .quad 0xBFB11084009435E0, 0xBFB11084009435E0 // dA07 - .align 16 - .quad 0x3FB3B12A49295651, 0x3FB3B12A49295651 // dA06 - .align 16 - .quad 0xBFB745D009BADA94, 0xBFB745D009BADA94 // dA05 - .align 16 - .quad 0x3FBC71C707F7D5B5, 0x3FBC71C707F7D5B5 // dA04 - .align 16 - .quad 0xBFC2492491EE55C7, 0xBFC2492491EE55C7 // dA03 - .align 16 - .quad 0x3FC999999997EE34, 0x3FC999999997EE34 // dA02 - .align 16 - .quad 0xBFD55555555553C5, 0xBFD55555555553C5 // dA01 - .align 16 - .quad 0x3FF0000000000000, 0x3FF0000000000000 // dA00 - .align 16 - .quad 0x8000000000000000, 0x8000000000000000 //dSIGN_MASK - .align 16 - .long 0x80300000, 0x80300000, 0x80300000, 0x80300000 //iCHK_WORK_SUB - .align 16 - .long 0xfdd00000, 0xfdd00000, 0xfdd00000, 0xfdd00000 //iCHK_WORK_CMP - .align 16 - .quad 0x7fffffffffffffff, 0x7fffffffffffffff //dABS_MASK - .align 16 - .quad 0x0000000000000000, 0x0000000000000000 //dZERO - .align 16 - .type __svml_datan2_data_internal,@object - .size __svml_datan2_data_internal,.-__svml_datan2_data_internal + .quad 0x400921FB54442D18, 0x400921FB54442D18 // dPI + .align 16 + .quad 0x3FF921FB54442D18, 0x3FF921FB54442D18 // dPIO2 + .align 16 + .quad 0xBEF4FDB537ABC7A3, 0xBEF4FDB537ABC7A3 // dA19 + .align 16 + .quad 0x3F2CED0A36665209, 0x3F2CED0A36665209 // dA18 + .align 16 + .quad 0xBF52E67C93954C23, 0xBF52E67C93954C23 // dA17 + .align 16 + .quad 0x3F6F5A1DAE82AFB3, 0x3F6F5A1DAE82AFB3 // dA16 + .align 16 + .quad 0xBF82B2EC618E4BAD, 0xBF82B2EC618E4BAD // dA15 + .align 16 + .quad 0x3F914F4C661116A5, 0x3F914F4C661116A5 // dA14 + .align 16 + .quad 0xBF9A5E83B081F69C, 0xBF9A5E83B081F69C // dA13 + .align 16 + .quad 0x3FA169980CB6AD4F, 0x3FA169980CB6AD4F // dA12 + .align 16 + .quad 0xBFA4EFA2E563C1BC, 0xBFA4EFA2E563C1BC // dA11 + .align 16 + .quad 0x3FA7EC0FBC50683B, 0x3FA7EC0FBC50683B // dA10 + .align 16 + .quad 0xBFAAD261EAA09954, 0xBFAAD261EAA09954 // dA09 + .align 16 + .quad 0x3FAE1749BD612DCF, 0x3FAE1749BD612DCF // dA08 + .align 16 + .quad 0xBFB11084009435E0, 0xBFB11084009435E0 // dA07 + .align 16 + .quad 0x3FB3B12A49295651, 0x3FB3B12A49295651 // dA06 + .align 16 + .quad 0xBFB745D009BADA94, 0xBFB745D009BADA94 // dA05 + .align 16 + .quad 0x3FBC71C707F7D5B5, 0x3FBC71C707F7D5B5 // dA04 + .align 16 + .quad 0xBFC2492491EE55C7, 0xBFC2492491EE55C7 // dA03 + .align 16 + .quad 0x3FC999999997EE34, 0x3FC999999997EE34 // dA02 + .align 16 + .quad 0xBFD55555555553C5, 0xBFD55555555553C5 // dA01 + .align 16 + .quad 0x3FF0000000000000, 0x3FF0000000000000 // dA00 + .align 16 + .quad 0x8000000000000000, 0x8000000000000000 // dSIGN_MASK + .align 16 + .long 0x80300000, 0x80300000, 0x80300000, 0x80300000 // iCHK_WORK_SUB + .align 16 + .long 0xfdd00000, 0xfdd00000, 0xfdd00000, 0xfdd00000 // iCHK_WORK_CMP + .align 16 + .quad 0x7fffffffffffffff, 0x7fffffffffffffff // dABS_MASK + .align 16 + .quad 0x0000000000000000, 0x0000000000000000 // dZERO + .align 16 + .type __svml_datan2_data_internal, @object + .size __svml_datan2_data_internal, .-__svml_datan2_data_internal