OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [pr28489.c] - Blame information for rev 856

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
typedef int c_int;
2
union c_insn
3
{
4
  void (*op) ();
5
  c_int *mem;
6
  c_int imm;
7
};
8
static union c_insn c_stack[((0x100 + 4) * 4)];
9
static struct c_ident *c_funcs;
10
static void (*c_op_bz) ();
11
static void c_direct (union c_insn *addr);
12
c_compile (int (*ext_getchar) (), void (*ext_rewind) (),
13
           struct c_ident *externs)
14
{
15
  c_direct (((void *) 0));
16
}
17
static void
18
c_direct (union c_insn *addr)
19
{
20
  union c_insn *pc = addr;
21
  union c_insn *sp = c_stack;
22
  c_int imm = 0;
23
  static void *ops[] = {
24
    &&op_index, &&op_assign, &&op_add_a, &&op_sub_a, &&op_mul_a, &&op_div_a,
25
      &&op_mod_a, &&op_or_a, &&op_xor_a, &&op_and_a, &&op_shl_a, &&op_shr_a,
26
  };
27
    {
28
      c_op_bz = &&op_bz;
29
    }
30
  goto *(pc++)->op;
31
op_bz:if (imm)
32
    {
33
    }
34
op_push_imm_imm:(sp - 2)->imm = imm;
35
  goto *(pc - 1)->op;
36
op_index:imm = *((sp - 3)->mem += imm);
37
op_assign:*(sp - 3)->mem = imm;
38
op_add_a:imm = *(sp - 3)->mem += imm;
39
op_sub_a:imm = *(sp - 3)->mem -= imm;
40
op_mul_a:imm = *(sp - 3)->mem *= imm;
41
op_div_a:imm = *(sp - 3)->mem /= imm;
42
op_mod_a:imm = *(sp - 3)->mem %= imm;
43
op_or_a:imm = *(sp - 3)->mem |= imm;
44
op_xor_a:imm = *(sp - 3)->mem ^= imm;
45
op_and_a:imm = *(sp - 3)->mem &= imm;
46
op_shl_a:imm = *(sp - 3)->mem <<= imm;
47
op_shr_a:imm = *(sp - 3)->mem >>= imm;
48
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.