Annotation of OpenXM_contrib/pari-2.2/src/kernel/sparcv8/level0.S, Revision 1.1.1.1
1.1 noro 1: /* $Id: level0.S,v 1.2 2000/11/03 21:00:26 karim Exp $
2:
3: Copyright (C) 2000 The PARI group.
4:
5: This file is part of the PARI/GP package.
6:
7: PARI/GP is free software; you can redistribute it and/or modify it under the
8: terms of the GNU General Public License as published by the Free Software
9: Foundation. It is distributed in the hope that it will be useful, but WITHOUT
10: ANY WARRANTY WHATSOEVER.
11:
12: Check the License for details. You should have received a copy of it, along
13: with the package; see the file 'COPYING'. If not, write to the Free Software
14: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
15:
16: /* This file defines some "level 0" kernel functions for SPARC V8 */
17: /* With gcc, those symbols are inline and defined in level0.h */
18: /* overflow hiremainder */
19: /* addll addllx subll subllx shiftl shiftlr mulll addmul */
20:
21: #ifndef __GNUC__
22: #if defined(NO_UNDERSCORE) || defined(linux)
23: # define C(entrypoint) entrypoint
24: #elif defined(sun) || defined(NeXT)
25: # ifdef __STDC__
26: # define C(entrypoint) _##entrypoint
27: # else
28: # define C(entrypoint) _/**/entrypoint
29: # endif
30: #endif
31: #if defined(sun) || defined(linux)
32: # define GLOBL .global
33: #elif defined(NeXT)
34: # define GLOBL .globl
35: #endif
36:
37: #if defined(sun) || defined(linux)
38: .seg "text"
39: #elif defined(NeXT)
40: .text
41: .align 2
42: #endif
43: GLOBL C(addll),C(subll),C(addllx),C(subllx)
44: GLOBL C(shiftl),C(shiftlr),C(shiftl2),C(shiftlr1),C(shiftlr2)
45: GLOBL C(mulll),C(overflow),C(hiremainder),C(addmul)
46:
47: C(addll): sethi %hi(C(overflow)),%o3
48: addcc %o0,%o1,%o0
49: addx %g0,%g0,%o2
50: retl
51: st %o2,[%o3+%lo(C(overflow))]
52: C(subll): sethi %hi(C(overflow)),%o3
53: subcc %o0,%o1,%o0
54: addx %g0,%g0,%o2
55: retl
56: st %o2,[%o3+%lo(C(overflow))]
57: C(addllx): sethi %hi(C(overflow)),%o3
58: ld [%o3+%lo(C(overflow))],%o2
59: subcc %g0,%o2,%g0
60: addxcc %o0,%o1,%o0
61: addx %g0,%g0,%o2
62: retl
63: st %o2,[%o3+%lo(C(overflow))]
64: C(subllx): sethi %hi(C(overflow)),%o3
65: ld [%o3+%lo(C(overflow))],%o2
66: subcc %g0,%o2,%g0
67: subxcc %o0,%o1,%o0
68: addx %g0,%g0,%o2
69: retl
70: st %o2,[%o3+%lo(C(overflow))]
71: C(shiftl): sethi %hi(C(hiremainder)),%o3
72: neg %o1,%o4
73: srl %o0,%o4,%o2
74: st %o2,[%o3+%lo(C(hiremainder))]
75: retl
76: sll %o0,%o1,%o0
77: C(shiftl2): sethi %hi(C(hiremainder)),%o3
78: srl %o0,%o2,%o4
79: st %o4,[%o3+%lo(C(hiremainder))]
80: retl
81: sll %o0,%o1,%o0
82: C(shiftlr): sethi %hi(C(hiremainder)),%o3
83: neg %o1,%o4
84: sll %o0,%o4,%o2
85: st %o2,[%o3+%lo(C(hiremainder))]
86: retl
87: srl %o0,%o1,%o0
88: C(shiftlr1): sethi %hi(C(hiremainder)),%o3
89: sll %o0,31,%o2
90: st %o2,[%o3+%lo(C(hiremainder))]
91: retl
92: srl %o0,1,%o0
93: C(shiftlr2): sethi %hi(C(hiremainder)),%o3
94: sll %o0,%o2,%o4
95: st %o4,[%o3+%lo(C(hiremainder))]
96: retl
97: srl %o0,%o1,%o0
98:
99: C(mulll): umul %o0,%o1,%o0
100: sethi %hi(C(hiremainder)),%o3
101: rd %y,%o2
102: retl
103: st %o2,[%o3+%lo(C(hiremainder))]
104:
105: C(addmul): umul %o0,%o1,%o0
106: sethi %hi(C(hiremainder)),%o3
107: ld [%o3+%lo(C(hiremainder))],%o2
108: rd %y,%o4
109: addcc %o0,%o2,%o0
110: addx %g0,%o4,%o4
111: retl
112: st %o4,[%o3+%lo(C(hiremainder))]
113:
114: #if defined(sun) || defined(linux)
115: .seg "bss"
116: .align 4
117: C(hiremainder): .skip 4
118: C(overflow): .skip 4
119: #elif defined(NeXT)
120: .comm C(overflow),8
121: .comm C(hiremainder),8
122: #endif
123: #endif /* !defined(__GNUC__) */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>