Improved sysdepCallMethod for HP-UX

Pavel Roskin pavel_roskin at geocities.com
Wed Sep 30 12:34:56 PDT 1998


Hello!

I have found some errors in my previous version of sysdepCallMethod for
PA-RISC processors. This version has been tested using TestNative and
works normaly both if compiled optimized (up to -O3) and non-optimized.
To Changelog:

======================
Wed Sep 30 20:24:42 1998  Pavel Roskin <pavel_roskin at geocities.com>

	* config/parisc/common.h: Alignment of 8-byte arguments corrected.
        Buggy smart_args macro removed. All arguments are written to
stack and
	then the first four are passed in registers.
	Space on stack is reserved using a variable-size array st_reserve
======================

I post the whole file because it is shorter than the patch:
======================
/*                                                                                                         
 *
parisc/common.h                                                                                         
 * Common configuration information for PA-RISC based
machines.                                            

*                                                                                                         
 * Copyright (c) 1996, 1997,
1998                                                                          
 *      Transvirtual Technologies, Inc.  All rights
reserved.                                              

*                                                                                                         
 * See the file "license.terms" for information on usage and
redistribution                                
 * of this
file.                                                                                           

*                                                                                                         
 * sysdepCallMethod is written by Pavel Roskin
<pavel_roskin at geocities.com>                                

*/                                                                                                        
                                                                                                           
#ifndef
__parisc_common_h                                                                                  
#define
__parisc_common_h                                                                                  
                                                                                                           
typedef jdouble d4int_f (int, int, int,
int);                                                              
typedef jfloat f4int_f (int, int, int,
int);                                                               
typedef jlong j4int_f (int, int, int,
int);                                                                
                                                                                                           
#define sysdepCallMethod(CALL)                                         
\                                  
do {                                                                   
\                                  
  int argidx;                                                          
\                                  
  int *sa;                                                             
\                                  
  int *stackx;                                                         
\                                  
  int st_reserve[(CALL)->nrargs];                                      
\                                  
  asm volatile ("ldo -36(%%r30),%0" : "=r" (sa) : "r" (st_reserve));   
\                                  
  for (argidx = 0, stackx = sa; argidx < (CALL)->nrargs; argidx++)     
\                                  
    switch ((CALL)->callsize[argidx])                                  
\                                  
      {                                                                
\                                  
      case 1:                                                          
\                                  
        *stackx-- = (CALL)->args[argidx].i;                            
\                                  
        break;                                                         
\                                  
      case 2:                                                          
\                                  
        if (!((int)stackx & 4)) stackx--;                              
\                                  
        *stackx-- = (int) ((CALL)->args[argidx].j);                    
\                                  
        *stackx-- = (CALL)->args[argidx].i;                            
\                                  
        argidx++;                                                      
\                                  
      default:                                                         
\                                  
        break;                                                         
\                                  
      }                                                                
\                                  
  if ((CALL)->rettype == 'F') {                                        
\                                  
    (CALL)->ret->f =                                                   
\                                  
      ((f4int_f *) ((CALL)->function)) (sa[0], sa[-1], sa[-2], sa[-3]);
\                                  
    break;                                                             
\                                  
  }                                                                    
\                                  
  if ((CALL)->rettype == 'D') {                                        
\                                  
    (CALL)->ret->d =                                                   
\                                  
      ((d4int_f *) ((CALL)->function)) (sa[0], sa[-1], sa[-2], sa[-3]);
\                                  
    break;                                                             
\                                  
  }                                                                    
\                                  
  (CALL)->ret->j =                                                     
\                                  
    ((j4int_f *) ((CALL)->function)) (sa[0], sa[-1], sa[-2], sa[-3]);  
\                                  
} while
(0);                                                                                               
                                                                                                           
#endif                                                                                                     
======================

There are still some problems with pizza (see my next message) but I'm
quite confident that the problem is not with sysdepCallMethod but rather
with clib or pizza itself.

Pavel Roskin


More information about the kaffe mailing list