view test/ps2code.c @ 739:0c7a6ae119ba

i64 continue... compiler compiled.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 08 Nov 2010 22:22:46 +0900
parents 3f1f6c0610c1
children c2c709727221
line wrap: on
line source

#define __environment _CbC_environment
#define __return _CbC_return

#ifndef INLINE
#define INLINE
#endif

int printf(const char *,...);
void bzero(void *b, unsigned int len);



typedef float        ps2_vu0_fmatrix[4][4] __attribute__((aligned (16)));
typedef ps2_vu0_fmatrix FMATRIX;

typedef float        ps2_vu0_fmatrix1[4][4];
typedef ps2_vu0_fmatrix1 FMATRIX1;


void  ps2_vu0_unit_matrix(ps2_vu0_fmatrix m)
{
    printf("%g\n",m[1][1]);
    m[1][1] = -0.5;
}


#define mod16(a) (((int)(&a))%16)

__code
align16(int i, FMATRIX a, FMATRIX b) {
   FMATRIX m;
   FMATRIX n;
   int k = i;
   FMATRIX o;
   ps2_vu0_unit_matrix(a);
   if (i==0) goto align16_1(2,a,b);
   printf("offset %d\n",((char*)a) - ((char*)(&m)));
   printf("%d %d %d\n",mod16(m),mod16(n),mod16(o));
   goto align16(i-1,m,n);
}

__code (*exit0)(int,void*);
void *env;

__code
align16_1(int i, FMATRIX1 a, FMATRIX1 b) {
   FMATRIX1 m;
   FMATRIX1 n;
   int k = i;
   FMATRIX1 o;
   ps2_vu0_unit_matrix(a);
   if (i==0) goto exit0(0,env);
   printf("offset %d\n",((char*)a) - ((char*)(&m)));
   printf("%d %d %d\n",mod16(m),mod16(n),mod16(o));
   goto align16_1(i-1,m,n);
}


int
main(int ac, char *av[])
{
    FMATRIX m;

    m[1][1] = 0.5;
    exit0 = return;
    env = environment;
    goto align16(2,m,m);
}


/* end */