fpu_test64.s revision 60c45ed01d4f99571d468c42f609d11a099fab1e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc.
* All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
!
#include<sys/asm_linkage.h>
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
! precision.
! Returns:
! Convention:
!--------------------------------------------------------------------------
!
! f1 = 0
!
.section ".data"
.align 4
.Ldadd:
.skip 4
.Ldadd1:
.skip 4
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
! Name:
! Function:
! Calling:
! Returns:
! Convention:
!--------------------------------------------------------------------------
!
! f1 = 1
!
.section ".data"
.align 4
.Ldtmlt:
.skip 4
.Ldtmlt1:
.skip 4
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
! Name:
! Function:
! Calling:
! Returns:
! Convention:
!--------------------------------------------------------------------------
!
!
! f2 = 0
! f3 = 0
!
.section ".data"
.align 8
.Ldtadddp:
.skip 8
.skip 8
.skip 8
.Lamsw:
.skip 8
.Lalsw:
.skip 8
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
! Name:
! Function:
! Calling:
! Returns:
! Convention:
!--------------------------------------------------------------------------
!
! arguments.
!
! f2 = 0
! f3 = 0
!
.section ".data"
.align 8
.Ldtmdp:
.skip 8
.Ldtmdp1:
.skip 8
.Ldtmdp2:
.skip 8
.Lmmsw:
.skip 8
.Lmlsw:
.skip 8
!
!
.section ".data"
.align 4
.Ltmasp:
.skip 4
.Ltmasp1:
.skip 4
.Ltmasp2:
.skip 4
!
!
.section ".data"
.align 4
.Ltmmsp:
.skip 4
.Ltmmsp1:
.skip 4
.Ltmmsp2:
.skip 4
!
!
.section ".data"
.align 8
.Ltmadp:
.skip 8
.Ltmadp1:
.skip 8
.Ltmadp2:
.skip 8
!
!
!
.section ".data"
.align 8
.Ltmmdp:
.skip 8
.Ltmmdp1:
.skip 8
.Ltmmdp2:
.skip 8
!
!
!
!--------------------------------------------------------------------------
!
!
.section ".data"
.align 8
.Lwadds:
.word 0
.Lwadds1:
.word 0
.Lwadds2:
!
!
.section ".data"
.align 8
.Ladddp:
.word 0
.Ladddp1:
.word 0
.Ladddp2:
!
!
!
.section ".data"
.align 8
.Ldvsp:
.word 0
.Ldvsp1:
.word 0
.Ldvsp2:
!
!
!
.section ".data"
.align 8
.Ldvdp:
.word 0
.Ldvdp1:
.word 0
.Ldvdp2:
!
!
!
.section ".data"
.align 8
.Lmltsp:
.word 0
.Lmltsp1:
.word 0
.Lmltsp2:
!
!
!
.section ".data"
.align 8
.Lmltdp:
.word 0
.Lmltdp1:
.word 0
.Lmltdp2:
!
!
!
.section ".data"
.align 4
.word 0
.align 8
!
!
!
.section ".data"
.align 8
.xword 0
!
!
!
.section ".data"
.align 8
.Lchsp:
.word 0
.Lchsp1:
.word 0
!
!
.section ".data"
.align 8
.Lchdp:
.word 0
.Lchdp1:
.word 0
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!--------------------------------------------------------------------------
.section ".data"
.align 8
.Lclrg:
.skip 8
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!--------------------------------------------------------------------------
.section ".data"
.align 8
.Lclrg_dp:
.skip 16
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
! Name:
! Function:
! Calling:
! Returns:
! Convention:
!--------------------------------------------------------------------------
.section ".data"
.align 4
.Lrgtst1:
.skip 4
.Lrgtst2:
.skip 4
regTable :
TEST_REG(0)
TEST_REG(1)
TEST_REG(2)
TEST_REG(3)
TEST_REG(4)
TEST_REG(5)
TEST_REG(6)
TEST_REG(7)
TEST_REG(8)
TEST_REG(9)
TEST_REG(10)
TEST_REG(11)
TEST_REG(12)
TEST_REG(13)
TEST_REG(14)
TEST_REG(15)
TEST_REG(16)
TEST_REG(17)
TEST_REG(18)
TEST_REG(19)
TEST_REG(20)
TEST_REG(21)
TEST_REG(22)
TEST_REG(23)
TEST_REG(24)
TEST_REG(25)
TEST_REG(26)
TEST_REG(27)
TEST_REG(28)
TEST_REG(29)
TEST_REG(30)
! through.
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
! Name:
! Function:
! Calling:
! Returns:
! Convention:
!--------------------------------------------------------------------------
.section ".data"
.align 8
.skip 8
.skip 8
#define TEST_REG_DP(reg_num) \
TEST_REG_DP(0)
TEST_REG_DP(2)
TEST_REG_DP(4)
TEST_REG_DP(6)
TEST_REG_DP(8)
TEST_REG_DP(10)
TEST_REG_DP(12)
TEST_REG_DP(14)
TEST_REG_DP(16)
TEST_REG_DP(18)
TEST_REG_DP(20)
TEST_REG_DP(22)
TEST_REG_DP(24)
TEST_REG_DP(26)
TEST_REG_DP(28)
TEST_REG_DP(30)
TEST_REG_DP(32)
TEST_REG_DP(34)
TEST_REG_DP(36)
TEST_REG_DP(38)
TEST_REG_DP(40)
TEST_REG_DP(42)
TEST_REG_DP(44)
TEST_REG_DP(46)
TEST_REG_DP(48)
TEST_REG_DP(50)
TEST_REG_DP(52)
TEST_REG_DP(54)
TEST_REG_DP(56)
TEST_REG_DP(58)
TEST_REG_DP(60)
! through.
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!--------------------------------------------------------------------------
.section ".data"
.align 4
.Lmvrg:
.skip 4
.Lmvrg1:
.skip 4
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!--------------------------------------------------------------------------
.section ".data"
.align 8
.Lmvrg_dp:
.skip 8
.skip 8
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
! Name:
! Function:
! Calling:
! Returns:
! Convention:
!--------------------------------------------------------------------------
!
!
! = 1 = error
!
.section ".data"
.align 8
.Lbr:
.skip 8
.Lbr1:
.skip 8
!
!void read_fpreg(pf, n)
! unsigned n; /* Want to read register n. */
!
!{
! *pf = %f[n];
!}
#define STOREFP(n) st %f/**/n, [%i0]; ret; restore
stable:
STOREFP(0)
STOREFP(1)
STOREFP(2)
STOREFP(3)
STOREFP(4)
STOREFP(5)
STOREFP(6)
STOREFP(7)
STOREFP(8)
STOREFP(9)
STOREFP(10)
STOREFP(11)
STOREFP(12)
STOREFP(13)
STOREFP(14)
STOREFP(15)
STOREFP(16)
STOREFP(17)
STOREFP(18)
STOREFP(19)
STOREFP(20)
STOREFP(21)
STOREFP(22)
STOREFP(23)
STOREFP(24)
STOREFP(25)
STOREFP(26)
STOREFP(27)
STOREFP(28)
STOREFP(29)
STOREFP(30)
STOREFP(31)
SET_SIZE(read_fpreg)
ENTRY_NP(read_fpreg_dp)
save %sp, -SA(MINFRAME), %sp
mulx %i1, 6, %i1 ! Table entries are 12 bytes each.
! But o1 will have even numbered
! index
setn stable_dp, %l0, %g1 ! g1 gets base of table.
jmp %g1 + %i1 ! Jump into table
STOREFP_DP(0)
STOREFP_DP(2)
STOREFP_DP(4)
STOREFP_DP(6)
STOREFP_DP(8)
STOREFP_DP(10)
STOREFP_DP(12)
STOREFP_DP(14)
STOREFP_DP(16)
STOREFP_DP(18)
STOREFP_DP(20)
STOREFP_DP(22)
STOREFP_DP(24)
STOREFP_DP(26)
STOREFP_DP(28)
STOREFP_DP(30)
STOREFP_DP(32)
STOREFP_DP(34)
STOREFP_DP(36)
STOREFP_DP(38)
STOREFP_DP(40)
STOREFP_DP(42)
STOREFP_DP(44)
STOREFP_DP(46)
STOREFP_DP(48)
STOREFP_DP(50)
STOREFP_DP(52)
STOREFP_DP(54)
STOREFP_DP(56)
STOREFP_DP(58)
STOREFP_DP(60)
STOREFP_DP(62)
!
!void
!write_fpreg(pf, n)
! unsigned n; /* Want to read register n. */
!
!{
! %f[n] = *pf;
!}
#define LOADFP(n) jmp %o7+8 ; ld [%o0],%f/**/n
ltable:
LOADFP(0)
LOADFP(1)
LOADFP(2)
LOADFP(3)
LOADFP(4)
LOADFP(5)
LOADFP(6)
LOADFP(7)
LOADFP(8)
LOADFP(9)
LOADFP(10)
LOADFP(11)
LOADFP(12)
LOADFP(13)
LOADFP(14)
LOADFP(15)
LOADFP(16)
LOADFP(17)
LOADFP(18)
LOADFP(19)
LOADFP(20)
LOADFP(21)
LOADFP(22)
LOADFP(23)
LOADFP(24)
LOADFP(25)
LOADFP(26)
LOADFP(27)
LOADFP(28)
LOADFP(29)
LOADFP(30)
LOADFP(31)
SET_SIZE(write_fpreg)