* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: fp_ieee_flags_n2.s
* Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
* 4150 Network Circle, Santa Clara, California 95054, U.S.A.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* For the avoidance of doubt, and except that if any non-GPL license
* choice is available it will apply instead, Sun elects to use only
* the General Public License version 2 (GPLv2) at this time for any
* software where a choice of GPL license versions is made
* available with the language indicating that GPLv2 or any later version
* may be used, or where a choice of which version of the GPL is applied is
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* ========== Copyright Header End ============================================
#define H_T0_Fp_exception_ieee_754_0x21 T0_Fp_exception_ieee_754
#define H_T0_Fp_exception_other_0x22 T0_Fp_exception_other
#define ENABLE_T0_Fp_disabled_0x20
.global sam_fast_immu_miss
.global sam_fast_dmmu_miss
wr %g0, 0x4, %fprs /* make sure fef is 1 */
setx fsr_tem_en, %l0, %l3 ! fsr tem enable value
/*******************************************************
*******************************************************/
! By default, mask is disabled
ld [%l3+0x0], %fsr ! Read it from memory - trap disabled
setx data1, %l0, %l2 ! Some data
setx ddata1, %l0, %l2 ! Double precision boundaries
ldd [%l2+0x10], %f4 ! -1.0
ldd [%l2+0x18], %f6 ! -0.0
setx newdata, %l0, %l6 ! Double precision data
ldd [%l6+%g0], %f0 ! double precision
ldd [%l6+%g4], %f2 ! double precision
ldd [%l6+%g4], %f4 ! double precision
ldd [%l6+%g4], %f6 ! double precision
ldd [%l6+%g4], %f8 ! double precision
ldd [%l6+%g4], %f10 ! double precision
ldd [%l6+%g4], %f12 ! double precision
ldd [%l6+%g4], %f14 ! double precision
ldd [%l6+%g4], %f16 ! double precision
ldd [%l6+%g4], %f18 ! double precision
ldd [%l6+%g4], %f20 ! double precision
set 0x25, %g6 ! Max loop count rd
set 0x30, %g1 ! Max loop count
set 0x0, %g7 ! loop iterator
fmuldiv_rd_loop0: ! Rounding mode loop
sll %g7, 0x2, %g5 ! Align address
ld [%l3+%g5], %fsr ! Read it from memory - trap disabled
bne,a fmuldiv_rd_loop0 ! If not 0, go to test more
/*******************************************************
*******************************************************/
/*******************************************************
*******************************************************/
.word 0x3f800000 ! 1.0 0x0
.word 0x00000000 ! 0.0 0x4
.word 0xbf800000 ! -1.0 0x8
.word 0x80000000 ! -0.0 0xc
.word 0x4f000000 ! Large positive number should cause NV on conversion 0x10
.word 0xcf000000 ! Large negative number should cause NV on conversion 0x14
.word 0x5f0ac723 ! Large positive number should cause NV on conversion 0x18
.word 0xdf0ac723 ! Large negative number should cause NV on conversion 0x1c
.word 0x807fffff ! Denormal number -ve
.word 0x80700000 ! Denormal number -ve
.word 0x803fffff ! Denormal number -ve
.word 0x80400000 ! Denormal number -ve
.word 0x80400001 ! Denormal number -ve
.word 0x80000001 ! Denormal number -ve
.word 0x80000001 ! Denormal number -ve
.word 0x007fffff ! Denormal number +ve
.word 0x007fffff ! Denormal number +ve
.word 0x00700000 ! Denormal number +ve
.word 0x003fffff ! Denormal number +ve
.word 0x00400000 ! Denormal number +ve
.word 0x00400001 ! Denormal number +ve
.word 0x00000001 ! Denormal number +ve
.word 0xff7fffff ! Normal
.word 0xff700000 ! Normal
.word 0xff7ffffe ! Normal
.word 0xff7aaaaa ! Normal
.word 0xff755555 ! Normal
.word 0xfe7fffff ! Normal
.word 0xfe700000 ! Normal
.word 0xfe7ffffe ! Normal
.word 0xfe7aaaaa ! Normal
.word 0xfe755555 ! Normal
.word 0x80ffffff ! Normal
.word 0x80f00000 ! Normal
.word 0x80c00001 ! Normal
.word 0x80c00000 ! Normal
.word 0x80800001 ! Normal
.word 0x80800000 ! Normal
.word 0x80800000 ! Normal
.word 0x00800000 ! Normal
.word 0x00800000 ! Normal
.word 0x00800001 ! Normal
.word 0x00c00000 ! Normal
.word 0x00c00001 ! Normal
.word 0x00f00000 ! Normal
.word 0x00ffffff ! Normal
.word 0x7e755555 ! Normal
.word 0x7e7aaaaa ! Normal
.word 0x7e7ffffe ! Normal
.word 0x7e700000 ! Normal
.word 0x7e7fffff ! Normal
.word 0x7f755555 ! Normal
.word 0x7f7aaaaa ! Normal
.word 0x7f7ffffe ! Normal
.word 0x7f700000 ! Normal
.word 0x7f7fffff ! Normal
.xword 0x3ff0000000000000 ! 1.0 0x0
.xword 0x0000000000000000 ! 0.0 0x8
.xword 0xbff0000000000000 ! -1.0 0x10
.xword 0x8000000000000000 ! -0.0 0x18
.xword 0x41e0000000000000 ! Large positive number should cause NV on conversion 0x20
.xword 0xc1e0000000000000 ! Large negative number should cause NV on conversion 0x28
.xword 0x43e158e460913d00 ! Large positive number should cause NV on conversion to int 0x30
.xword 0xc3e158e460913d00 ! Large negative number should cause NV on conversion to int 0x38
.xword 0x800fffffffffffff ! Denormal number -ve
.xword 0x800f000000000000 ! Denormal number -ve
.xword 0x8007ffffffffffff ! Denormal number -ve
.xword 0x8008000000000000 ! Denormal number -ve
.xword 0x8008000000000001 ! Denormal number -ve
.xword 0x8000000000000001 ! Denormal number -ve
.xword 0x8000000000000001 ! Denormal number -ve
.xword 0x000fffffffffffff ! Denormal number +ve
.xword 0x000fffffffffffff ! Denormal number +ve
.xword 0x000f000000000000 ! Denormal number +ve
.xword 0x0007ffffffffffff ! Denormal number +ve
.xword 0x0008000000000000 ! Denormal number +ve
.xword 0x0008000000000001 ! Denormal number +ve
.xword 0x0000000000000001 ! Denormal number +ve
.xword 0xffefffffffffffff ! Normal
.xword 0xffef000000000000 ! Normal
.xword 0xffeffffffffffffe ! Normal
.xword 0xffeaaaaaaaaaaaaa ! Normal
.xword 0xffe5555555555555 ! Normal
.xword 0xffcfffffffffffff ! Normal
.xword 0xffcf000000000000 ! Normal
.xword 0xffcffffffffffffe ! Normal
.xword 0xffcaaaaaaaaaaaaa ! Normal
.xword 0xffc5555555555555 ! Normal
.xword 0x801fffffffffffff ! Normal
.xword 0x801f000000000000 ! Normal
.xword 0x8018000000000001 ! Normal
.xword 0x8018000000000000 ! Normal
.xword 0x8010000000000001 ! Normal
.xword 0x8010000000000000 ! Normal
.xword 0x8010000000000000 ! Normal
.xword 0x0010000000000000 ! Normal
.xword 0x0010000000000000 ! Normal
.xword 0x0010000000000001 ! Normal
.xword 0x0018000000000000 ! Normal
.xword 0x0018000000000001 ! Normal
.xword 0x001f000000000000 ! Normal
.xword 0x001fffffffffffff ! Normal
.xword 0x7fc5555555555555 ! Normal
.xword 0x7fcaaaaaaaaaaaaa ! Normal
.xword 0x7fcffffffffffffe ! Normal
.xword 0x7fc7000000000000 ! Normal
.xword 0x7fc7ffffffffffff ! Normal
.xword 0x7fe5555555555555 ! Normal
.xword 0x7fe5aaaaaaaaaaaa ! Normal
.xword 0x7feffffffffffffe ! Normal
.xword 0x7fef000000000000 ! Normal
.xword 0x7fefffffffffffff ! Normal
.xword 0x0000000000000000 ! 0
.xword 0x0000000000000001 ! 1
.xword 0x7fffffffffffffff !
.xword 0xffffffffffffffff !
.xword 0xaaaaaaaaaaaaaaaa ! 0
.xword 0x5555555555555555 ! 1
.xword 0x4000000000000000 !
.xword 0x8000000000000000 !
.word 0x0f800000 ! TEM - all enabled - rd 0
.word 0x4f800000 ! TEM - all enabled - rd 1
.word 0x8f800000 ! TEM - all enabled - rd 2
.word 0xcf800000 ! TEM - all enabled - rd 3
.word 0x00000000 ! TEM - walk through all values
.xword 0x3fffffffffffffff ! f0
.xword 0x7ff0000000000001 ! f2
.xword 0x0000000000000000 ! f4
.xword 0x7fe0000000000000 ! f6
.xword 0x7fe0000000000000 ! f8
.xword 0x0000000000000001 ! f10
.xword 0x0000000000000001 ! f12
.xword 0x0000000000000000 ! f14
.xword 0x380fffffffffffff ! f16
.xword 0x3ff0000000000001 ! f18
.xword 0x0000000000000000 ! f20
.word 0x00000000 ! TEM - all disabled
.word 0x40000000 ! TEM - all disabled
.word 0x80000000 ! TEM - all disabled
.word 0xc0000000 ! TEM - all disabled
/*******************************************************
*******************************************************/
.global T0_Fp_exception_ieee_754
.global T0_Fp_exception_other
T0_Fp_exception_ieee_754:
setx scratch, %l0, %l5 ! scratch
ldx [%l5+0x0], %fsr ! Need to test the sync operation
setx scratch, %l0, %l5 ! scratch
ldx [%l5+0x0], %fsr ! Need to test the sync operation