Annotation of OpenXM_contrib/pari/src/kernel/sparcv8/level0_sparcv8_micro.S, Revision 1.1
1.1 ! maekawa 1: /* $Id: level0_sparcv8_micro.S,v 1.1.1.1 1999/09/16 13:47:58 karim Exp $ */
! 2:
! 3: /* This file defines some "level 0" kernel functions for SPARC V8 */
! 4: /* These are optimised for MicroSparc */
! 5: /* The following symbols are defined in this file : */
! 6: /* divll bfffo (& tabshi) */
! 7: /* But divll has to use hiremainder, so it is different when */
! 8: /* hiremainder is inline or not */
! 9: /* If libpari.so is compiled with gcc, you should compile all */
! 10: /* files with gcc */
! 11:
! 12: #if defined(NO_UNDERSCORE) || defined(linux)
! 13: # define C(entrypoint) entrypoint
! 14: #elif defined(sun) || defined(NeXT)
! 15: # ifdef __STDC__
! 16: # define C(entrypoint) _##entrypoint
! 17: # else
! 18: # define C(entrypoint) _/**/entrypoint
! 19: # endif
! 20: #endif
! 21: #if defined(sun) || defined(linux)
! 22: # define GLOBL .global
! 23: #elif defined(NeXT)
! 24: # define GLOBL .globl
! 25: #endif
! 26:
! 27: #if defined(sun) || defined(linux)
! 28: .seg "data"
! 29: .align 4
! 30: C(tabshi): .word 4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0
! 31:
! 32: .seg "text"
! 33: #elif defined(NeXT)
! 34: .data
! 35: .align 3
! 36: C(tabshi):
! 37: .long 4
! 38: .long 3
! 39: .long 2
! 40: .long 2
! 41: .long 1
! 42: .long 1
! 43: .long 1
! 44: .long 1
! 45: .long 0
! 46: .long 0
! 47: .long 0
! 48: .long 0
! 49: .long 0
! 50: .long 0
! 51: .long 0
! 52: .long 0
! 53:
! 54: .text
! 55: .align 2
! 56: #endif
! 57: GLOBL C(bfffo),C(divll)
! 58:
! 59: C(bfffo): sethi %hi(0xffff0000),%o1
! 60: andcc %o1,%o0,%g0
! 61: bnz,a 1f
! 62: clr %o2
! 63: sll %o0,16,%o0
! 64: mov 16,%o2
! 65: 1: sethi %hi(0xff000000),%o1
! 66: andcc %o1,%o0,%g0
! 67: bnz 2f
! 68: sethi %hi(0xf0000000),%o1
! 69: sll %o0,8,%o0
! 70: add %o2,8,%o2
! 71: 2: andcc %o1,%o0,%g0
! 72: bnz,a 3f
! 73: srl %o0,28,%o0
! 74: add %o2,4,%o2
! 75: srl %o0,24,%o0
! 76: 3: set C(tabshi),%o3
! 77: sll %o0,2,%o0
! 78: ld [%o3+%o0],%o1
! 79: retl
! 80: add %o2,%o1,%o0
! 81:
! 82: #ifdef __GNUC__
! 83: C(divll): wr %g5,%g0,%y
! 84: #else /* ! __GNUC__ */
! 85: C(divll): sethi %hi(C(hiremainder)),%o4
! 86: ld [%o4+%lo(C(hiremainder))],%o2
! 87: wr %o2,%g0,%y
! 88: #endif
! 89: mov %o0,%o3
! 90: nop
! 91: nop
! 92: udivcc %o0,%o1,%o0
! 93: bvc 1f
! 94: umul %o0,%o1,%o5
! 95: mov 0x2f,%o0
! 96: call C(pari_err),1
! 97: nop
! 98: #ifdef __GNUC__
! 99: 1: retl
! 100: sub %o3,%o5,%g5
! 101: #else /* ! __GNUC__ */
! 102: 1: subcc %o3,%o5,%o2
! 103: retl
! 104: st %o2,[%o4+%lo(C(hiremainder))]
! 105: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>