Annotation of OpenXM_contrib/pari/src/kernel/sparcv8/level0.S, Revision 1.1.1.1
1.1 maekawa 1: /* $Id: level0.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: /* With gcc, those symbols are inline and defined in level0.h */
5: /* overflow hiremainder */
6: /* addll addllx subll subllx shiftl shiftlr mulll addmul */
7:
8: #ifndef __GNUC__
9: #if defined(NO_UNDERSCORE) || defined(linux)
10: # define C(entrypoint) entrypoint
11: #elif defined(sun) || defined(NeXT)
12: # ifdef __STDC__
13: # define C(entrypoint) _##entrypoint
14: # else
15: # define C(entrypoint) _/**/entrypoint
16: # endif
17: #endif
18: #if defined(sun) || defined(linux)
19: # define GLOBL .global
20: #elif defined(NeXT)
21: # define GLOBL .globl
22: #endif
23:
24: #if defined(sun) || defined(linux)
25: .seg "text"
26: #elif defined(NeXT)
27: .text
28: .align 2
29: #endif
30: GLOBL C(addll),C(subll),C(addllx),C(subllx)
31: GLOBL C(shiftl),C(shiftlr),C(shiftl2),C(shiftlr1),C(shiftlr2)
32: GLOBL C(mulll),C(overflow),C(hiremainder),C(addmul)
33:
34: C(addll): sethi %hi(C(overflow)),%o3
35: addcc %o0,%o1,%o0
36: addx %g0,%g0,%o2
37: retl
38: st %o2,[%o3+%lo(C(overflow))]
39: C(subll): sethi %hi(C(overflow)),%o3
40: subcc %o0,%o1,%o0
41: addx %g0,%g0,%o2
42: retl
43: st %o2,[%o3+%lo(C(overflow))]
44: C(addllx): sethi %hi(C(overflow)),%o3
45: ld [%o3+%lo(C(overflow))],%o2
46: subcc %g0,%o2,%g0
47: addxcc %o0,%o1,%o0
48: addx %g0,%g0,%o2
49: retl
50: st %o2,[%o3+%lo(C(overflow))]
51: C(subllx): sethi %hi(C(overflow)),%o3
52: ld [%o3+%lo(C(overflow))],%o2
53: subcc %g0,%o2,%g0
54: subxcc %o0,%o1,%o0
55: addx %g0,%g0,%o2
56: retl
57: st %o2,[%o3+%lo(C(overflow))]
58: C(shiftl): sethi %hi(C(hiremainder)),%o3
59: neg %o1,%o4
60: srl %o0,%o4,%o2
61: st %o2,[%o3+%lo(C(hiremainder))]
62: retl
63: sll %o0,%o1,%o0
64: C(shiftl2): sethi %hi(C(hiremainder)),%o3
65: srl %o0,%o2,%o4
66: st %o4,[%o3+%lo(C(hiremainder))]
67: retl
68: sll %o0,%o1,%o0
69: C(shiftlr): sethi %hi(C(hiremainder)),%o3
70: neg %o1,%o4
71: sll %o0,%o4,%o2
72: st %o2,[%o3+%lo(C(hiremainder))]
73: retl
74: srl %o0,%o1,%o0
75: C(shiftlr1): sethi %hi(C(hiremainder)),%o3
76: sll %o0,31,%o2
77: st %o2,[%o3+%lo(C(hiremainder))]
78: retl
79: srl %o0,1,%o0
80: C(shiftlr2): sethi %hi(C(hiremainder)),%o3
81: sll %o0,%o2,%o4
82: st %o4,[%o3+%lo(C(hiremainder))]
83: retl
84: srl %o0,%o1,%o0
85:
86: C(mulll): umul %o0,%o1,%o0
87: sethi %hi(C(hiremainder)),%o3
88: rd %y,%o2
89: retl
90: st %o2,[%o3+%lo(C(hiremainder))]
91:
92: C(addmul): umul %o0,%o1,%o0
93: sethi %hi(C(hiremainder)),%o3
94: ld [%o3+%lo(C(hiremainder))],%o2
95: rd %y,%o4
96: addcc %o0,%o2,%o0
97: addx %g0,%o4,%o4
98: retl
99: st %o4,[%o3+%lo(C(hiremainder))]
100:
101: #if defined(sun) || defined(linux)
102: .seg "bss"
103: .align 4
104: C(hiremainder): .skip 4
105: C(overflow): .skip 4
106: #elif defined(NeXT)
107: .comm C(overflow),8
108: .comm C(hiremainder),8
109: #endif
110: #endif /* !defined(__GNUC__) */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>