4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1988-1991 by Sun Microsystems, Inc.
26 #ident "%Z%%M% %I% %E% SMI" /* From SunOS 4.1 1.6 */
29 #include <sys/asm_linkage.h>
31 #include <sys/machtrap.h>
32 #include <sys/simulate.h>
35 * C run time subroutines.
37 * Those beginning in `.' are not callable from C and hence do not
38 * get lint prototypes.
46 #define MASK 0x00000fff
47 #define STRUCT_VAL_OFF (16*4)
52 ! see if key matches
: if
not, structure value
not expected
,
61 ld [%fp
+ STRUCT_VAL_OFF
], %i0
! set expected return value
68 st %o4
, [%i0
+ %o1
] ! delay slot
69 add %i7
, 0x4, %i7
! bump return address
77 ! see if key matches
: if
not, structure value
not expected
,
86 ld [%fp
+ STRUCT_VAL_OFF
], %i0
! set expected return value
93 sth %o4
, [%i0
+ %o1
] ! delay slot
94 add %i7
, 0x4, %i7
! bump return address
100 * Convert 32-bit arg pairs in %o0:o1 and %o2:%o3 to 64-bit args in %o1 and %o2
113 sub %o1
, %o2
, %o0
! %o0
= a - b
114 movrlz
%o0
, %g0
, %o0
! %o0
= (a < b) ?
0 : a - b
115 sub %o1
, %o0
, %o1
! %o1
= (a < b) ?
a : b = min
(a, b)
116 add %o2
, %o0
, %o2
! %o2
= (a < b) ?
b : a = max
(a, b)
117 mulx
%o1
, %o2
, %o1
! min
(a, b) in
"rs1" for early exit