Blame sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-vis3.S

Packit 6c4009
/* Round float to int floating-point values, sparc64 vis3 version.
Packit 6c4009
   Copyright (C) 2012-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
   Contributed by David S. Miller <davem@davemloft.net>, 2012.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#include <sysdep.h>
Packit 6c4009
Packit 6c4009
	/* VIS instructions are used to facilitate the formation of
Packit 6c4009
	   easier constants, and the propagation of the sign bit.  */
Packit 6c4009
Packit 6c4009
#define TWO_TWENTYTHREE	0x4b000000		/* 2**23 */
Packit 6c4009
Packit 6c4009
#define ZERO		%f10			/* 0.0 */
Packit 6c4009
#define SIGN_BIT	%f12			/* -0.0 */
Packit 6c4009
Packit 6c4009
ENTRY (__rintf_vis3)
Packit 6c4009
	sethi	%hi(TWO_TWENTYTHREE), %o2
Packit 6c4009
	fzeros	ZERO
Packit 6c4009
Packit 6c4009
	fnegs	ZERO, SIGN_BIT
Packit 6c4009
	movwtos	%o2, %f16
Packit 6c4009
	fabss	%f1, %f14
Packit 6c4009
Packit 6c4009
	fcmps	%fcc3, %f14, %f16
Packit 6c4009
Packit 6c4009
	fmovsuge %fcc3, ZERO, %f16
Packit 6c4009
	fands	%f1, SIGN_BIT, SIGN_BIT
Packit 6c4009
Packit 6c4009
	fors	%f16, SIGN_BIT, %f16
Packit 6c4009
	fadds	%f1, %f16, %f5
Packit 6c4009
	fsubs	%f5, %f16, %f0
Packit 6c4009
	fabss	%f0, %f0
Packit 6c4009
	retl
Packit 6c4009
	 fors	%f0, SIGN_BIT, %f0
Packit 6c4009
END (__rintf_vis3)