Commit | Line | Data |
---|---|---|
db0af6f7 JL |
1 | Return-Path: owner-egcs@cygnus.com Sun |
2 | Received: from cygnus.com (runyon.cygnus.com [205.180.230.5]) by hurl.cygnus.com with ESMTP (8.7.1/8.7.1) id RAA11988 for <law@hurl.cygnus.com>; Sun, 5 Oct 1997 17:27:27 -0600 (MDT) | |
3 | Received: (from majordom@localhost) | |
4 | by runyon.cygnus.com (8.8.7-cygnus/8.8.7) id QAA27817; | |
5 | Sun, 5 Oct 1997 16:16:45 -0700 (PDT) | |
6 | Received: from YALPH1.physics.yale.edu (hepvms1.physics.yale.edu [198.125.138.1]) | |
7 | by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id QAA27802; | |
8 | Sun, 5 Oct 1997 16:16:38 -0700 (PDT) | |
9 | Received: from hepunix2.physics.yale.edu by hepmail.physics.yale.edu | |
10 | (PMDF V5.1-8 #17719) | |
11 | with ESMTP id <01IOGJ0WO510CFQE02@hepmail.physics.yale.edu>; Sun, | |
12 | 5 Oct 1997 19:20:08 EDT | |
13 | Received: from hepunix1.physics.yale.edu by hepunix.physics.yale.edu | |
14 | (PMDF V5.1-5 #17721) with SMTP id <0EHLPVM0N00788@hepunix.physics.yale.edu>; | |
15 | Sun, 05 Oct 1997 19:14:13 -0400 (EDT) | |
16 | Date: Sun, 05 Oct 1997 19:14:09 -0400 (EDT) | |
17 | From: Weiwen Liu <liu@hepvms.physics.yale.edu> | |
18 | Subject: Re: complex support on alpha | |
19 | In-reply-to: <199710020532.WAA16123@dot.cygnus.com> | |
20 | X-Sender: liu@hepunix1.physics.yale.edu | |
21 | To: rth@cygnus.com | |
22 | Cc: egcs@cygnus.com | |
23 | Message-id: <Pine.OSF.3.96.971005190110.31383A-100000@hepunix1.physics.yale.edu> | |
24 | MIME-version: 1.0 | |
25 | Content-type: TEXT/PLAIN; charset=US-ASCII | |
26 | Sender: owner-egcs@cygnus.com | |
27 | Precedence: bulk | |
28 | ||
29 | On Wed, 1 Oct 1997, Richard Henderson wrote: | |
30 | ||
31 | > Well, it is enough to compile those examples properly, but it is | |
32 | > not completely correct. The problem is that complex numbers should | |
33 | > be treated as two distinct arguments on Alpha, which affects padding | |
34 | > of the arguments passed on the stack. | |
35 | > | |
36 | ||
37 | Here is a patch for it. It should be applied against egcs-970929. | |
38 | Beside fixing complex-5.c in the testsuite, egcs with this patch generates | |
39 | the same result from 'make check-gcc' as without it. | |
40 | ||
41 | On an alpha-dec-osf4.0, this patch correctly compiles the following test | |
42 | program with F=char, short, int, long, float, double: | |
43 | #ifndef F | |
44 | #define F float | |
45 | #endif | |
46 | ||
47 | typedef __complex__ F FC; | |
48 | ||
49 | FC f1(int odd, FC a, FC b, FC c) | |
50 | { | |
51 | return a + b + c; | |
52 | } | |
53 | ||
54 | FC f2a(F a, F b, F c, F d, F e, F f, F g, F h) | |
55 | { | |
56 | return (a + c + e + g) + 1i * (b + d + f + h); | |
57 | } | |
58 | ||
59 | FC f2b(FC a, FC b, FC c, FC d) | |
60 | { | |
61 | return a + b + c + d; | |
62 | } | |
63 | ||
64 | int main() | |
65 | { | |
66 | FC a, b, c, d, e; | |
67 | a = 1 + 2i; | |
68 | b = 3+4i; | |
69 | c = 5+6i; | |
70 | d = 7+8i; | |
71 | ||
72 | e = f1(1,a,b,c); | |
73 | if (e != 9+12i) | |
74 | abort (); | |
75 | e=f2b(a,b,c,d); | |
76 | if (e != 16+20i) | |
77 | abort (); | |
78 | e=f2a(1,2,3,4,5,6,7,8); | |
79 | if (e != 16+20i) | |
80 | abort (); | |
81 | return 0; | |
82 | } | |
83 | ||
84 | This patch has only been tested on alpha-dec-osf4.0, because I have no | |
85 | access to other machines. To support compless on other machines, the | |
86 | machine-dependent tm.h has to be modified similarly to what is done for | |
87 | alpha.h here. | |
88 | ||
89 | Weiwen | |
90 | ||
91 | Sun Oct 5 19:00:00 Weiwen Liu <liu@hepunix.phycis.yale.edu> | |
92 | ||
93 | * c-tree.h: Define complex_long_integer_type_node | |
94 | to support __complex__ long. | |
95 | * c-decl.c (init_decl_processing): Initialize | |
96 | complex_long_integer_type_node. | |
97 | * c-lex.c (yylex): Enable __complex__ long. | |
98 | ||
99 | * expr.h: Define COMPLEX_WORD_MODE and GET_COMPLEX_MODE_SIZE. | |
100 | * emit-rtl.c (gen_lowpart_common, gen_highpart, | |
101 | operand_subword): Use them. | |
102 | * expr.c (move_block_to_reg, emit_push_insn): Use them. | |
103 | ||
104 | * emit-rtl.c (operand_subword): Deal with a complex mode. | |
105 | ||
106 | * regs.h: Correctly calculate REG_SIZE for a complex mode. | |
107 | ||
108 | * config/alpha/alpha.h: Correctly deal with a complex mode in | |
109 | HARD_REGNO_NREGS, FUNCTION_VALUE, ALPHA_ARG_SIZE. | |
110 | ||
111 | *** gcc/c-decl.c.orig Sat Sep 27 14:16:06 1997 | |
112 | --- gcc/c-decl.c Wed Oct 1 16:19:39 1997 | |
113 | *************** tree double_type_node; | |
114 | *** 135,140 **** | |
115 | --- 135,141 ---- | |
116 | tree long_double_type_node; | |
117 | ||
118 | tree complex_integer_type_node; | |
119 | + tree complex_long_integer_type_node; | |
120 | tree complex_float_type_node; | |
121 | tree complex_double_type_node; | |
122 | tree complex_long_double_type_node; | |
123 | *************** init_decl_processing () | |
124 | *** 2989,2994 **** | |
125 | --- 2990,3001 ---- | |
126 | complex_integer_type_node)); | |
127 | TREE_TYPE (complex_integer_type_node) = integer_type_node; | |
128 | layout_type (complex_integer_type_node); | |
129 | + | |
130 | + complex_long_integer_type_node = make_node (COMPLEX_TYPE); | |
131 | + pushdecl (build_decl (TYPE_DECL, get_identifier ("complex long int"), | |
132 | + complex_long_integer_type_node)); | |
133 | + TREE_TYPE (complex_long_integer_type_node) = long_integer_type_node; | |
134 | + layout_type (complex_long_integer_type_node); | |
135 | ||
136 | complex_float_type_node = make_node (COMPLEX_TYPE); | |
137 | pushdecl (build_decl (TYPE_DECL, get_identifier ("complex float"), | |
138 | *** gcc/c-lex.c.orig Fri Aug 15 01:32:53 1997 | |
139 | --- gcc/c-lex.c Wed Oct 1 16:19:39 1997 | |
140 | *************** yylex () | |
141 | *** 1769,1774 **** | |
142 | --- 1769,1780 ---- | |
143 | = build_complex (NULL_TREE, integer_zero_node, | |
144 | convert (integer_type_node, | |
145 | yylval.ttype)); | |
146 | + else if (TYPE_PRECISION (type) | |
147 | + <= TYPE_PRECISION (long_integer_type_node)) | |
148 | + yylval.ttype | |
149 | + = build_complex (NULL_TREE, integer_zero_node, | |
150 | + convert (long_integer_type_node, | |
151 | + yylval.ttype)); | |
152 | else | |
153 | error ("complex integer constant is too wide for `complex int'"); | |
154 | } | |
155 | *** gcc/c-tree.h.orig Mon Aug 11 11:57:03 1997 | |
156 | --- gcc/c-tree.h Wed Oct 1 16:19:40 1997 | |
157 | *************** extern tree long_long_integer_type_node; | |
158 | *** 219,224 **** | |
159 | --- 219,225 ---- | |
160 | extern tree long_long_unsigned_type_node; | |
161 | extern tree long_unsigned_type_node; | |
162 | extern tree complex_integer_type_node; | |
163 | + extern tree complex_long_integer_type_node; | |
164 | extern tree complex_float_type_node; | |
165 | extern tree complex_double_type_node; | |
166 | extern tree complex_long_double_type_node; | |
167 | *** gcc/emit-rtl.c.orig Mon Sep 22 13:41:24 1997 | |
168 | --- gcc/emit-rtl.c Sun Oct 5 17:48:05 1997 | |
169 | *************** gen_lowpart_common (mode, x) | |
170 | *** 635,644 **** | |
171 | / UNITS_PER_WORD))) | |
172 | return 0; | |
173 | ||
174 | ! if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD) | |
175 | ! word = ((GET_MODE_SIZE (GET_MODE (x)) | |
176 | ! - MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD)) | |
177 | ! / UNITS_PER_WORD); | |
178 | ||
179 | if ((GET_CODE (x) == ZERO_EXTEND || GET_CODE (x) == SIGN_EXTEND) | |
180 | && (GET_MODE_CLASS (mode) == MODE_INT | |
181 | --- 635,644 ---- | |
182 | / UNITS_PER_WORD))) | |
183 | return 0; | |
184 | ||
185 | ! if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (x)) >0) | |
186 | ! word = GET_COMPLEX_MODE_SIZE (GET_MODE (x)) | |
187 | ! - ((GET_MODE_SIZE (mode) + (UNITS_PER_WORD - 1)) | |
188 | ! / UNITS_PER_WORD); | |
189 | ||
190 | if ((GET_CODE (x) == ZERO_EXTEND || GET_CODE (x) == SIGN_EXTEND) | |
191 | && (GET_MODE_CLASS (mode) == MODE_INT | |
192 | *************** gen_highpart (mode, x) | |
193 | *** 1013,1022 **** | |
194 | int word = 0; | |
195 | ||
196 | if (! WORDS_BIG_ENDIAN | |
197 | ! && GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD) | |
198 | ! word = ((GET_MODE_SIZE (GET_MODE (x)) | |
199 | ! - MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD)) | |
200 | ! / UNITS_PER_WORD); | |
201 | ||
202 | /* | |
203 | * ??? This fails miserably for complex values being passed in registers | |
204 | --- 1013,1022 ---- | |
205 | int word = 0; | |
206 | ||
207 | if (! WORDS_BIG_ENDIAN | |
208 | ! && GET_MODE_SIZE (GET_MODE (x)) > 0) | |
209 | ! word = GET_COMPLEX_MODE_SIZE (GET_MODE (x)) | |
210 | ! - ((GET_MODE_SIZE (mode) + (UNITS_PER_WORD - 1)) | |
211 | ! / UNITS_PER_WORD); | |
212 | ||
213 | /* | |
214 | * ??? This fails miserably for complex values being passed in registers | |
215 | *************** operand_subword (op, i, validate_address | |
216 | *** 1100,1105 **** | |
217 | --- 1100,1107 ---- | |
218 | ||
219 | /* If OP is narrower than a word or if we want a word outside OP, fail. */ | |
220 | if (mode != BLKmode | |
221 | + && (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT | |
222 | + && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT) | |
223 | && (GET_MODE_SIZE (mode) < UNITS_PER_WORD | |
224 | || (i + 1) * UNITS_PER_WORD > GET_MODE_SIZE (mode))) | |
225 | return 0; | |
226 | *************** operand_subword (op, i, validate_address | |
227 | *** 1127,1133 **** | |
228 | || op == arg_pointer_rtx | |
229 | #endif | |
230 | || op == stack_pointer_rtx) | |
231 | ! return gen_rtx (SUBREG, word_mode, op, i); | |
232 | else | |
233 | return gen_rtx (REG, word_mode, REGNO (op) + i); | |
234 | } | |
235 | --- 1129,1135 ---- | |
236 | || op == arg_pointer_rtx | |
237 | #endif | |
238 | || op == stack_pointer_rtx) | |
239 | ! return gen_rtx (SUBREG, COMPLEX_WORD_MODE (mode), op, i); | |
240 | else | |
241 | return gen_rtx (REG, word_mode, REGNO (op) + i); | |
242 | } | |
243 | *************** operand_subword (op, i, validate_address | |
244 | *** 1135,1141 **** | |
245 | return gen_rtx (SUBREG, word_mode, SUBREG_REG (op), i + SUBREG_WORD (op)); | |
246 | else if (GET_CODE (op) == CONCAT) | |
247 | { | |
248 | ! int partwords = GET_MODE_UNIT_SIZE (GET_MODE (op)) / UNITS_PER_WORD; | |
249 | if (i < partwords) | |
250 | return operand_subword (XEXP (op, 0), i, validate_address, mode); | |
251 | return operand_subword (XEXP (op, 1), i - partwords, | |
252 | --- 1137,1144 ---- | |
253 | return gen_rtx (SUBREG, word_mode, SUBREG_REG (op), i + SUBREG_WORD (op)); | |
254 | else if (GET_CODE (op) == CONCAT) | |
255 | { | |
256 | ! int partwords = (GET_MODE_UNIT_SIZE (GET_MODE (op)) | |
257 | ! + (UNITS_PER_WORD - 1))/ UNITS_PER_WORD; | |
258 | if (i < partwords) | |
259 | return operand_subword (XEXP (op, 0), i, validate_address, mode); | |
260 | return operand_subword (XEXP (op, 1), i - partwords, | |
261 | *************** operand_subword (op, i, validate_address | |
262 | *** 1145,1151 **** | |
263 | /* Form a new MEM at the requested address. */ | |
264 | if (GET_CODE (op) == MEM) | |
265 | { | |
266 | ! rtx addr = plus_constant (XEXP (op, 0), i * UNITS_PER_WORD); | |
267 | rtx new; | |
268 | ||
269 | if (validate_address) | |
270 | --- 1148,1158 ---- | |
271 | /* Form a new MEM at the requested address. */ | |
272 | if (GET_CODE (op) == MEM) | |
273 | { | |
274 | ! rtx addr = plus_constant ( | |
275 | ! XEXP (op, 0), | |
276 | ! (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT | |
277 | ! || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)? | |
278 | ! i*GET_MODE_UNIT_SIZE (mode): i * UNITS_PER_WORD); | |
279 | rtx new; | |
280 | ||
281 | if (validate_address) | |
282 | *************** operand_subword (op, i, validate_address | |
283 | *** 1159,1165 **** | |
284 | addr = memory_address (word_mode, addr); | |
285 | } | |
286 | ||
287 | ! new = gen_rtx (MEM, word_mode, addr); | |
288 | ||
289 | MEM_VOLATILE_P (new) = MEM_VOLATILE_P (op); | |
290 | MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (op); | |
291 | --- 1166,1172 ---- | |
292 | addr = memory_address (word_mode, addr); | |
293 | } | |
294 | ||
295 | ! new = gen_rtx (MEM, COMPLEX_WORD_MODE (mode), addr); | |
296 | ||
297 | MEM_VOLATILE_P (new) = MEM_VOLATILE_P (op); | |
298 | MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (op); | |
299 | *** gcc/expr.c.orig Sat Oct 4 03:12:35 1997 | |
300 | --- gcc/expr.c Sun Oct 5 18:21:18 1997 | |
301 | *************** move_block_to_reg (regno, x, nregs, mode | |
302 | *** 1701,1707 **** | |
303 | #endif | |
304 | ||
305 | for (i = 0; i < nregs; i++) | |
306 | ! emit_move_insn (gen_rtx (REG, word_mode, regno + i), | |
307 | operand_subword_force (x, i, mode)); | |
308 | } | |
309 | ||
310 | --- 1701,1707 ---- | |
311 | #endif | |
312 | ||
313 | for (i = 0; i < nregs; i++) | |
314 | ! emit_move_insn (gen_rtx (REG, COMPLEX_WORD_MODE (mode), regno + i), | |
315 | operand_subword_force (x, i, mode)); | |
316 | } | |
317 | ||
318 | *************** move_block_from_reg (regno, x, nregs, si | |
319 | *** 1724,1729 **** | |
320 | --- 1724,1731 ---- | |
321 | /* If SIZE is that of a mode no bigger than a word, just use that | |
322 | mode's store operation. */ | |
323 | if (size <= UNITS_PER_WORD | |
324 | + && GET_MODE_CLASS (GET_MODE (x)) != MODE_COMPLEX_INT | |
325 | + && GET_MODE_CLASS (GET_MODE (x)) != MODE_COMPLEX_FLOAT | |
326 | && (mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0)) != BLKmode) | |
327 | { | |
328 | emit_move_insn (change_address (x, mode, NULL), | |
329 | *************** move_block_from_reg (regno, x, nregs, si | |
330 | *** 1769,1780 **** | |
331 | ||
332 | for (i = 0; i < nregs; i++) | |
333 | { | |
334 | ! rtx tem = operand_subword (x, i, 1, BLKmode); | |
335 | ||
336 | if (tem == 0) | |
337 | abort (); | |
338 | ||
339 | ! emit_move_insn (tem, gen_rtx (REG, word_mode, regno + i)); | |
340 | } | |
341 | } | |
342 | ||
343 | --- 1771,1786 ---- | |
344 | ||
345 | for (i = 0; i < nregs; i++) | |
346 | { | |
347 | ! rtx tem = operand_subword | |
348 | ! (x, i, 1, (GET_MODE_CLASS(GET_MODE (x)) == MODE_COMPLEX_INT | |
349 | ! || GET_MODE_CLASS(GET_MODE (x)) == MODE_COMPLEX_FLOAT)? | |
350 | ! GET_MODE(x):BLKmode); | |
351 | ||
352 | if (tem == 0) | |
353 | abort (); | |
354 | ||
355 | ! emit_move_insn (tem, gen_rtx (REG, COMPLEX_WORD_MODE (GET_MODE (x)), | |
356 | ! regno + i)); | |
357 | } | |
358 | } | |
359 | ||
360 | *************** emit_push_insn (x, mode, type, size, ali | |
361 | *** 2687,2693 **** | |
362 | { | |
363 | /* Scalar partly in registers. */ | |
364 | ||
365 | ! int size = GET_MODE_SIZE (mode) / UNITS_PER_WORD; | |
366 | int i; | |
367 | int not_stack; | |
368 | /* # words of start of argument | |
369 | --- 2693,2699 ---- | |
370 | { | |
371 | /* Scalar partly in registers. */ | |
372 | ||
373 | ! int size = GET_COMPLEX_MODE_SIZE (mode); | |
374 | int i; | |
375 | int not_stack; | |
376 | /* # words of start of argument | |
377 | *************** emit_push_insn (x, mode, type, size, ali | |
378 | *** 2696,2701 **** | |
379 | --- 2702,2716 ---- | |
380 | int args_offset = INTVAL (args_so_far); | |
381 | int skip; | |
382 | ||
383 | + /* For a complex argument passing partially in a register, | |
384 | + save the image part in stack immedially following the space | |
385 | + used for save the part passig in register (see function | |
386 | + assign_parms in function.c). */ | |
387 | + if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT | |
388 | + || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT) | |
389 | + if (GET_MODE_UNIT_SIZE (mode) < UNITS_PER_WORD) | |
390 | + args_offset += GET_MODE_UNIT_SIZE (mode) - UNITS_PER_WORD; | |
391 | + | |
392 | /* Push padding now if padding above and stack grows down, | |
393 | or if padding below and stack grows up. | |
394 | But if space already allocated, this has already been done. */ | |
395 | *************** emit_push_insn (x, mode, type, size, ali | |
396 | *** 2742,2748 **** | |
397 | #endif | |
398 | if (i >= not_stack + offset) | |
399 | emit_push_insn (operand_subword_force (x, i, mode), | |
400 | ! word_mode, NULL_TREE, NULL_RTX, align, 0, NULL_RTX, | |
401 | 0, args_addr, | |
402 | GEN_INT (args_offset + ((i - not_stack + skip) | |
403 | * UNITS_PER_WORD))); | |
404 | --- 2757,2764 ---- | |
405 | #endif | |
406 | if (i >= not_stack + offset) | |
407 | emit_push_insn (operand_subword_force (x, i, mode), | |
408 | ! COMPLEX_WORD_MODE (mode), | |
409 | ! NULL_TREE, NULL_RTX, align, 0, NULL_RTX, | |
410 | 0, args_addr, | |
411 | GEN_INT (args_offset + ((i - not_stack + skip) | |
412 | * UNITS_PER_WORD))); | |
413 | *** gcc/expr.h.orig Sat Oct 4 23:46:34 1997 | |
414 | --- gcc/expr.h Sun Oct 5 18:21:14 1997 | |
415 | *************** extern void bc_adjust_stack PROTO ((in | |
416 | *** 952,954 **** | |
417 | --- 952,970 ---- | |
418 | extern void bc_load_localaddr PROTO ((rtx)); | |
419 | extern void do_jump_by_parts_greater_rtx PROTO ((enum machine_mode, int, | |
420 | rtx, rtx, rtx, rtx)); | |
421 | + | |
422 | + /* Determine the mode for the imagine and real part of a complex MODE. | |
423 | + For a non-complex MODE, use WORD_MODE.*/ | |
424 | + #define COMPLEX_WORD_MODE(MODE) \ | |
425 | + (((GET_MODE_CLASS (MODE) == MODE_COMPLEX_INT \ | |
426 | + || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \ | |
427 | + && GET_MODE_UNIT_SIZE (MODE) < UNITS_PER_WORD)? \ | |
428 | + mode_for_size (GET_MODE_UNIT_SIZE(MODE)*BITS_PER_UNIT, \ | |
429 | + (GET_MODE_CLASS (MODE) == MODE_COMPLEX_INT)? \ | |
430 | + MODE_INT:MODE_FLOAT, \ | |
431 | + 0):word_mode) | |
432 | + | |
433 | + /* Calculate number of bytes needed for a complex MODE */ | |
434 | + #define GET_COMPLEX_MODE_SIZE(MODE) \ | |
435 | + (((GET_MODE_UNIT_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) \ | |
436 | + * (GET_MODE_SIZE (MODE)) / GET_MODE_UNIT_SIZE (MODE)) | |
437 | *** gcc/regs.h.orig Mon Aug 11 11:57:12 1997 | |
438 | --- gcc/regs.h Wed Oct 1 16:19:31 1997 | |
439 | *************** Boston, MA 02111-1307, USA. */ | |
440 | *** 27,33 **** | |
441 | valid way to get this value. You cannot get it from the regno. */ | |
442 | ||
443 | #define REG_SIZE(R) \ | |
444 | ! ((mode_size[(int) GET_MODE (R)] + UNITS_PER_WORD - 1) / UNITS_PER_WORD) | |
445 | ||
446 | /* Maximum register number used in this function, plus one. */ | |
447 | ||
448 | --- 27,36 ---- | |
449 | valid way to get this value. You cannot get it from the regno. */ | |
450 | ||
451 | #define REG_SIZE(R) \ | |
452 | ! (GET_MODE_SIZE (GET_MODE (R)) == 0? \ | |
453 | ! 0:(((GET_MODE_UNIT_SIZE (GET_MODE (R)) + (UNITS_PER_WORD - 1)) \ | |
454 | ! / UNITS_PER_WORD) * (GET_MODE_SIZE (GET_MODE (R)) \ | |
455 | ! / GET_MODE_UNIT_SIZE (GET_MODE (R))))) | |
456 | ||
457 | /* Maximum register number used in this function, plus one. */ | |
458 | ||
459 | *** gcc/config/alpha/alpha.h.orig Wed Oct 1 16:16:31 1997 | |
460 | --- gcc/config/alpha/alpha.h Fri Oct 3 11:41:58 1997 | |
461 | *************** extern void override_options (); | |
462 | *** 515,521 **** | |
463 | but can be less for certain modes in special long registers. */ | |
464 | ||
465 | #define HARD_REGNO_NREGS(REGNO, MODE) \ | |
466 | ! ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) | |
467 | ||
468 | /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. | |
469 | On Alpha, the integer registers can hold any mode. The floating-point | |
470 | --- 515,524 ---- | |
471 | but can be less for certain modes in special long registers. */ | |
472 | ||
473 | #define HARD_REGNO_NREGS(REGNO, MODE) \ | |
474 | ! (GET_MODE_SIZE (MODE) == 0? \ | |
475 | ! 0:(((GET_MODE_UNIT_SIZE (MODE) + (UNITS_PER_WORD - 1)) \ | |
476 | ! / UNITS_PER_WORD) * (GET_MODE_SIZE (MODE) \ | |
477 | ! / GET_MODE_UNIT_SIZE (MODE)))) | |
478 | ||
479 | /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. | |
480 | On Alpha, the integer registers can hold any mode. The floating-point | |
481 | *************** enum reg_class { NO_REGS, GENERAL_REGS, | |
482 | *** 891,901 **** | |
483 | #define FUNCTION_VALUE(VALTYPE, FUNC) \ | |
484 | gen_rtx (REG, \ | |
485 | (INTEGRAL_MODE_P (TYPE_MODE (VALTYPE)) \ | |
486 | && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \ | |
487 | ? word_mode : TYPE_MODE (VALTYPE), \ | |
488 | ((TARGET_FPREGS \ | |
489 | && (TREE_CODE (VALTYPE) == REAL_TYPE \ | |
490 | ! || TREE_CODE (VALTYPE) == COMPLEX_TYPE)) \ | |
491 | ? 32 : 0)) | |
492 | ||
493 | /* Define how to find the value returned by a library function | |
494 | --- 894,908 ---- | |
495 | #define FUNCTION_VALUE(VALTYPE, FUNC) \ | |
496 | gen_rtx (REG, \ | |
497 | (INTEGRAL_MODE_P (TYPE_MODE (VALTYPE)) \ | |
498 | + && (GET_MODE_CLASS(TYPE_MODE (VALTYPE)) \ | |
499 | + != MODE_COMPLEX_INT) \ | |
500 | && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \ | |
501 | ? word_mode : TYPE_MODE (VALTYPE), \ | |
502 | ((TARGET_FPREGS \ | |
503 | && (TREE_CODE (VALTYPE) == REAL_TYPE \ | |
504 | ! || TREE_CODE (VALTYPE) == COMPLEX_TYPE) \ | |
505 | ! && (GET_MODE_CLASS(TYPE_MODE (VALTYPE)) \ | |
506 | ! != MODE_COMPLEX_INT)) \ | |
507 | ? 32 : 0)) | |
508 | ||
509 | /* Define how to find the value returned by a library function | |
510 | *************** enum reg_class { NO_REGS, GENERAL_REGS, | |
511 | *** 953,959 **** | |
512 | ||
513 | #define ALPHA_ARG_SIZE(MODE, TYPE, NAMED) \ | |
514 | ((MODE) != BLKmode \ | |
515 | ! ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ | |
516 | : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) | |
517 | ||
518 | /* Update the data in CUM to advance over an argument | |
519 | --- 960,969 ---- | |
520 | ||
521 | #define ALPHA_ARG_SIZE(MODE, TYPE, NAMED) \ | |
522 | ((MODE) != BLKmode \ | |
523 | ! ? (GET_MODE_SIZE (MODE) > 0? \ | |
524 | ! (GET_MODE_UNIT_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ | |
525 | ! * GET_MODE_SIZE (MODE) / GET_MODE_UNIT_SIZE (MODE) \ | |
526 | ! : 0) \ | |
527 | : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) | |
528 | ||
529 | /* Update the data in CUM to advance over an argument | |
530 | ||
531 |