|
|
1.1.1.2 root 1: !
2: ! SPARC assembler primitives for rsalib.c
3: ! written by Branko Lankester, [email protected] 8/29/91
4: !
5: ! Tested with gcc 1.39 and newer, and SunOS cc.
6: ! NOTE: does not work with gcc 1.37 (and older?)
7: !
8: ! other sources must be compiled with UNIT32 and HIGHFIRST defined
9: !
1.1.1.3 root 10: #ifndef SYSV
11: #ifdef __STDC__
1.1.1.4 ! root 12: #define ENTRY(name) _##name ; _##name##:
1.1.1.3 root 13: #else
1.1.1.4 ! root 14: #define ENTRY(name) _/**/name ; _/**/name/**/:
1.1.1.3 root 15: #endif
16: #define GLOB _global_precision
17: #else /* SYSV */
1.1.1.4 ! root 18: #define ENTRY(name) name ; name:
1.1.1.3 root 19: #define GLOB global_precision
20: #endif
21:
1.1.1.2 root 22: .seg "text"
23: .proc 4
1.1.1.4 ! root 24: .global ENTRY(P_SETP)
1.1.1.2 root 25: retl
26: nop
27:
28:
29: .proc 4
1.1.1.4 ! root 30: .global ENTRY(P_ADDC)
1.1.1.3 root 31: sethi %hi(GLOB), %o3
32: ldsh [%o3+%lo(GLOB)], %o3
1.1.1.2 root 33: and %o2, 1, %o2
34: dec %o3
35: sll %o3, 2, %o3
36: ld [%o0+%o3], %o4
37: add_loop:
38: ld [%o1+%o3], %o5
39: subcc %g0, %o2, %g0
40: addxcc %o4, %o5, %o4
41: addx %g0, %g0, %o2
42: st %o4, [%o0+%o3]
43: subcc %o3, 4, %o3
44: bge,a add_loop
45: ld [%o0+%o3], %o4
46: retl
47: mov %o2, %o0 ! return carry
48:
49:
50: .proc 4
1.1.1.4 ! root 51: .global ENTRY(P_SUBB)
1.1.1.3 root 52: sethi %hi(GLOB), %o3
53: ldsh [%o3+%lo(GLOB)], %o3
1.1.1.2 root 54: and %o2, 1, %o2
55: dec %o3
56: sll %o3, 2, %o3
57: ld [%o0+%o3], %o4
58: sub_loop:
59: ld [%o1+%o3], %o5
60: subcc %g0, %o2, %g0
61: subxcc %o4, %o5, %o4
62: addx %g0, %g0, %o2
63: st %o4, [%o0+%o3]
64: subcc %o3, 4, %o3
65: bge,a sub_loop
66: ld [%o0+%o3], %o4
67: retl
68: mov %o2, %o0
69:
70:
71: .proc 4
1.1.1.4 ! root 72: .global ENTRY(P_ROTL)
1.1.1.3 root 73: sethi %hi(GLOB), %o3
74: ldsh [%o3+%lo(GLOB)], %o3
1.1.1.2 root 75: and %o1, 1, %o1
76: dec %o3
77: sll %o3, 2, %o3
78: ld [%o0+%o3], %o4
79: rot_loop:
80: sll %o4, 1, %o5
81: or %o5, %o1, %o5
82: st %o5, [%o0+%o3]
83: srl %o4, 31, %o1
84: subcc %o3, 4, %o3
85: bge,a rot_loop
86: ld [%o0+%o3], %o4
87: retl
88: mov %o1, %o0
89:
90: .seg "data"
91:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.