⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 submul_1.asm

📁 a very popular packet of cryptography tools,it encloses the most common used algorithm and protocols
💻 ASM
字号:
dnl  IBM POWER mpn_submul_1 -- Multiply a limb vector with a limb and subtractdnl  the result from a second limb vector.dnl  Copyright 1992, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.dnl  This file is part of the GNU MP Library.dnl  The GNU MP Library is free software; you can redistribute it and/or modifydnl  it under the terms of the GNU Lesser General Public License as publisheddnl  by the Free Software Foundation; either version 2.1 of the License, or (atdnl  your option) any later version.dnl  The GNU MP Library is distributed in the hope that it will be useful, butdnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITYdnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Publicdnl  License for more details.dnl  You should have received a copy of the GNU Lesser General Public Licensednl  along with the GNU MP Library; see the file COPYING.LIB.  If not, write todnl  the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,dnl  MA 02111-1307, USA.dnl  INPUT PARAMETERSdnl  res_ptr	r3dnl  s1_ptr	r4dnl  size	r5dnl  s2_limb	r6dnl  The POWER architecture has no unsigned 32x32->64 bit multiplicationdnl  instruction.  To obtain that operation, we have to use the 32x32->64dnl  signed multiplication instruction, and add the appropriate compensation todnl  the high limb of the result.  We add the multiplicand if the multiplierdnl  has its most significant bit set, and we add the multiplier if thednl  multiplicand has its most significant bit set.  We need to preserve thednl  carry flag between each iteration, so we have to compute the compensationdnl  carefully (the natural, srai+and doesn't work).  Since all POWER candnl  branch in zero cycles, we use conditional branches to for the additions.include(`../config.m4')ASM_START()PROLOGUE(mpn_submul_1)	cal	3,-4(3)	l	0,0(4)	cmpi	0,6,0	mtctr	5	mul	9,0,6	srai	7,0,31	and	7,7,6	mfmq	11	cax	9,9,7	l	7,4(3)	sf	8,11,7		C add res_limb	a	11,8,11		C invert cy (r11 is junk)	blt	LnegLpos:	bdz	LendLploop:	lu	0,4(4)	stu	8,4(3)	cmpi	0,0,0	mul	10,0,6	mfmq	0	ae	11,0,9		C low limb + old_cy_limb + old cy	l	7,4(3)	aze	10,10		C propagate cy to new cy_limb	sf	8,11,7		C add res_limb	a	11,8,11		C invert cy (r11 is junk)	bge	Lp0	cax	10,10,6		C adjust high limb for negative limb from s1Lp0:	bdz	Lend0	lu	0,4(4)	stu	8,4(3)	cmpi	0,0,0	mul	9,0,6	mfmq	0	ae	11,0,10	l	7,4(3)	aze	9,9	sf	8,11,7	a	11,8,11		C invert cy (r11 is junk)	bge	Lp1	cax	9,9,6		C adjust high limb for negative limb from s1Lp1:	bdn	Lploop	b	LendLneg:	cax	9,9,0	bdz	LendLnloop:	lu	0,4(4)	stu	8,4(3)	cmpi	0,0,0	mul	10,0,6	mfmq	7	ae	11,7,9	l	7,4(3)	ae	10,10,0		C propagate cy to new cy_limb	sf	8,11,7		C add res_limb	a	11,8,11		C invert cy (r11 is junk)	bge	Ln0	cax	10,10,6		C adjust high limb for negative limb from s1Ln0:	bdz	Lend0	lu	0,4(4)	stu	8,4(3)	cmpi	0,0,0	mul	9,0,6	mfmq	7	ae	11,7,10	l	7,4(3)	ae	9,9,0		C propagate cy to new cy_limb	sf	8,11,7		C add res_limb	a	11,8,11		C invert cy (r11 is junk)	bge	Ln1	cax	9,9,6		C adjust high limb for negative limb from s1Ln1:	bdn	Lnloop	b	LendLend0:	cal	9,0(10)Lend:	st	8,4(3)	aze	3,9	brEPILOGUE(mpn_submul_1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -