Back to index

cell-binutils  2.17cvs20070401
Defines | Functions | Variables
test-example.c File Reference
#include "../all/test-gen.c"

Go to the source code of this file.

Defines

#define namedregs(shift)   reg_r (named_regs, shift, 0x3, mk_get_bits (2u))
#define numberedregs(shift)   reg_p ("f", shift, mk_get_bits (2u))
#define jmp_cond(shift)   { jmp_cond, { i1: shift } }
#define cond_jmp_insn(insname, word, funcs...)

Functions

int jmp_cond (func_arg *arg, insn_data *data)
 cond_jmp_insn (j, 0x40, numberedregs(2), comma, namedregs(0))
int main (int argc, char *argv[])

Variables

char * named_regs [] = { "a", "b", "c", "d" }
funcjmp_insns []
group_t groups []

Define Documentation

#define cond_jmp_insn (   insname,
  word,
  funcs... 
)
Value:
define_insn (insname, \
              insn_size_bits (insname, 1, word), \
              jmp_cond (4), \
              tab, \
              ## funcs)

Definition at line 48 of file test-example.c.

#define jmp_cond (   shift)    { jmp_cond, { i1: shift } }
#define namedregs (   shift)    reg_r (named_regs, shift, 0x3, mk_get_bits (2u))

Definition at line 27 of file test-example.c.

#define numberedregs (   shift)    reg_p ("f", shift, mk_get_bits (2u))

Definition at line 29 of file test-example.c.


Function Documentation

cond_jmp_insn ( j  ,
0x40  ,
numberedregs(2)  ,
comma  ,
namedregs(0)   
)
int jmp_cond ( func_arg arg,
insn_data data 
)

Definition at line 34 of file test-example.c.

                        { jmp_cond, { i1: shift } }
{
  static const char conds[4][2] = { "z", "n", "g", "l" };
  unsigned val = get_bits (2u);

  data->as_in = data->dis_out = strdup (conds[val]);
  data->bits = val << arg->i1;

  /* Do not forget to return 0, otherwise the insn will be skipped.  */
  return 0;
}

Here is the call graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 74 of file test-example.c.

{
  FILE *as_in = stdout, *dis_out = stderr;

  /* Check whether we're filtering insns.  */
  if (argc > 1)
    skip_list = argv + 1;

  /* Output assembler header.  */
  fputs ("\t.text\n"
        "\t.align\n",
        as_in);
  /* Output comments for the testsuite-driver and the initial
     disassembler output.  */
  fputs ("#objdump: -dr --prefix-address --show-raw-insn\n"
        "#name: Foo Digital Processor\n"
        "#as: -mfood\n"
        "\n"
        "# Test the instructions of FooD\n"
        "\n"
        ".*: +file format.*food.*\n"
        "\n"
        "Disassembly of section .text:\n",
        dis_out);

  /* Now emit all (selected) insns.  */
  output_groups (groups, as_in, dis_out);

  exit (0);
}

Here is the call graph for this function:


Variable Documentation

Initial value:
  {
    { "jumps", jmp_insns },
    { 0 }
  }

Definition at line 67 of file test-example.c.

Initial value:
  {
    insn (j),
    0
  }

Definition at line 59 of file test-example.c.

char* named_regs[] = { "a", "b", "c", "d" }

Definition at line 24 of file test-example.c.