comparison mc-code-powerpc.c @ 449:c55363eff5e5

parallel assignment (modify not completed)
author kono
date Thu, 25 Nov 2004 16:56:26 +0900
parents 5ec2a88b9f4d
children eaf9e2746c83
comparison
equal deleted inserted replaced
448:422415e15eb8 449:c55363eff5e5
272 f24-f31 saved register variable 272 f24-f31 saved register variable
273 273
274 function call stack frame 274 function call stack frame
275 <-------r1_offset------------------------------> 275 <-------r1_offset------------------------------>
276 <------------lvar_offset0------> 276 <------------lvar_offset0------>
277 <--lvar_offset--> 277 <--lvar_offset--> r30(?) r1
278 r+ +------------+---+---------------+----------+--------------+----+ - 278 r+ +------------+---+---------------+----------+--------------+----+ -
279 callee arg xx register save local caller arg xx 279 callee arg xx register save local caller arg xx
280 reg_save disp max_func_args*SIZE_OF_INT 280 reg_save disp max_func_args*SIZE_OF_INT
281 lvar>0 lvar<0 lvar>0x1000 0000 281 lvar>0 lvar<0 lvar>0x1000 0000
282 282
289 r20-r29 lvar>0 lvar<0 lvar>0x1000 000 289 r20-r29 lvar>0 lvar<0 lvar>0x1000 000
290 f20-f31 <-my_func_args--><--disp-----><-max_func_arg-> 290 f20-f31 <-my_func_args--><--disp-----><-max_func_arg->
291 *SIZE_OF_INT *SIZE_OF_INT 291 *SIZE_OF_INT *SIZE_OF_INT
292 292
293 */ 293 */
294 int arg_offset = 24; int arg_offset1 = 24; int disp_offset = -12; 294 static int arg_offset = 24;
295 static int arg_offset1 = 24;
296 int disp_offset = -12;
295 // #define func_disp_offset 60 297 // #define func_disp_offset 60
296 #define func_disp_offset 68 298 #define func_disp_offset 68
297 #define r1_offset func_disp_offset+12 299 #define r1_offset func_disp_offset+12
298 int code_disp_offset = 0; int jump_offset = 0; 300 static int code_disp_offset = 0;
301 // static int jump_offset = 0;
302
299 #define CODE_LVAR l+code_disp_offset 303 #define CODE_LVAR l+code_disp_offset
300 #define CODE_CALLER_ARG (l-ARG_LVAR_OFFSET)+arg_offset1 304 #define CODE_CALLER_ARG (l-ARG_LVAR_OFFSET)+arg_offset1
301 #define FUNC_LVAR l+disp_offset 305 #define FUNC_LVAR l+disp_offset
302 #define CALLER_ARG (l-ARG_LVAR_OFFSET)+arg_offset1 306 #define CALLER_ARG (l-ARG_LVAR_OFFSET)+arg_offset1
303 #define CALLEE_ARG l+arg_offset 307 #define CALLEE_ARG l+arg_offset
1768 } 1772 }
1769 } 1773 }
1770 my_func_args = offset; 1774 my_func_args = offset;
1771 } 1775 }
1772 1776
1773 static int 1777 int
1774 not_simple_p(int e3) 1778 not_simple_p(int e3)
1775 { 1779 {
1776 return e3==FUNCTION||e3==CONV/*||e3==RSTRUCT*/||e3==STASS|| 1780 return e3==FUNCTION||e3==CONV/*||e3==RSTRUCT*/||e3==STASS||
1777 e3==LLSHIFT||e3==LULSHIFT||e3==LRSHIFT||e3==LURSHIFT|| 1781 e3==LLSHIFT||e3==LULSHIFT||e3==LRSHIFT||e3==LURSHIFT||
1778 e3==LDIV||e3==LUDIV||e3==LMOD||e3==LUMOD||e3==LASSOP||e3==ALLOCA; 1782 e3==LDIV||e3==LUDIV||e3==LMOD||e3==LUMOD||e3==LASSOP||e3==ALLOCA;
2748 void 2752 void
2749 code_leave(char *name) 2753 code_leave(char *name)
2750 { 2754 {
2751 int r1_offsetv; 2755 int r1_offsetv;
2752 disp&= -SIZE_OF_INT; 2756 disp&= -SIZE_OF_INT;
2753 r1_offsetv = -disp+max_func_args*SIZE_OF_INT+code_disp_offset+8; 2757 r1_offsetv = -disp+max_func_args*SIZE_OF_INT +code_disp_offset +8+32;
2754 2758
2755 printf(".set L_%d,%d\n",code_disp_label,-r1_offsetv); 2759 printf(".set L_%d,%d\n",code_disp_label,-r1_offsetv);
2756 if (max_func_arg_label) { 2760 if (max_func_arg_label) {
2757 printf(".set L_%d,%d\n",max_func_arg_label,max_func_args*SIZE_OF_INT+24); 2761 printf(".set L_%d,%d\n",max_func_arg_label,max_func_args*SIZE_OF_INT+24);
2758 max_func_arg_label = 0; 2762 max_func_arg_label = 0;