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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_70/] [or1ksim/] [cuc/] [cuc.c] - Diff between revs 932 and 933

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 932 Rev 933
Line 40... Line 40...
  1, 1, 0, 1, 0, 1, 0, 1,
  1, 1, 0, 1, 0, 1, 0, 1,
  0, 1, 0, 1, 0, 1, 0, 1,
  0, 1, 0, 1, 0, 1, 0, 1,
  0, 1, 0, 1, 0, 1, 0, 1,
  0, 1, 0, 1, 0, 1, 0, 1,
  1, 1};
  1, 1};
 
 
 
/* returns log2(x) */
 
int log2 (unsigned long x)
 
{
 
  int c = 0;
 
  assert (x >= 0);
 
  if (!x) return 0; /* not by the book, but practical */
 
  while (x != 1) x >>= 1, c++;
 
  return c;
 
}
 
 
/* Does all known instruction optimizations */
/* Does all known instruction optimizations */
void cuc_optimize (cuc_func *func)
void cuc_optimize (cuc_func *func)
{
{
  int modified = 0;
  int modified = 0;
  log ("Optimizing.\n");
  log ("Optimizing.\n");
  insert_conditional_facts (func);
  insert_conditional_facts (func);
 
  if (cuc_debug >= 3) print_cuc_bb (func, "AFTER_COND_FACT");
  do {
  do {
    modified = 0;
    modified = 0;
    if (optimize_cmovs (func)) {
    if (optimize_cmovs (func)) {
      if (cuc_debug >= 6) print_cuc_bb (func, "AFTER_OPT_CMOVS");
      if (cuc_debug >= 6) print_cuc_bb (func, "AFTER_OPT_CMOVS");
      modified = 1;
      modified = 1;

powered by: WebSVN 2.1.0

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