usr/src/lib/libc/sparcv9/fp/fpsetrnd.s
author Mark J. Nelson <Mark.J.Nelson@Sun.COM>
Wed, 06 Aug 2008 16:29:39 -0600
changeset 7298 b69e27387f74
parent 6812 febeba71273d
permissions -rw-r--r--
6733918 Teamware has retired, please welcome your new manager, Mercurial 4758439 some files use "current date" sccs keywords 6560843 asm sources should not rely on .file "%M%" for naming STT_FILE symbols 6560958 Solaris:: perl modules should not use SCCS keywords in version information 6729074 webrev doesn't deal well with remote ssh hg parents
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     1
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     2
 * CDDL HEADER START
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     3
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
6812
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
     5
 * Common Development and Distribution License (the "License").
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
     6
 * You may not use this file except in compliance with the License.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     7
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    11
 * and limitations under the License.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    12
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    18
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    19
 * CDDL HEADER END
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    20
 */
6812
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
    21
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
    22
/*
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
    23
 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
    24
 * Use is subject to license terms.
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
    25
 */
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
    26
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    27
/*	Copyright (c) 1988 AT&T	*/
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    28
/*	  All Rights Reserved	*/
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    29
7298
b69e27387f74 6733918 Teamware has retired, please welcome your new manager, Mercurial
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 6812
diff changeset
    30
	.file	"fpsetrnd.s"
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    31
6812
febeba71273d PSARC 2008/309 expunge synonyms.h
raf
parents: 0
diff changeset
    32
#include "SYS.h"
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    33
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    34
	ANSI_PRAGMA_WEAK(fpsetround,function)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    35
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    36
	ENTRY(fpsetround)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    37
	add	%sp, -SA(MINFRAME), %sp	! get an additional word of storage
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    38
	set	0xc0000000, %o4		! mask of round control bits
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    39
	sll	%o0, 30, %o1		! move input bits into position
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    40
	st	%fsr, [%sp+STACK_BIAS+ARGPUSH]	! get fsr value
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    41
	ld	[%sp+STACK_BIAS+ARGPUSH], %o0	! load into register
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    42
	and	%o1, %o4, %o1		! generate new fsr value
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    43
	andn	%o0, %o4, %o2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    44
	or	%o1, %o2, %o1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    45
	st	%o1, [%sp+STACK_BIAS+ARGPUSH]	! move new fsr value to memory
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    46
	ld	[%sp+STACK_BIAS+ARGPUSH], %fsr	! load fsr with new value
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    47
	srl	%o0, 30, %o0		! return old round control value
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    48
	retl
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    49
	add	%sp, SA(MINFRAME), %sp	! reclaim stack space
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    50
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    51
	SET_SIZE(fpsetround)