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

📄 imin_sse2.s

📁 Optimized GotoBLAS libraries
💻 S
📖 第 1 页 / 共 2 页
字号:
/*********************************************************************//*                                                                   *//*             Optimized BLAS libraries                              *//*                     By Kazushige Goto <kgoto@tacc.utexas.edu>     *//*                                                                   *//* Copyright (c) The University of Texas, 2005. All rights reserved. *//* UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING  *//* THIS SOFTWARE AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF      *//* MERCHANTABILITY, FITNESS FOR ANY PARTICULAR PURPOSE,              *//* NON-INFRINGEMENT AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY  *//* THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF     *//* TRADE. NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO   *//* THE USE OF THE SOFTWARE OR DOCUMENTATION.                         *//* Under no circumstances shall University be liable for incidental, *//* special, indirect, direct or consequential damages or loss of     *//* profits, interruption of business, or related expenses which may  *//* arise from use of Software or Documentation, including but not    *//* limited to those resulting from defects in Software and/or        *//* Documentation, or loss or inaccuracy of data of any kind.         *//*********************************************************************/#define ASSEMBLER#include "common.h"	#define M	ARG1	/* rdi */#define X	ARG2	/* rsi */#define INCX	ARG3	/* rdx */#define RET	%rax#define I	%r8#define XX	%r9#define	MM	%r10	#ifdef MIN#define maxpd	minpd#define maxsd	minsd#endif	PROLOGUE	PROFCODE#ifdef F_INTERFACE#ifndef USE64BITINT	movslq	(M), M	movslq	(INCX), INCX#else	movslq	(M), M	movslq	(INCX), INCX#endif#endif	pxor	%xmm0, %xmm0#ifdef ABS	pxor	%xmm15, %xmm15#endif	xor	RET, RET	testq	M, M	jle	.L999	leaq	(, INCX, SIZE), INCX	testq	INCX, INCX	jle	.L999	movq	M, MM	movq	X, XX#ifdef ABS	cmpeqpd	%xmm15, %xmm15	psrlq	$1, %xmm15#endif	movsd	(X), %xmm0	addq	INCX, X	decq	M#ifdef ABS	andpd	 %xmm15, %xmm0#endif	unpcklpd %xmm0, %xmm0	movapd	 %xmm0, %xmm1	movapd	 %xmm0, %xmm2	movapd	 %xmm0, %xmm3	cmpq	$SIZE, INCX	jne	.L80/* Analigned Check */	cmpq	$7, M	jle	.L50	testq	$7, X	jne	.L50		# Purely Unaligned Mode	testq	$15, X		# Checking for 128bit align	je	.L05	movsd	0 * SIZE(X), %xmm4#ifdef ABS	andpd	 %xmm15, %xmm4#endif	unpcklpd  %xmm4, %xmm4	maxpd	  %xmm4, %xmm3	decq	M	addq	$SIZE, X	ALIGN_3.L05:	movq	M,  I	sarq	$4, I	jle	.L15	ALIGN_4	#define PREFETCHSIZE 256.L11:#ifdef OPTERON	prefetcht0	PREFETCHSIZE * SIZE(X)#endif#ifdef PENTIUM4	prefetchnta	PREFETCHSIZE * SIZE(X)#endif	movapd	0 * SIZE(X), %xmm4#ifdef ABS	andpd	 %xmm15, %xmm4#endif	maxpd	%xmm4, %xmm0	movapd	2 * SIZE(X), %xmm5#ifdef ABS	andpd	 %xmm15, %xmm5#endif	maxpd	%xmm5, %xmm1	movapd	4 * SIZE(X), %xmm6#ifdef ABS	andpd	 %xmm15, %xmm6#endif	maxpd	%xmm6, %xmm2	movapd	6 * SIZE(X), %xmm7#ifdef ABS	andpd	 %xmm15, %xmm7#endif	maxpd	%xmm7, %xmm3#ifdef OPTERON	prefetcht0	(PREFETCHSIZE + 8) * SIZE(X)#endif	movapd	8 * SIZE(X), %xmm4#ifdef ABS	andpd	 %xmm15, %xmm4#endif	maxpd	%xmm4, %xmm0	movapd	10 * SIZE(X), %xmm5#ifdef ABS	andpd	 %xmm15, %xmm5#endif	maxpd	%xmm5, %xmm1	movapd	12 * SIZE(X), %xmm6#ifdef ABS	andpd	 %xmm15, %xmm6#endif	maxpd	%xmm6, %xmm2	movapd	14 * SIZE(X), %xmm7#ifdef ABS	andpd	 %xmm15, %xmm7#endif	maxpd	%xmm7, %xmm3	addq	$16 * SIZE, X	decq	I	jg	.L11	ALIGN_4.L15:	andq	$15,  M	jle	.L20	testq	$8, M	je	.L16	movapd	0 * SIZE(X), %xmm4#ifdef ABS	andpd	 %xmm15, %xmm4#endif	maxpd	%xmm4, %xmm0	movapd	2 * SIZE(X), %xmm5#ifdef ABS	andpd	 %xmm15, %xmm5#endif	maxpd	%xmm5, %xmm1	movapd	4 * SIZE(X), %xmm6#ifdef ABS	andpd	 %xmm15, %xmm6#endif	maxpd	%xmm6, %xmm2	movapd	6 * SIZE(X), %xmm7#ifdef ABS	andpd	 %xmm15, %xmm7#endif	maxpd	%xmm7, %xmm3	addq	$8 * SIZE, X	ALIGN_3.L16:	testq	$4, M	je	.L17	movapd	0 * SIZE(X), %xmm4#ifdef ABS	andpd	 %xmm15, %xmm4#endif	maxpd	%xmm4, %xmm0	movapd	2 * SIZE(X), %xmm5#ifdef ABS	andpd	 %xmm15, %xmm5#endif	maxpd	%xmm5, %xmm1	addq	$4 * SIZE, X	ALIGN_3	.L17:	testq	$2, M	je	.L18	movapd	0 * SIZE(X), %xmm6#ifdef ABS	andpd	 %xmm15, %xmm6#endif	maxpd	%xmm6, %xmm2	addq	$2 * SIZE, X	.L18:	testq	$1, M	je	.L20	movsd	0 * SIZE(X), %xmm7#ifdef ABS	andpd	 %xmm15, %xmm7#endif	unpcklpd  %xmm7, %xmm7	maxpd	%xmm7, %xmm3	ALIGN_3/* Finding Index */.L20:	movq	XX, X	movq	MM, M	maxpd	 %xmm1, %xmm0	maxpd	 %xmm3, %xmm2	maxpd	 %xmm2, %xmm0	movapd	 %xmm0, %xmm1	unpckhpd %xmm0, %xmm0	maxsd	 %xmm1, %xmm0	unpcklpd %xmm0, %xmm0	ALIGN_3	testq	$15, X		# Checking for 128bit align	je	.L21	movsd	0 * SIZE(X), %xmm1#ifdef ABS	andpd	 %xmm15, %xmm1#endif	incq	RET	comisd	%xmm0, %xmm1	je	.L999	addq	$SIZE, X	decq	M	ALIGN_3.L21:	movq	M,  I	sarq	$3, I	jle	.L25	ALIGN_4	.L22:#ifdef OPTERON	prefetcht0	PREFETCHSIZE * SIZE(X)#endif#ifdef PENTIUM4	prefetchnta	PREFETCHSIZE * SIZE(X)#endif	movapd	0 * SIZE(X), %xmm1#ifdef ABS	andpd	 %xmm15, %xmm1#endif	cmpeqpd	%xmm0, %xmm1	movapd	2 * SIZE(X), %xmm3#ifdef ABS	andpd	 %xmm15, %xmm3#endif	cmpeqpd	%xmm0, %xmm3	movapd	4 * SIZE(X), %xmm5#ifdef ABS	andpd	 %xmm15, %xmm5#endif	cmpeqpd	%xmm0, %xmm5	movapd	6 * SIZE(X), %xmm7#ifdef ABS	andpd	 %xmm15, %xmm7#endif	cmpeqpd	%xmm0, %xmm7	orpd	%xmm3, %xmm1	orpd	%xmm7, %xmm5	orpd	%xmm5, %xmm1	movmskpd %xmm1, %r11	testq	 $3, %r11	jne	 .L23	addq	$8 * SIZE, X	addq	$8, RET	decq	I	jg	.L22	jmp	.L25	ALIGN_4.L23:	movsd	0 * SIZE(X), %xmm1	movsd	1 * SIZE(X), %xmm2	movsd	2 * SIZE(X), %xmm3	movsd	3 * SIZE(X), %xmm4	movsd	4 * SIZE(X), %xmm5	movsd	5 * SIZE(X), %xmm6	movsd	6 * SIZE(X), %xmm7	movsd	7 * SIZE(X), %xmm8#ifdef ABS	andpd	 %xmm15, %xmm1	andpd	 %xmm15, %xmm2	andpd	 %xmm15, %xmm3	andpd	 %xmm15, %xmm4	andpd	 %xmm15, %xmm5	andpd	 %xmm15, %xmm6	andpd	 %xmm15, %xmm7	andpd	 %xmm15, %xmm8#endif	addq	$8 * SIZE, X	incq	RET	comisd	%xmm0, %xmm1	je	.L999	incq	RET	comisd	%xmm0, %xmm2	je	.L999	incq	RET	comisd	%xmm0, %xmm3	je	.L999	incq	RET	comisd	%xmm0, %xmm4	je	.L999	incq	RET	comisd	%xmm0, %xmm5	je	.L999	incq	RET	comisd	%xmm0, %xmm6	je	.L999	incq	RET	comisd	%xmm0, %xmm7	je	.L999	incq	RET	jmp	.L999	ALIGN_3.L25:	testq	$4, M	je	.L27	movsd	0 * SIZE(X), %xmm1	movsd	1 * SIZE(X), %xmm2	movsd	2 * SIZE(X), %xmm3	movsd	3 * SIZE(X), %xmm4#ifdef ABS	andpd	 %xmm15, %xmm1	andpd	 %xmm15, %xmm2	andpd	 %xmm15, %xmm3	andpd	 %xmm15, %xmm4#endif	addq	$4 * SIZE, X	incq	RET	comisd	%xmm0, %xmm1	je	.L999	incq	RET	comisd	%xmm0, %xmm2	je	.L999	incq	RET	comisd	%xmm0, %xmm3	je	.L999	incq	RET	comisd	%xmm0, %xmm4	je	.L999	ALIGN_3	.L27:	testq	$2, M	je	.L28	movsd	0 * SIZE(X), %xmm1	movsd	1 * SIZE(X), %xmm2#ifdef ABS	andpd	 %xmm15, %xmm1	andpd	 %xmm15, %xmm2#endif	addq	$2 * SIZE, X	incq	RET	comisd	%xmm0, %xmm1	je	.L999	incq	RET	comisd	%xmm0, %xmm2	je	.L999	ALIGN_3	.L28:	incq	RET	jmp	.L999	ALIGN_3/* Unaligned Mode */.L50:	movq	M,  I	sarq	$4, I	jle	.L55	ALIGN_4.L51:#ifdef OPTERON	prefetcht0	PREFETCHSIZE * SIZE(X)#endif#ifdef PENTIUM4	prefetchnta	PREFETCHSIZE * SIZE(X)#endif	movsd	0 * SIZE(X), %xmm4	movhpd	1 * SIZE(X), %xmm4#ifdef ABS	andpd	 %xmm15, %xmm4#endif	maxpd	%xmm4, %xmm0	movsd	2 * SIZE(X), %xmm5	movhpd	3 * SIZE(X), %xmm5#ifdef ABS	andpd	 %xmm15, %xmm5#endif	maxpd	%xmm5, %xmm1	movsd	4 * SIZE(X), %xmm6	movhpd	5 * SIZE(X), %xmm6#ifdef ABS	andpd	 %xmm15, %xmm6#endif	maxpd	%xmm6, %xmm2	movsd	6 * SIZE(X), %xmm7	movhpd	7 * SIZE(X), %xmm7#ifdef ABS	andpd	 %xmm15, %xmm7#endif	maxpd	%xmm7, %xmm3#ifdef OPTERON	prefetcht0	(PREFETCHSIZE + 8) * SIZE(X)#endif	movsd	8 * SIZE(X), %xmm4	movhpd	9 * SIZE(X), %xmm4#ifdef ABS	andpd	 %xmm15, %xmm4#endif	maxpd	%xmm4, %xmm0	movsd	10 * SIZE(X), %xmm5	movhpd	11 * SIZE(X), %xmm5#ifdef ABS	andpd	 %xmm15, %xmm5#endif	maxpd	%xmm5, %xmm1	movsd	12 * SIZE(X), %xmm6	movhpd	13 * SIZE(X), %xmm6#ifdef ABS	andpd	 %xmm15, %xmm6#endif	maxpd	%xmm6, %xmm2	movsd	14 * SIZE(X), %xmm7	movhpd	15 * SIZE(X), %xmm7#ifdef ABS	andpd	 %xmm15, %xmm7#endif	maxpd	%xmm7, %xmm3	addq	$16 * SIZE, X	decq	I	jg	.L51	ALIGN_4.L55:	andq	$15,  M	jle	.L60	testq	$8, M	je	.L56	movsd	0 * SIZE(X), %xmm4	movhpd	1 * SIZE(X), %xmm4#ifdef ABS	andpd	 %xmm15, %xmm4#endif	maxpd	%xmm4, %xmm0	movsd	2 * SIZE(X), %xmm5	movhpd	3 * SIZE(X), %xmm5#ifdef ABS	andpd	 %xmm15, %xmm5#endif	maxpd	%xmm5, %xmm1	movsd	4 * SIZE(X), %xmm6	movhpd	5 * SIZE(X), %xmm6#ifdef ABS	andpd	 %xmm15, %xmm6#endif	maxpd	%xmm6, %xmm2	movsd	6 * SIZE(X), %xmm7	movhpd	7 * SIZE(X), %xmm7#ifdef ABS	andpd	 %xmm15, %xmm7#endif	maxpd	%xmm7, %xmm3	addq	$8 * SIZE, X	ALIGN_3.L56:	testq	$4, M	je	.L57	movsd	0 * SIZE(X), %xmm4	movhpd	1 * SIZE(X), %xmm4#ifdef ABS	andpd	 %xmm15, %xmm4#endif	maxpd	%xmm4, %xmm0	movsd	2 * SIZE(X), %xmm5	movhpd	3 * SIZE(X), %xmm5#ifdef ABS	andpd	 %xmm15, %xmm5#endif	maxpd	%xmm5, %xmm1	addq	$4 * SIZE, X	ALIGN_3	.L57:	testq	$2, M	je	.L58	movsd	0 * SIZE(X), %xmm6	movhpd	1 * SIZE(X), %xmm6#ifdef ABS

⌨️ 快捷键说明

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