Skip to content

Commit 5c8c07d

Browse files
committed
More partial arith translations
1 parent 8f0c944 commit 5c8c07d

File tree

7 files changed

+105
-100
lines changed

7 files changed

+105
-100
lines changed

src/ari_asm_arm.d

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
/* (c) Copyright 1994, 1997 P.J.Burwood
1+
/* -*- asm -*-
2+
(c) Copyright 1994, 1997 P.J.Burwood
23
bugfixes (c) Copyright 1996 B. Haible
3-
external routines for arilev1.d
4+
External routines for arilev1.d
45
Processor: ARM in APCS mode
56
Assembler-Syntax: GAS
67
Parameter passing conventions, per APCS:

src/ari_asm_hppa.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/*
2-
* External routines for ARILEV1.D
1+
/* -*- asm -*-
2+
* External routines for arilev1.d
33
* Processor: HPPA, because of XMPYU only on HPPA 1.1 (like HP9000/720)
44
* Compiler: GNU-C or HP-C
55
* Parameter passing conventions:

src/ari_asm_sparc.d

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
# Externe Routinen zu ARILEV1.D
2-
# Prozessor: SPARC
3-
# Compiler: GNU-C oder SUN-C
4-
# Parameter passing conventions:
5-
# Argument registers:
6-
# %o0..%o5
7-
# Return value register:
8-
# %o0 for a single word; %o0 (high 32 bits), %o1 (low 32 bits) for a 'long long'.
9-
# Call-used registers (do not have to be preserved across function calls):
10-
# %o0..%o5, %g1..%g5
11-
# Global register usage:
12-
# see gcc-5.4.0/gcc/config/sparc/sparc.h comment before CALL_USED_REGISTERS.
13-
# Settings: intCsize=32, intDsize=32.
1+
/* -*- asm -*-
2+
* External routines for arilev1.d
3+
* Prozessor: SPARC
4+
* Compiler: GNU-C oder SUN-C
5+
* Parameter passing conventions:
6+
* Argument registers:
7+
* %o0..%o5
8+
* Return value register:
9+
* %o0 for a single word; %o0 (high 32 bits), %o1 (low 32 bits) for a 'long long'.
10+
* Call-used registers (do not have to be preserved across function calls):
11+
* %o0..%o5, %g1..%g5
12+
* Global register usage:
13+
* see gcc-5.4.0/gcc/config/sparc/sparc.h comment before CALL_USED_REGISTERS.
14+
* Settings: intCsize=32, intDsize=32.
15+
*/
1416

1517
#ifdef INCLUDED_FROM_C
1618

src/ari_asm_sparc64.d

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
# Externe Routinen zu ARILEV1.D
2-
# Prozessor: SPARC 64-bit
3-
# Compiler: GNU-C oder ...
4-
# Parameter passing conventions:
5-
# Argument registers:
6-
# %o0..%o5
7-
# Arguments of type uint8, uint16, uint32 have already been converted to
8-
# uint64 by the caller (zero-extend, "srl reg,0,reg").
9-
# Arguments of type sint8, sint16, sint32 have already been converted to
10-
# sint64 by the caller (sign-extend, "sra reg,0,reg").
11-
# Return value register:
12-
# %o0
13-
# Return values of type uint8, uint16, uint32 must be converted to uint64
14-
# before returning (zero-extend, "srl %o0,0,%o0").
15-
# Return values of type sint8, sint16, sint32 must be converted to sint64
16-
# before returning (sign-extend, "sra %o0,0,%o0").
17-
# Call-used registers (do not have to be preserved across function calls):
18-
# %o0..%o5, %g1..%g5
19-
# Global register usage:
20-
# see gcc-5.4.0/gcc/config/sparc/sparc.h comment before CALL_USED_REGISTERS.
21-
# Settings: intCsize=32, intDsize=32.
1+
/* -*- asm -*-
2+
* External routines for arilev1.d
3+
* Prozessor: SPARC 64-bit
4+
* Compiler: GNU-C compatible
5+
* Parameter passing conventions:
6+
* Argument registers:
7+
* %o0..%o5
8+
* Arguments of type uint8, uint16, uint32 have already been converted to
9+
* uint64 by the caller (zero-extend, "srl reg,0,reg").
10+
* Arguments of type sint8, sint16, sint32 have already been converted to
11+
* sint64 by the caller (sign-extend, "sra reg,0,reg").
12+
* Return value register:
13+
* %o0
14+
* Return values of type uint8, uint16, uint32 must be converted to uint64
15+
* before returning (zero-extend, "srl %o0,0,%o0").
16+
* Return values of type sint8, sint16, sint32 must be converted to sint64
17+
* before returning (sign-extend, "sra %o0,0,%o0").
18+
* Call-used registers (do not have to be preserved across function calls):
19+
* %o0..%o5, %g1..%g5
20+
* Global register usage:
21+
* see gcc-5.4.0/gcc/config/sparc/sparc.h comment before CALL_USED_REGISTERS.
22+
* Settings: intCsize=32, intDsize=32.
23+
*/
2224

2325
#ifdef INCLUDED_FROM_C
2426

src/arilev0.d

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Arithmetik, Level 0
2-
# operiert auf einzelnen 16-Bit-Wörtern und 32-Bit-Wörtern (unsigned).
1+
# Arithmetic, Level 0
2+
# works with 16-bit words and unsigned 32-bit words.
33

4-
# Vorzeichen einer 32-Bit-Zahl bestimmen
4+
# Get sign of a 32-bit int
55
# sign_of_sint32(value)
6-
# > value: eine 32-Bit-Zahl
7-
# < sint16 result: 0 falls value>=0, -1 falls value<0.
6+
# > value: sint32
7+
# < sint16 result: 0 if value>=0, -1 if value<0.
88
extern sint16 sign_of_sint32 (sint32 value);
99
#if defined(SPARC64)
1010
#define sign_of_sint32(value) (((sint64)(sint32)(value)) >> 63)
@@ -14,10 +14,10 @@
1414
#define sign_of_sint32(value) ((sint32)(value) >= 0 ? 0 : -1)
1515
#endif
1616

17-
# Vorzeichen einer 16-Bit-Zahl bestimmen
17+
# Get sign of a sint16
1818
# sign_of_sint16(value)
19-
# > value: eine 16-Bit-Zahl
20-
# < sint16 result: 0 falls value>=0, -1 falls value<0.
19+
# > value: sint16
20+
# < sint16 result: 0 if value>=0, -1 if value<0.
2121
extern sint16 sign_of_sint16 (sint16 value);
2222
#if defined(SPARC64)
2323
#define sign_of_sint16(value) (((sint64)(sint16)(value)) >> 63)
@@ -27,12 +27,12 @@
2727
#define sign_of_sint16(value) ((sint16)(value) >= 0 ? 0 : -1)
2828
#endif
2929

30-
# High-Word einer 32-Bit-Zahl bestimmen
30+
# Get high-word of a uint32
3131
# high16(value)
3232
extern uint16 high16 (uint32 value);
3333
#define high16(value) ((uint16)((uint32)(value)>>16))
3434

35-
# Low-Word einer 32-Bit-Zahl bestimmen
35+
# Get low-word of a uint32
3636
# low16(value)
3737
extern uint16 low16 (uint32 value);
3838
#define low16(value) ((uint16)(uint32)(value))

src/arilev1c.d

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Definitionen und portabler C-Code zu ARILEV1.D
1+
# Definitions and portable C-code for arilev1.d
22

3-
# Kopierschleife:
3+
# copying loop:
44
# destptr = copy_loop_up(sourceptr,destptr,count);
55
# kopiert count (uintC>=0) Digits aufwärts von sourceptr nach destptr
66
# und liefert das neue destptr.
@@ -12,7 +12,7 @@
1212
return destptr;
1313
}
1414

15-
# Kopierschleife:
15+
# copying loop:
1616
# destptr = copy_loop_down(sourceptr,destptr,count);
1717
# kopiert count (uintC>=0) Digits abwärts von sourceptr nach destptr
1818
# und liefert das neue destptr.
@@ -24,7 +24,7 @@
2424
return destptr;
2525
}
2626

27-
# Füllschleife:
27+
# fill loop:
2828
# destptr = fill_loop_up(destptr,count,filler);
2929
# kopiert count (uintC>=0) mal das Digit filler aufwärts nach destptr
3030
# und liefert das neue destptr.
@@ -36,7 +36,7 @@
3636
return destptr;
3737
}
3838

39-
# Füllschleife:
39+
# fill loop:
4040
# destptr = fill_loop_down(destptr,count,filler);
4141
# kopiert count (uintC>=0) mal das Digit filler abwärts nach destptr
4242
# und liefert das neue destptr.
@@ -48,7 +48,7 @@
4848
return destptr;
4949
}
5050

51-
# Lösch-Schleife:
51+
# clear loop:
5252
# destptr = clear_loop_up(destptr,count);
5353
# löscht count (uintC>=0) Digits aufwärts ab destptr
5454
# und liefert das neue destptr.
@@ -60,7 +60,7 @@
6060
return destptr;
6161
}
6262

63-
# Lösch-Schleife:
63+
# clear loop:
6464
# destptr = clear_loop_down(destptr,count);
6565
# löscht count (uintC>=0) Digits abwärts ab destptr
6666
# und liefert das neue destptr.
@@ -72,7 +72,7 @@
7272
return destptr;
7373
}
7474

75-
# OR-Schleife:
75+
# OR loop:
7676
# or_loop_up(xptr,yptr,count);
7777
# verknüpft count (uintC>=0) Digits aufwärts ab xptr und ab yptr
7878
# mit Ziel ab xptr durch OR.
@@ -83,7 +83,7 @@
8383
}
8484
}
8585

86-
# XOR-Schleife:
86+
# XOR loop:
8787
# xor_loop_up(xptr,yptr,count);
8888
# verknüpft count (uintC>=0) Digits aufwärts ab xptr und ab yptr
8989
# mit Ziel ab xptr durch XOR.
@@ -94,7 +94,7 @@
9494
}
9595
}
9696

97-
# AND-Schleife:
97+
# AND loop:
9898
# and_loop_up(xptr,yptr,count);
9999
# verknüpft count (uintC>=0) Digits aufwärts ab xptr und ab yptr
100100
# mit Ziel ab xptr durch AND.
@@ -105,7 +105,7 @@
105105
}
106106
}
107107

108-
# EQV-Schleife:
108+
# EQV loop:
109109
# eqv_loop_up(xptr,yptr,count);
110110
# verknüpft count (uintC>=0) Digits aufwärts ab xptr und ab yptr
111111
# mit Ziel ab xptr durch EQV (NOT XOR).
@@ -118,7 +118,7 @@
118118
}
119119
}
120120

121-
# NAND-Schleife:
121+
# NAND loop:
122122
# nand_loop_up(xptr,yptr,count);
123123
# verknüpft count (uintC>=0) Digits aufwärts ab xptr und ab yptr
124124
# mit Ziel ab xptr durch NAND (NOT AND).
@@ -131,7 +131,7 @@
131131
}
132132
}
133133

134-
# NOR-Schleife:
134+
# NOR loop:
135135
# nor_loop_up(xptr,yptr,count);
136136
# verknüpft count (uintC>=0) Digits aufwärts ab xptr und ab yptr
137137
# mit Ziel ab xptr durch NOR (NOT OR).
@@ -144,7 +144,7 @@
144144
}
145145
}
146146

147-
# ANDC2-Schleife:
147+
# ANDC2 loop:
148148
# andc2_loop_up(xptr,yptr,count);
149149
# verknüpft count (uintC>=0) Digits aufwärts ab xptr und ab yptr
150150
# mit Ziel ab xptr durch ANDC2 (AND NOT).
@@ -155,7 +155,7 @@
155155
}
156156
}
157157

158-
# ORC2-Schleife:
158+
# ORC2 loop:
159159
# orc2_loop_up(xptr,yptr,count);
160160
# verknüpft count (uintC>=0) Digits aufwärts ab xptr und ab yptr
161161
# mit Ziel ab xptr durch ORC2 (OR NOT).
@@ -166,7 +166,7 @@
166166
}
167167
}
168168

169-
# NOT-Schleife:
169+
# NOT loop:
170170
# not_loop_up(xptr,count);
171171
# verknüpft count (uintC>0) Digits aufwärts ab xptr mit Ziel ab xptr
172172
# durch NOT.
@@ -179,7 +179,7 @@
179179
} while (count != 0);
180180
}
181181

182-
# AND-Test-Schleife:
182+
# AND-Test loop:
183183
# and_test_loop_up(xptr,yptr,count);
184184
# verknüpft count (uintC>=0) Digits aufwärts ab xptr und ab yptr durch AND
185185
# und testet, ob sich dabei ein Digit /=0 ergibt. Ergebnis /=0, falls ja.
@@ -193,7 +193,7 @@
193193
return false;
194194
}
195195

196-
# Test-Schleife:
196+
# Test loop:
197197
# test_loop_up(ptr,count)
198198
# testet count (uintC>=0) Digits aufwärts ab ptr, ob darunter eines /=0 ist.
199199
# Ergebnis /=0, falls ja.
@@ -587,7 +587,7 @@
587587
#endif
588588
}
589589
590-
# Schiebe- und Kopier-Schleife um i Bits nach rechts:
590+
# Move and copy loop by i bits to the right:
591591
# übertrag = shiftrightcopy_loop_up(sourceptr,destptr,count,i,carry);
592592
# kopiert count (uintC>=0) Digits aufwärts von sourceptr nach destptr
593593
# und schiebt sie dabei um i Bits (0<i<intDsize) nach rechts, wobei carry

0 commit comments

Comments
 (0)