* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: SS_Memory.s
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
* The above named 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 work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
* ========== Copyright Header End ============================================
/*============================================================================*\
* For AMD64 ABI documentation, visit http://www.x86-64.org
\*============================================================================*/
/*============================================================================*\
* uint8_t ss_ldstub( void* base, uint64_t ofs )
\*============================================================================*/
.type ss_ldstub, @function
.size ss_ldstub, [.-ss_ldstub]
/*============================================================================*\
* uint32_t ss_swap( uint32_t rd, void* base, uint64_t ofs )
\*============================================================================*/
.size ss_swap, [.-ss_swap]
/*============================================================================*\
* uint32_t ss_cas( uint32_t rd, void* base, uint32_t rs2 )
\*============================================================================*/
/*============================================================================*\
* uint64_t ss_casx( uint64_t rd, void* base, uint64_t rs2 )
\*============================================================================*/
.size ss_casx, [.-ss_casx]
/*============================================================================*\
* void ss_stp8( double rd, void* base, uint64_t mask )
* mask for byte 7 --------^^^^^^^^
* mask for byte 6 ---------+||||||
* mask for byte 5 ----------+|||||
* mask for byte 4 -----------+||||
* mask for byte 3 ------------+|||
* mask for byte 2 -------------+||
* mask for byte 1 --------------+|
* mask for byte 0 ---------------+
* mask for byte 7 --------^^^^^^^^
* mask for byte 6 ---------+||||||
* mask for byte 5 ----------+|||||
* mask for byte 4 -----------+||||
* mask for byte 3 ------------+|||
* mask for byte 2 -------------+||
* mask for byte 1 --------------+|
* mask for byte 0 ---------------+
\*============================================================================*/
bswapq %r8 /* byte swap the mask */
bswapq %r8 /* byte swap the data */
.size ss_stp8, [.-ss_stp8]
/*============================================================================*\
* uint16_t ss_byteswap16( uint16_t v )
\*============================================================================*/
.type ss_byteswap16, @function
.size ss_byteswap16, [.-ss_byteswap16]
/*============================================================================*\
* uint32_t ss_byteswap32( uint32_t v )
\*============================================================================*/
.type ss_byteswap32, @function
.size ss_byteswap32, [.-ss_byteswap32]
/*============================================================================*\
* uint64_t ss_byteswap64( uint64_t v )
\*============================================================================*/
.type ss_byteswap64, @function
.size ss_byteswap64, [.-ss_byteswap64]
/*============================================================================*\
* uint8_t ss_ldstub( void* base, uint64_t ofs )
\*============================================================================*/
.type ss_ldstub, #function
sllx %o1,32,%o1 ! ofs is o1:o2
#error "Need ARCH definition"
/*============================================================================*\
* uint32_t ss_swap( uint32_t rd, void* base, uint64_t ofs )
\*============================================================================*/
sllx %o2,32,%o2 ! ofs is o2:o3
#error "Need ARCH definition"
/*============================================================================*\
* uint32_t ss_cas( uint32_t rd, void* base, uint32_t rs2 )
\*============================================================================*/
/*============================================================================*\
* uint64_t ss_casx( uint64_t rd, void* base, uint64_t rs2 )
\*============================================================================*/
sllx %o0,32,%o0 ! rd is o0:o1
sllx %o3,32,%o3 ! rs2 is r3:o4
casxa [%o2]0x80,%o3,%o1 ! base is o2
srlx %o1,32,%o0 ! result is o0:o1
#error "Need ARCH definition"
/*============================================================================*\
* void ss_stp8( double rd, void* base, uint64_t mask )
* Handle partial store, mask is a bytemask (ASI used intrhe stda is 0xc0)
\*============================================================================*/
stda %f0,[%o1 + %o2]0xc0 ! f0 is double !! (o0:o1)
sllx %o3,32,%o3 ! mask is o3:o4
stda %f0,[%o2 + %o3]0xc0 ! f0 is double !! (o0:o1)
#error "Need ARCH definition"