view test/code-gen.c @ 237:1933266f1efa

long long ia32 (imcomplete)
author kono
date Fri, 30 Apr 2004 11:47:51 +0900
parents c575422d8b6e
children c68f618b71f9
line wrap: on
line source

/* Micro-C Code Generator Checker */
/* $Id$ */

#define FLOAT_CODE 1
#define LONGLONG_CODE 1

// code_lvar(int e2,int creg) 

extern int printf(const char *fmt,...);

void
code_lvar()
{
    char c1,c2;
    unsigned char uc1,uc2;
    int i1,i2; 
    short s1,s2; 
    unsigned short us1,us2; 

    i1 = 1; i2 = -2; 
    s1 = -1; s2 = -3; us1 = 65535; us2 = 65535;
    printf("code_lvar %d %d %d %d %u %u\n",i1,i2,s1,s2,us1,us2);
    c1 = -1; c2 = -3; uc1 = 200; uc2 = 202;
    printf("code_lvar %d %d %u %u\n",c1,c2,uc1,uc2);
}

// code_label(int labelno)
void
code_label()
{
    goto hoge;
hage:
    goto hage;
hoge:
    printf("code_label done\n");
}

// code_gvar(int e1,int creg) 
// code_rgvar(int e1,int creg) 
// code_crgvar(int e1,int creg,int sign,int sz)

char c1,c2;
unsigned char uc1,uc2;
static char s_c1,s_c2;
static unsigned char s_uc1,s_uc2;
int i1,i2; 
unsigned int ui1,ui2; 
short s1,s2; 
unsigned short us1,us2; 
static int s_i1,s_i2; 
static short s_s1,s_s2; 
static unsigned short s_us1,s_us2; 
#if FLOAT_CODE
float f0,f1;
double d0,d1;
static float s_f0,s_f1;
static double s_d0,s_d1;
#endif
#if LONGLONG_CODE
long long l0,l1;
unsigned long long ul0,ul1;
static long long s_l0,s_l1;
static unsigned long long s_ul0,s_ul1;
#endif

void
code_gvar()
{
    i1 = 1; i2 = -2; 
    s1 = -1; s2 = -3; us1 = 65535; us2 = 65535;
    printf("code_gvar a %d %d %u %u %u %u\n",i1,i2,s1,s2,us1,us2);
    c1 = -1; c2 = -3; uc1 = 200; uc2 = 202;
    printf("code_gvar b %d %d %u %u\n",c1,c2,uc1,uc2);

    s_i1 = 1; s_i2 = 2; 
    s_s1 = -1; s_s2 = -3; s_us1 = 65535; s_us2 = 65535;
    printf("code_gvar c %d %d %u %u %u %u\n",s_i1,s_i2,s1,s_s2,s_us1,s_us2);
    s_c1 = -1; s_c2 = -3; s_uc1 = 200; s_uc2 = 202;
    printf("code_gvar d %d %d %u %u\n",s_c1,s_c2,s_uc1,s_uc2);
}

// code_register(int e2,int creg) 

void
code_register()
{
    register char c1,c2;
    register unsigned char uc1,uc2;
    register int i1,i2; 
    register short s1,s2; 
    register unsigned short us1,us2; 

    i1 = 1; i2 = -2; 
    s1 = -1; s2 = -3; us1 = 65535; us2 = 65535;
    printf("code_lvar r %d %d %u %u %u %u\n",i1,i2,s1,s2,us1,us2);
    c1 = -1; c2 = -3; uc1 = 200; uc2 = 202;
    printf("code_gvar r %d %d %u %u\n",c1,c2,uc1,uc2);
}

// code_fname(NMTBL *n,int creg) 

void
code_fname()
{
    int i,j;
    i = (int)code_fname;
    j = (int)code_register;
    printf("code_fname %d\n",i==j);
}


// code_neg(int creg) 
void
code_neg()
{
    int i,j;
    i = 123123123;j = -32423;
    printf("code_neg %d %d\n",-i,-j);
}

// code_not(int creg) 
void
code_not()
{
    int i,j;
    i = 123123123;j = 0;
    printf("code_neg %d %d\n",~i,~j);
}

// code_lnot(int creg) 
void
code_lnot()
{
    int i,j;
    i = 123123123;j = 0;
    printf("code_neg %d %d\n",!i,!j);
}

// code_preinc(int e1,int e2,int dir,int sign,int sz,int reg) 
void
code_preinc()
{
    int i,j;
    i = 123123123;j = 0;
    printf("code_preinc i %d %d\n",++i,--j);
}

// code_postinc(int e1,int e2,int dir,int sign,int sz,int reg) 
void
code_upostinc()
{
    unsigned int i,j;
    i = 123123123;j = 0;
    printf("code_upreinc u %d %d\n",i++,j--);
}

// code_postinc(int e1,int e2,int dir,int sign,int sz,int reg) 
void
code_postinc()
{
    int i,j;
    i = 123123123;j = 0;
    printf("code_postinc i %d %d\n",i++,j--);
}

// code_preinc(int e1,int e2,int dir,int sign,int sz,int reg) 
void
code_upreinc()
{
    unsigned int i,j;
    i = 123123123;j = 0;
    printf("code_upreinc u %d %d\n",++i,--j);
}

// code_return(int creg) 


int
 code_return_int0()
{
    return 1;
}
void
code_return_int()
{
    printf("code_return_int %d\n",code_return_int0());
}

#if FLOAT_CODE
float
 code_return_float0()
{
    return 1.0;
}
void
code_return_float()
{
    printf("code_return_float %g\n",code_return_float0());
}

double
 code_return_double0()
{
    return 1.0;
}
void
code_return_double()
{
    printf("code_return_double %g\n",code_return_double0());
}

#endif

#if LONGLONG_CODE
long long
 code_return_longlong0()
{
    return 10LL;
}
void
code_return_longlong()
{
    printf("code_return_longlong %lld\n",code_return_longlong0());
}

#endif

struct aa { char a[100]; } a0;
struct aa
 code_return_struct0(/*int j*/)
{
    a0.a[55]=3;
    return a0;
}

void
code_return_struct1()
{
    int i = code_return_struct0(/*1*/).a[55];
    // int i;
    // i = code_return_struct0(i).a[55];
    printf("code_return_struct %d\n", i);
}

void
code_return_struct()
{
    printf("code_return_struct %d\n", code_return_struct0().a[55]);
}

// code_gt(int cond) 

void
code_gt()
{
    if (i1>i2)
	printf("code_gt 1\n");
    else
	printf("code_gt 0\n");
}

// code_ugt(int cond) 
void
code_ugt()
{
    if (ui1>ui2)
	printf("code_ugt 1\n");
    else
	printf("code_ugt 0\n");
}

// code_ge(int cond) 
void
code_ge()
{
    if (i1>=i2)
	printf("code_ge 1\n");
    else
	printf("code_ge 0\n");
}

// code_uge(int cond) 
void
code_uge()
{
    if (ui1>=ui2)
	printf("code_uge 1\n");
    else
	printf("code_uge 0\n");
}

// code_eq(int cond) 
void
code_eq()
{
    if (ui1==ui2)
	printf("code_eq 1\n");
    else
	printf("code_eq 0\n");
    if (i1!=i2)
	printf("code_neq 1\n");
    else
	printf("code_neq 0\n");
}

// code_bool(int e1) 

void
code_bool()
{
    printf("code_bool > gvar %d %d %d %d %d %d\n",
	i1>i2,ui1>ui2,i1>=i2,ui1>=ui2,ui1==ui2,i1!=i2);
    printf("code_bool < gvar %d %d %d %d %d %d\n",
	i1<i2,ui1<ui2,i1<=i2,ui1<=ui2,ui1==ui2,i1!=i2);
}

void
code_cmp()
{
    char c1,c2;
    unsigned char uc1,uc2;
    int i1,i2; 
    short s1,s2; 
    unsigned short us1,us2; 

    i1 = 1; i2 = -2; 
    s1 = -1; s2 = -3; us1 = 65535; us2 = 65535;
    c1 = -1; c2 = -3; uc1 = 200; uc2 = 202;
    i1 && printf("code_bool local 1\n");
    s1 && printf("code_bool local 2\n");
    us1 && printf("code_bool local 3\n");
    c1 && printf("code_bool local 4\n");
    uc1 && printf("code_bool local 5\n");

}
void
code_cmp_global()
{
    i1 = 1; i2 = -2; 
    s1 = -1; s2 = -3; us1 = 65535; us2 = 65535;
    c1 = -1; c2 = -3; uc1 = 200; uc2 = 202;
    i1 && printf("code_bool global 1\n");
    s1 && printf("code_bool global 2\n");
    us1 && printf("code_bool global 3\n");
    c1 && printf("code_bool global 4\n");
    uc1 && printf("code_bool global 5\n");
}

void
code_cmp_register()
{
    register char c1,c2;
    register unsigned char uc1,uc2;
    register int i1,i2; 
    register short s1,s2; 
    register unsigned short us1,us2; 

    i1 = 1; i2 = -2; 
    s1 = -1; s2 = -3; us1 = 65535; us2 = 65535;
    c1 = -1; c2 = -3; uc1 = 200; uc2 = 202;
    i1 && printf("code_bool register 1\n");
    s1 && printf("code_bool register 2\n");
    us1 && printf("code_bool register 3\n");
    c1 && printf("code_bool register 4\n");
    uc1 && printf("code_bool register 5\n");

}


// code_string(int e1,int creg)

void
code_string()
{
    printf("code_string test\n");
}

// struct_push(int e4,int t,int arg) 

struct aa
  struct_push0(int i,struct aa a)
{
    a.a[55]++;
    if (i==0) {
	return struct_push0(1,a0);
    }
    return a0;
}

void
struct_push()
{
    a0.a[55]=3;
    a0 = struct_push0(0,a0);
    printf("struct_push %d\n",a0.a[55]);
}

// code_jmp(char *s) 
// code_indirect_jmp(int e2) 

// code_rindirect(int e1, int offset, int us);
void
code_rindirect()
{
    int i1,i2; 
    unsigned int ui1,ui2; 
    int *pi1,*pi2; 
    unsigned int *pui1,*pui2; 

    i1 = -555; i2= 555;
    ui1 = 632423423; ui2= 32394234;
    pi1 = &i1;
    pi2 = &i2;
    pui1 = &ui1;
    pui2 = &ui2;
    printf("code_rindirect %d %d %u %u\n",*pi1,*pi2,*pui1,*pui2);
}

// code_crindirect(int e1, int offset, int us);
void
code_crindirect()
{
    char i1,i2; 
    unsigned char ui1,ui2; 
    char *pi1,*pi2; 
    unsigned char *pui1,*pui2; 

    i1 = -55; i2= 55;
    ui1 = 200; ui2= 128;
    pi1 = &i1;
    pi2 = &i2;
    pui1 = &ui1;
    pui2 = &ui2;
    printf("code_cindirect %d %d %u %u\n",*pi1,*pi2,*pui1,*pui2);
}

// code_srindirect(int e1, int offset, int us);
void
code_srindirect()
{
    short i1,i2; 
    unsigned short ui1,ui2; 
    short *pi1,*pi2; 
    unsigned short *pui1,*pui2; 

    i1 = -55; i2= 55;
    ui1 = 200; ui2= 128;
    pi1 = &i1;
    pi2 = &i2;
    pui1 = &ui1;
    pui2 = &ui2;
    printf("code_sindirect %d %d %u %u\n",*pi1,*pi2,*pui1,*pui2);
}

#if FLOAT_CODE
// code_drindirect(int e1, int offset, int d);
void
code_drindirect()
{
    float i1,i2; 
    double ui1,ui2; 
    float *pi1,*pi2; 
    double *pui1,*pui2; 

    i1 = -55; i2= 55;
    ui1 = 200; ui2= 128;
    pi1 = &i1;
    pi2 = &i2;
    pui1 = &ui1;
    pui2 = &ui2;
    printf("code_dindirect %g %g %g %g\n",*pi1,*pi2,*pui1,*pui2);
}

#endif
    
#if LONGLONG_CODE
// code_lrindirect(int e1, int offset, int us);
void
code_lrindirect()
{
    long long i1,i2; 
    unsigned long long ui1,ui2; 
    long long *pi1,*pi2; 
    unsigned long long *pui1,*pui2; 

    i1 = -55; i2= 55;
    ui1 = 200; ui2= 128;
    pi1 = &i1;
    pi2 = &i2;
    pui1 = &ui1;
    pui2 = &ui2;
    printf("code_lrindirect %llx %llx %llx %llx\n",*pi1,*pi2,*pui1,*pui2);
    printf("code_lrindirect %lld %lld %llu %llu\n",*pi1,*pi2,*pui1,*pui2);
}

#endif

// code_assign_gvar(int e2,int creg,int byte) 
// code_assign_lvar(int e2,int creg,int byte) 
// code_assign_register(int e2,int byte,int creg) 
// code_assign(int e2,int byte,int creg) 

void
code_assign()
{
    int i1,i2; 
    unsigned int ui1,ui2; 
    int *pi1,*pi2; 
    unsigned int *pui1,*pui2; 

    i1 = -555; i2= 555;
    ui1 = 632423423; ui2= 32394234;
    pi1 = &i1;
    pi2 = &i2;
    pui1 = &ui1;
    pui2 = &ui2;

    *(pi2+i1+i2) = 3;
    *(pui2+i1+i2) = 3;
    printf("code_rindirect %d %d %u %u\n",*pi1,*pi2,*pui1,*pui2);
}

// code_register_assop(int e2,int op,int byte) 
void
code_register_assop()
{
    register int i1; 
    register unsigned int ui1; 
    i1 = -555;
    ui1 = 632423423;

    i1 += 3;
    printf("code_assop 1 %d\n",i1);
    i1 -= 3;
    printf("code_assop 2 %d\n",i1);
    i1 /= 3;
    printf("code_assop 3 %d\n",i1);
    i1 *= 3;
    printf("code_assop 4 %d\n",i1);
    i1 |= 234;
    printf("code_assop 5 %d\n",i1);
    i1 &= 23244234;
    printf("code_assop 6 %d\n",i1);
    i1 ^= 55244234;
    printf("code_assop 7 %d\n",i1);
    i1 <<= 3;
    printf("code_assop 8 %d\n",i1);
    i1 >>= 3;
    printf("code_assop 9 %d\n",i1);

    ui1 += 3;
    printf("code_assop 1 %u\n",ui1);
    ui1 -= 3;
    printf("code_assop 2 %u\n",ui1);
    ui1 /= 3;
    printf("code_assop 3 %u\n",ui1);
    ui1 *= 3;
    printf("code_assop 4 %u\n",ui1);
    ui1 |= 234;
    printf("code_assop 5 %u\n",ui1);
    ui1 &= 23234234;
    printf("code_assop 6 %u\n",ui1);
    ui1 ^= 55234234;
    printf("code_assop 7 %u\n",ui1);
    ui1 <<= 3;
    printf("code_assop 8 %u\n",ui1);
    ui1 >>= 3;
    printf("code_assop 9 %u\n",ui1);
}

// code_assop(int op,int byte,int sign) 
void
code_assop()
{
    int i1,i2; 
    unsigned int ui1,ui2; 
    i1 = -555; i2= 555;
    ui1 = 632423423; ui2= 32394234;

    i1 += 3;
    printf("code_assop 1 %d\n",i1);
    i1 -= 3;
    printf("code_assop 2 %d\n",i1);
    i1 /= 3;
    printf("code_assop 3 %d\n",i1);
    i1 *= 3;
    printf("code_assop 4 %d\n",i1);
    i1 |= 234;
    printf("code_assop 5 %d\n",i1);
    i1 &= 23234234;
    printf("code_assop 6 %d\n",i1);
    i1 ^= 55444234;
    printf("code_assop 7 %d\n",i1);
    i1 <<= 3;
    printf("code_assop 8 %d\n",i1);
    i1 >>= 3;
    printf("code_assop 9 %d\n",i1);

    ui1 += 3;
    printf("code_assop 1 %u\n",ui1);
    ui1 -= 3;
    printf("code_assop 2 %u\n",ui1);
    ui1 /= 3;
    printf("code_assop 3 %u\n",ui1);
    ui1 *= 3;
    printf("code_assop 4 %u\n",ui1);
    ui1 |= 234;
    printf("code_assop 5 %u\n",ui1);
    ui1 &= 23234234;
    printf("code_assop 6 %u\n",ui1);
    ui1 ^= 54234234;
    printf("code_assop 7 %u\n",ui1);
    ui1 <<= 3;
    printf("code_assop 8 %u\n",ui1);
    ui1 >>= 3;
    printf("code_assop 9 %u\n",ui1);
}



// tosop(int op,int oreg)
void
tosop()
{
    int i1,i2,i; 
    unsigned int u1,u2,u; 
    i1 = -555; i2= 555;
    u1 = 632423423; u2= 32394234;

    i = i1 + i2;
    printf("tosop 1 %d\n",i);
    i = i1 - i2;
    printf("tosop 2 %d\n",i);
    i = i1 / i2;
    printf("tosop 3 %d\n",i);
    i = i1 * i2;
    printf("tosop 4 %d\n",i);
    i = i1 | i2;
    printf("tosop 5 %d\n",i);
    i = i1 & i2;
    printf("tosop 6 %d\n",i);
    i = i1 ^ i2;
    printf("tosop 7 %d\n",i);
    i = i1 << i2;
    printf("tosop 8 %d\n",i);
    i = i1 >> i2;
    printf("tosop 9 %d\n",i);
    i = i1 % i2;
    printf("tosop 10 %d\n",i);

    u = u1 + u2;
    printf("tosop 1 %u\n",u);
    u = u1 - u2;
    printf("tosop 2 %u\n",u);
    u = u1 / u2;
    printf("tosop 3 %u\n",u);
    u = u1 * u2;
    printf("tosop 4 %u\n",u);
    u = u1 | u2;
    printf("tosop 5 %u\n",u);
    u = u1 & u2;
    printf("tosop 6 %u\n",u);
    u = u1 ^ u2;
    printf("tosop 7 %u\n",u);
    u = u1 << u2;
    printf("tosop 8 %u\n",u);
    u = u1 >> u2;
    printf("tosop 9 %u\n",u);
    u = u1 % u2;
    printf("tosop 10 %u\n",u);
}

// oprtc(int op,int v)
void
oprtc()
{
    int i1,i; 
    unsigned int u1,u; 
    i1 = -555; 
    u1 = 632423423; 

    i = i1 + 3;
    printf("oprtc 1 %d\n",i);
    i = i1 - 3;
    printf("oprtc 2 %d\n",i);
    i = i1 / 3;
    printf("oprtc 3 %d\n",i);
    i = i1 * 3;
    printf("oprtc 4 %d\n",i);
    i = i1 | 234234234;
    printf("oprtc 5 %d\n",i);
    i = i1 & 23234234;
    printf("oprtc 6 %d\n",i);
    i = i1 ^ 23234234;
    printf("oprtc 7 %d\n",i);
    i = i1 << 5;
    printf("oprtc 8 %d\n",i);
    i = i1 >> 5;
    printf("oprtc 9 %d\n",i);
    i = i1 % 5;
    printf("oprtc 10 %d\n",i);

    u = u1 + 3;
    printf("oprtc 1 %u\n",u);
    u = u1 - 3;
    printf("oprtc 2 %u\n",u);
    u = u1 / 3;
    printf("oprtc 3 %u\n",u);
    u = u1 * 3;
    printf("oprtc 4 %u\n",u);
    u = u1 | 234234234;
    printf("oprtc 5 %u\n",u);
    u = u1 & 234234234;
    printf("oprtc 6 %u\n",u);
    u = u1 ^ 234234234;
    printf("oprtc 7 %u\n",u);
    u = u1 << 5;
    printf("oprtc 8 %u\n",u);
    u = u1 >> 5;
    printf("oprtc 9 %u\n",u);
    u = u1 % 5;
    printf("oprtc 10 %u\n",u);
}


#if FLOAT_CODE
// code_cmp_dregister(int e2,int d)
void
code_cmp_dregister()
{
    register float f0,f1;
    register double d0,d1;
    f0 = 0.0; f1 = 0.2;
    d0 = 10; d1 = 10e10;
    f0 && printf("code_bool register 6\n");
    d0 && printf("code_bool register 7\n");

}

// code_dregister(int e2,int freg,int d)
void
code_dregister()
{
    register float f0,f1;
    register double d0,d1;
    f0 = 0.0; f1 = 0.2;
    d0 = 10; d1 = 10e10;
    printf("code_lvar float %f %f %g %g\n",f0,f1,d0,d1);
}

// code_dassign_gvar(int e2,int freg,int d)
// code_dassign_lvar(int e2,int freg,int d)
// code_dassign_dregister(int e2,int d,int freg) 

// code_dassign(int e2,int freg,int d)
void
code_dassign()
{
    int i1,i2; 
    float f1,f2; 
    double ui1,ui2; 
    float *pi1,*pi2; 
    double *pui1,*pui2; 

    i1 = -555; i2= 555;
    f1 = -555; f2= 555;
    ui1 = 632423423; ui2= 32394234;
    pi1 = &f1;
    pi2 = &f2;
    pui1 = &ui1;
    pui2 = &ui2;

    *(pi2+i1+i2) = 3;
    *(pui2+i1+i2) = 3;
    printf("code_dassign %g %g %g %g\n",*pi1,*pi2,*pui1,*pui2);
}

// code_dconst(int e2,int freg,int d)
// code_dneg(int freg,int d)
// code_dneg(int creg) 
void
code_dneg()
{
    float i,j;
    double di,dj;
    i = 123123123;j = -32423;
    di = 123123123;dj = -32423;
    printf("code_dneg %g %g\n",-i,-j);
    printf("code_dneg %g %g\n",-di,-dj);
}

// code_d2i(int freg0)
void
code_d2i()
{
    double d;
    int i;
    d = 0.1;
    i = d;
    printf("code_d2i %d\n",i);
}
// code_i2d(int creg0)
void
code_i2d()
{
    double d;
    int i;
    i = 242342342;
    d = i;
    printf("code_i2d %g\n",d);
}
// code_d2u(int freg0)
void
code_d2u()
{
    double d;
    unsigned int i;
    d = 0.1;
    i = d;
    printf("code_d2u %ud\n",i);
}
// code_u2d(int creg0)
void
code_u2d()
{
    double d;
    unsigned int i;
    i = 242342342;
    d = i;
    printf("code_u2d %g\n",d);
}
// code_f2i(int freg0)
void
code_f2i()
{
    float d;
    int i;
    d = 0.1;
    i = d;
    printf("code_d2i %d\n",i);
}
// code_i2f(int creg0)
void
code_i2f()
{
    float d;
    int i;
    i = 24234342;
    d = i;
    printf("code_i2f %g\n",d);
}
// code_f2u(int freg0)
void
code_f2u()
{
    float d;
    unsigned int i;
    d = 0.1;
    i = d;
    printf("code_f2u %ud\n",i);
}
// code_u2f(int creg0)
void
code_u2f()
{
    float d;
    unsigned int i;
    i = 242342342;
    d = i;
    printf("code_u2f %g\n",d);
}


// code_drgvar(int e2,int d,int freg)
void
code_dgvar()
{
    f0 = 0.0; f1 = 0.2;
    d0 = 10; d1 = 10e10;
    printf("code_gvar float %f %f %g %g\n",f0,f1,d0,d1);
    s_f0 = 0.0; s_f1 = 0.2;
    s_d0 = 10; s_d1 = 10e10;
    printf("code_gvar float %f %f %g %g\n",s_f0,s_f1,s_d0,s_d1);
}

// code_drlvar(int e2,int d,int freg)
void
code_dlvar()
{
    float f0,f1;
    double d0,d1;
    f0 = 0.0; f1 = 0.2;
    d0 = 10; d1 = 10e10;
    printf("code_lvar float %f %f %g %g\n",f0,f1,d0,d1);
    printf("code_bool > lvar float %d %d %d %d\n",
	f0>f1,f0>=f1,f0==f1,f0!=f1);
    printf("code_bool > lvar double %d %d %d %d\n",
	d0>d1,d0>=d1,d0==d1,d0!=d1);
    printf("code_bool < lvar float %d %d %d %d\n",
	f0<f1,f0<=f1,f0==f1,f0!=f1);
    printf("code_bool < lvar double %d %d %d %d\n",
	d0<d1,d0<=d1,d0==d1,d0!=d1);
}


// code_cmp_drgvar(int e2,int d)
void
code_cmp_d_global()
{
    f0 = 0.0; f1 = 0.2;
    d0 = 10; d1 = 10e10;
    f0 && printf("code_bool global 6\n");
    d0 && printf("code_bool global 7\n");
}


// code_cmp_drlvar(int e2,int d)
void
code_cmp_d()
{
    float f0,f1;
    double d0,d1;
    f0 = 0.0; f1 = 0.2;
    d0 = 10; d1 = 10e10;
    f0 && printf("code_bool local 6\n");
    d0 && printf("code_bool local 7\n");
}

// dtosop(int op,int e1)
void
dtosop()
{
    double i1,i2,i; 
    float u1,u2,u; 
    i1 = -555; i2= 555;
    u1 = 632423423; u2= 32394234;

    i = i1 + i2;
    printf("dtosop 1 %g\n",i);
    i = i1 - i2;
    printf("dtosop 2 %g\n",i);
    i = i1 / i2;
    printf("dtosop 3 %g\n",i);
    i = i1 * i2;
    printf("dtosop 4 %g\n",i);
    u = u1 + u2;
    printf("dtosop 1 %g\n",u);
    u = u1 - u2;
    printf("dtosop 2 %g\n",u);
    u = u1 / u2;
    printf("dtosop 3 %g\n",u);
    u = u1 * u2;
    printf("dtosop 4 %g\n",u);
}


// code_dassop(int op,int d) 
void
code_dassop()
{
    double i1,i2; 
    float ui1,ui2; 
    i1 = -555; i2= 555;
    ui1 = 632423423; ui2= 32394234;

    i1 += 3;
    printf("code_dassop 1 %g\n",i1);
    i1 -= 3;
    printf("code_dassop 2 %g\n",i1);
    i1 /= 3;
    printf("code_dassop 3 %g\n",i1);
    i1 *= 3;
    printf("code_dassop 4 %g\n",i1);

    ui1 += 3;
    printf("code_dassop 1 %g\n",ui1);
    ui1 -= 3;
    printf("code_dassop 2 %g\n",ui1);
    ui1 /= 3;
    printf("code_dassop 3 %g\n",ui1);
    ui1 *= 3;
    printf("code_dassop 4 %g\n",ui1);
}


// code_dpreinc(int e1,int e2,int d,int reg) 
void
code_dpreinc()
{
    double i,j;
    float ui,uj;
    i = 123123123;j = 0;
    printf("code_dpreinc d %g %g\n",++i,--j);
    ui = 123123123;uj = 0;
    printf("code_dpreinc f %g %g\n",++ui,--uj);
}

// code_dpostinc(int e1,int e2,int d,int reg) 
void
code_dpostinc()
{
    double i,j;
    float ui,uj;
    i = 123123123;j = 0;
    printf("code_dpostinc d %g %g\n",i--,j--);
    ui = 123123123;uj = 0;
    printf("code_dpostinc f %g %g\n",ui++,uj--);
}

// drexpr(int e1, int e2,int l1, int op)

// 	case DOP+GE:
// 	case FOP+GE:
// 	case DOP+GT:
// 	case FOP+GT:
// 	case DOP+EQ:
// 	case FOP+EQ:
// 	case DOP+NEQ:
// 	case FOP+NEQ:
// code_gt(int cond) 

void
code_dgt()
{
    if (d0>d1)
	printf("code_dgt 1\n");
    else
	printf("code_dgt 0\n");
}

// code_ugt(int cond) 
void
code_fgt()
{
    if (f0>f1)
	printf("code_fgt 1\n");
    else
	printf("code_fgt 0\n");
}

// code_ge(int cond) 
void
code_dge()
{
    if (d0>=d1)
	printf("code_dge 1\n");
    else
	printf("code_dge 0\n");
}

// code_uge(int cond) 
void
code_fge()
{
    if (f0>=f1)
	printf("code_fge 1\n");
    else
	printf("code_fge 0\n");
}

// code_eq(int cond) 
void
code_deq()
{
    if (f0==f1)
	printf("code_feq 1\n");
    else
	printf("code_feq 0\n");
    if (d0!=d1)
	printf("code_deq 1\n");
    else
	printf("code_deq 0\n");
}

// code_dbool(int e1) 

void
code_dbool()
{
    printf("code_bool > float %d %d %d %d\n",
	f0>f1,f0>=f1,f0==f1,f0!=f1);
    printf("code_bool > double %d %d %d %d\n",
	d0>d1,d0>=d1,d0==d1,d0!=d1);
    printf("code_bool < float %d %d %d %d\n",
	f0<f1,f0<=f1,f0==f1,f0!=f1);
    printf("code_bool < double %d %d %d %d\n",
	d0<d1,d0<=d1,d0==d1,d0!=d1);
}
#endif


#if LONGLONG_CODE
// lrexpr(int e1, int e2,int l1, int op)
void
code_lbool()
{
    printf("code_bool > long long %d %d %d %d %d %d\n",
	l1>l0,ul1>ul0,l1>=l0,ul1>=ul0,ul1==ul0,l1!=l0);
    printf("code_bool < long long %d %d %d %d %d %d\n",
	l1<l0,ul1<ul0,l1<=l0,ul1<=ul0,ul1==ul0,l1!=l0);
}

// int lpop_register()
// code_lregister(int e2,int reg)
void
code_lregister()
{
    register long long l0,l1;
    register unsigned long long ul0,ul1;
    l0 = 123123123LL;
    l1 = 123123123LL;
    ul0 = 123123123LL;
    ul1 = 123123123LL;
    printf("code_lvar long long %llu %llu %llu %llu\n",l0,l1,ul0,ul1);
}

// code_cmp_lregister(int reg)
void
code_cmp_lregister()
{
    register long long l0,l1;
    register unsigned long long ul0,ul1;
    l0 = 123123123LL;
    l1 = 123123123LL;
    ul0 = 123123123LL;
    ul1 = 123123123LL;
    l0 && printf("code_bool register 8\n");
    ul0 && printf("code_bool register 9\n");
}

// code_cmp_lrgvar(int e1,int e2)
void
code_cmp_lrgvar()
{
    l0 = 123123123LL;
    l1 = 123123123LL;
    ul0 = 123123123LL;
    ul1 = 123123123LL;
    l0 && printf("code_bool global 8\n");
    ul0 && printf("code_bool global 9\n");
}
// code_cmp_lrlvar(int e1,int e2)
void
code_cmp_lrlvar()
{
    long long l0,l1;
    unsigned long long ul0,ul1;
    l0 = 123123123LL;
    l1 = 123123123LL;
    ul0 = 123123123LL;
    ul1 = 123123123LL;
    l0 && printf("code_bool local 8\n");
    ul0 && printf("code_bool local 9\n");
}

// code_lassign(int e1,int e2)
// code_lassign_gvar(int e1,int e2)
// code_lassign_lvar(int e1,int e2)
// code_lassign_lregister(int e2,int reg)
void
code_lassign()
{
    long long i1,i2; 
    unsigned long long ui1,ui2; 
    long long *pi1,*pi2; 
    unsigned long long *pui1,*pui2; 

    i1 = -555; i2= 555;
    ui1 = 632423423; ui2= 32394234;
    pi1 = &i1;
    pi2 = &i2;
    pui1 = &ui1;
    pui2 = &ui2;

    *(pi2+i1+i2) = 3;
    *(pui2+i1+i2) = 3;
    printf("code_rindirect %lld %lld %llu %llu\n",*pi1,*pi2,*pui1,*pui2);
}

// code_lconst(int e1,int e2)
// code_lneg(int e1,int e2)
void
code_lneg()
{
    long long i,j;
    i = 123123123;j = -32423;
    printf("code_neg %lld %lld\n",-i,-j);
}

// code_lrgvar(int e1,int e2)
void
code_lrgvar()
{
    l0 = 123123123LL;
    l1 = 123123123LL;
    ul0 = 123123123LL;
    ul1 = 123123123LL;
    printf("code_lrgvar long long %lld %lld %llu %llu\n",l0,l1,ul0,ul1);
    s_l0 = 123123123LL;
    s_l1 = 123123123LL;
    s_ul0 = 123123123LL;
    s_ul1 = 123123123LL;
    printf("code_lrgvar long long %lld %lld %llu %llu\n",s_l0,s_l1,s_ul0,s_ul1);
}

// code_lrlvar(int e1,int e2)
void
code_lrlvar()
{
    long long l0,l1;
    unsigned long long ul0,ul1;
    l0 = 123123123LL;
    l1 = 123123123LL;
    ul0 = 123123123LL;
    ul1 = 123123123LL;
    printf("code_lvar long long %lld %lld %llu %llu\n",l0,l1,ul0,ul1);
    printf("code_bool lvar > long long %d %d %d %d %d %d\n",
	l1>l0,ul1>ul0,l1>=l0,ul1>=ul0,ul1==ul0,l1!=l0);
    printf("code_bool lvar < long long %d %d %d %d %d %d\n",
	l1<l0,ul1<ul0,l1<=l0,ul1<=ul0,ul1==ul0,l1!=l0);
}

// ltosop(int e1,int e2)
void
ltosop()
{
    long long i1,i2,i; 
    unsigned long long u1,u2,u; 
    int ii2;
    unsigned int uu2;
    i1 = -555; i2= 555;
    u1 = 632423423; u2= 32394234;
    ii2 = -33;
    uu2 = 33;

    i = i1 + i2;
    printf("ltosop 1 %lld\n",i);
    i = i1 - i2;
    printf("ltosop 2 %lld\n",i);
    i = i1 / i2;
    printf("ltosop 3 %lld\n",i);
    i = i1 * i2;
    printf("ltosop 4 %lld\n",i);
    i = i1 | i2;
    printf("ltosop 5 %lld\n",i);
    i = i1 & i2;
    printf("ltosop 6 %lld\n",i);
    i = i1 ^ i2;
    printf("ltosop 7 %lld\n",i);
    i = i1 << i2;
    printf("ltosop 8 %lld\n",i);
    i = i1 >> i2;
    printf("ltosop 9 %lld\n",i);
    i = i1 % i2;
    printf("ltosop 10 %lld\n",i);

    u = u1 + u2;
    printf("ltosop u 1 %llu\n",u);
    u = u1 - u2;
    printf("ltosop u 2 %llu\n",u);
    u = u1 / u2;
    printf("ltosop u 3 %llu\n",u);
    u = u1 * u2;
    printf("ltosop u 4 %llu\n",u);
    u = u1 | u2;
    printf("ltosop u 5 %llu\n",u);
    u = u1 & u2;
    printf("ltosop u 6 %llu\n",u);
    u = u1 ^ u2;
    printf("ltosop u 7 %llu\n",u);
    u = u1 << u2;
    printf("ltosop u 8 %llu\n",u);
    u = u1 >> u2;
    printf("ltosop u 9 %llu\n",u);
    u = u1 % u2;
    printf("ltosop u 10 %llu\n",u);

    i = i1 + ii2;
    printf("litosop 1 %lld\n",i);
    i = i1 - ii2;
    printf("litosop 2 %lld\n",i);
    i = i1 / ii2;
    printf("litosop 3 %lld\n",i);
    i = i1 * ii2;
    printf("litosop 4 %lld\n",i);
    i = i1 | ii2;
    printf("litosop 5 %lld\n",i);
    i = i1 & ii2;
    printf("litosop 6 %lld\n",i);
    i = i1 ^ ii2;
    printf("litosop 7 %lld\n",i);
    i = i1 << ii2;
    printf("litosop 8 %lld\n",i);
    i = i1 >> ii2;
    printf("litosop 9 %lld\n",i);
    i = i1 % ii2;
    printf("litosop 10 %lld\n",i);

    u = u1 + uu2;
    printf("litosop u 1 %llu\n",u);
    u = u1 - uu2;
    printf("litosop u 2 %llu\n",u);
    u = u1 / uu2;
    printf("litosop u 3 %llu\n",u);
    u = u1 * uu2;
    printf("litosop u 4 %llu\n",u);
    u = u1 | uu2;
    printf("litosop u 5 %llu\n",u);
    u = u1 & uu2;
    printf("litosop u 6 %llu\n",u);
    u = u1 ^ uu2;
    printf("litosop u 7 %llu\n",u);
    u = u1 << uu2;
    printf("litosop u 8 %llu\n",u);
    u = u1 >> uu2;
    printf("litosop u 9 %llu\n",u);
    u = u1 % uu2;
    printf("litosop u 10 %llu\n",u);
}

// loprtc(int op,int v)
void
loprtc()
{
    long long i1,i; 
    unsigned long long u1,u; 
    i1 = -555; 
    u1 = 632423423; 

    i = i1 + 3;
    printf("loprtc 1 %lld\n",i);
    i = i1 - 3;
    printf("loprtc 2 %lld\n",i);
    i = i1 / 32323423423LL;
    printf("loprtc 3 %lld\n",i);
    i = i1 * 323423423423LL;
    printf("loprtc 4 %lld\n",i);
    i = i1 | 234234234;
    printf("loprtc 5 %lld\n",i);
    i = i1 & 23234234;
    printf("loprtc 6 %lld\n",i);
    i = i1 ^ 23234234;
    printf("loprtc 7 %lld\n",i);
    i = i1 << 5;
    printf("loprtc 8 %lld\n",i);
    i = i1 >> 5;
    printf("loprtc 9 %lld\n",i);
    i = i1 % 5;
    printf("loprtc 10 %lld\n",i);

    u = u1 + 3;
    printf("loprtc 1 u %llu\n",u);
    u = u1 - 3;
    printf("loprtc 2 u %llu\n",u);
    u = u1 / 32342342344234LL;
    printf("loprtc 3 u %llu\n",u);
    u = u1 * 243234234232324LL;
    printf("loprtc 4 u %llu\n",u);
    u = u1 | 234234234;
    printf("loprtc 5 u %llu\n",u);
    u = u1 & 234234234;
    printf("loprtc 6 u %llu\n",u);
    u = u1 ^ 234234234;
    printf("loprtc 7 u %llu\n",u);
    u = u1 << 5;
    printf("loprtc 8 u %llu\n",u);
    u = u1 >> 5;
    printf("loprtc 9 u %llu\n",u);
    u = u1 % 5;
    printf("loprtc 10 u %llu\n",u);
}


// code_i2ll(int creg)
void
code_i2ll()
{
    long long d;
    int i;
    i = 23442342;
    d = i;
    printf("code_i2ll %lld\n",d);
}
// code_i2ull(int creg)
void
code_i2ull()
{
    unsigned long long d;
    int i;
    i = 23442342;
    d = i;
    printf("code_i2ull %lld\n",d);
}
// code_u2ll(int creg)
void
code_u2ll()
{
    long long d;
    unsigned int i;
    i = 23442342;
    d = i;
    printf("code_u2ll %lld\n",d);
}
// code_u2ull(int creg)
void
code_u2ull()
{
    unsigned long long d;
    unsigned int i;
    i = 23342342;
    d = i;
    printf("code_u2ull %llu\n",d);
}
// code_ll2i(int creg)
void
code_ll2i()
{
    long long d;
    int i;
    d = 2342342342LL;
    i = d;
    printf("code_ll2i %d\n",i);
}
// code_ll2u(int creg)
void
code_ll2u()
{
    long long d;
    unsigned int i;
    d = 2342342342LL;
    i = d;
    printf("code_ll2i %ud\n",i);
}
// code_ull2i(int creg)
void
code_ull2i()
{
    unsigned long long d;
    int i;
    d = 2342342342LL;
    i = d;
    printf("code_ull2i %d\n",i);
}
// code_ull2u(int creg)
void
code_ull2u()
{
    unsigned long long d;
    unsigned int i;
    d = 2342342342LL;
    i = d;
    printf("code_ll2i %ud\n",i);
}
#if FLOAT_CODE
// code_d2ll(int creg)
void
code_d2ll()
{
    long long d;
    double i;
    i = 2342342342LL;
    d = i;
    printf("code_d2ll %lld\n",d);
}
// code_d2ull(int creg)
void
code_d2ull()
{
    unsigned long long d;
    double i;
    i = 2342342342LL;
    d = i;
    printf("code_d2ll %llu\n",d);
}
// code_f2ll(int creg)
void
code_f2ll()
{
    long long d;
    float i;
    i = 2342342342LL;
    d = i;
    printf("code_d2ll %lld\n",d);
}
// code_f2ull(int creg)
void
code_f2ull()
{
    unsigned long long d;
    float i;
    i = 2342342342LL;
    d = i;
    printf("code_d2ll %llu\n",d);
}
// code_ll2d(int creg)
void
code_ll2d()
{
    long long d;
    double i;
    d = 2342342342LL;
    i = d;
    printf("code_d2ll %g\n",i);
}
// code_ll2f(int creg)
void
code_ll2f()
{
    long long d;
    float i;
    d = 2342342342LL;
    i = d;
    printf("code_d2ll %g\n",i);
}
// code_ull2d(int creg)
void
code_ull2d()
{
    long long d;
    double i;
    d = 2342342342LL;
    i = d;
    printf("code_d2ll %g\n",i);
}
// code_ull2f(int creg)
void
code_ull2f()
{
    long long d;
    float i;
    d = 2342342342LL;
    i = d;
    printf("code_d2ll %g\n",i);
}
#endif

// code_lpreinc(int e1,int e2,int reg)
void
code_lpreinc()
{
    long long i,j;
    i = 123123123;j = 0;
    printf("code_preinc l %lld %lld\n",++i,--j);
}

// code_lpostinc(int e1,int e2,int reg)
void
code_lpostinc()
{
    long long i,j;
    i = 123123123;j = 0;
    printf("code_postinc l %lld %lld\n",i++,j--);
}

// code_lpreinc(int e1,int e2,int reg)
void
code_lupreinc()
{
    unsigned long long i,j;
    i = 123123123;j = 0;
    printf("code_preinc l %llu %llu\n",++i,--j);
}

// code_lpostinc(int e1,int e2,int reg)
void
code_lupostinc()
{
    unsigned long long i,j;
    i = 123123123;j = 0;
    printf("code_postinc lu %llu %llu\n",i++,j--);
}

// code_lassop(int op)

// code_register_assop(int e2,int op,int byte) 
void
code_register_lassop()
{
    register long long i1; 
    register unsigned long long ui1; 
    i1 = -555;
    ui1 = 632423423;

    i1 += 3;
    printf("code_register_lassop 1 %lld\n",i1);
    i1 -= 3;
    printf("code_register_lassop 2 %lld\n",i1);
    i1 /= 3;
    printf("code_register_lassop 3 %lld\n",i1);
    i1 *= 3;
    printf("code_register_lassop 4 %lld\n",i1);
    i1 |= 234;
    printf("code_register_lassop 5 %lld\n",i1);
    i1 &= 2324234234234234LL;
    printf("code_register_lassop 6 %lld\n",i1);
    i1 ^= 5523234234234234LL;
    printf("code_register_lassop 7 %lld\n",i1);
    i1 <<= 3;
    printf("code_register_lassop 8 %lld\n",i1);
    i1 >>= 3;
    printf("code_register_lassop 9 %lld\n",i1);

    ui1 += 3;
    printf("code_register_lassop 1 %llu\n",ui1);
    ui1 -= 3;
    printf("code_register_lassop 2 %llu\n",ui1);
    ui1 /= 3;
    printf("code_register_lassop 3 %llu\n",ui1);
    ui1 *= 3;
    printf("code_register_lassop 4 %llu\n",ui1);
    ui1 |= 234;
    printf("code_register_lassop 5 %llu\n",ui1);
    ui1 &= 2324234234234234LL;
    printf("code_register_lassop 6 %llu\n",ui1);
    ui1 ^= 5523234234234234LL;
    printf("code_register_lassop 7 %llu\n",ui1);
    ui1 <<= 3;
    printf("code_register_lassop 8 %llu\n",ui1);
    ui1 >>= 3;
    printf("code_register_lassop 9 %llu\n",ui1);
}

// code_lassop(int op,int byte,int sign) 
void
code_lassop()
{
    long long i1,i2; 
    unsigned long long ui1,ui2; 
    i1 = -555; i2= 555;
    ui1 = 632423423; ui2= 32394234;

    i1 += 3;
    printf("code_lassop 1 %lld\n",i1);
    i1 -= 3;
    printf("code_lassop 2 %lld\n",i1);
    i1 /= 3;
    printf("code_lassop 3 %lld\n",i1);
    i1 *= 3;
    printf("code_lassop 4 %lld\n",i1);
    i1 |= 234;
    printf("code_lassop 5 %lld\n",i1);
    i1 &= 2324234234234234LL;
    printf("code_lassop 6 %lld\n",i1);
    i1 ^= 5523234234234234LL;
    printf("code_lassop 7 %lld\n",i1);
    i1 <<= 3;
    printf("code_lassop 8 %lld\n",i1);
    i1 >>= 3;
    printf("code_lassop 9 %lld\n",i1);

    ui1 += 3;
    printf("code_lassop 1 %llu\n",ui1);
    ui1 -= 3;
    printf("code_lassop 2 %llu\n",ui1);
    ui1 /= 3;
    printf("code_lassop 3 %llu\n",ui1);
    ui1 *= 3;
    printf("code_lassop 4 %llu\n",ui1);
    ui1 |= 234;
    printf("code_lassop 5 %llu\n",ui1);
    ui1 &= 2324234234234234LL;
    printf("code_lassop 6 %llu\n",ui1);
    ui1 ^= 5523234234234234LL;
    printf("code_lassop 7 %llu\n",ui1);
    ui1 <<= 3;
    printf("code_lassop 8 %llu\n",ui1);
    ui1 >>= 3;
    printf("code_lassop 9 %llu\n",ui1);
}

// code_lgt(int cond) 

void
code_lgt()
{
    if (l0>l1)
	printf("code_lgt 1\n");
    else
	printf("code_lgt 0\n");
}

// code_lugt(int cond) 
void
code_lugt()
{
    if (ul0>ul1)
	printf("code_lugt 1\n");
    else
	printf("code_lugt 0\n");
}

// code_lge(int cond) 
void
code_lge()
{
    if (l0>=l1)
	printf("code_lge 1\n");
    else
	printf("code_lge 0\n");
}

// code_luge(int cond) 
void
code_luge()
{
    if (ul0>=ul1)
	printf("code_luge 1\n");
    else
	printf("code_luge 0\n");
}

// code_leq(int cond) 
void
code_leq()
{
    if (ul0==ul1)
	printf("code_leq 1\n");
    else
	printf("code_leq 0\n");
    if (l0!=l1)
	printf("code_lneq 1\n");
    else
	printf("code_lneq 0\n");
}



#endif
/* end */