Re: __ucmpdi2

From: Albert D. Cahalan (acahalan@cs.uml.edu)
Date: Wed Sep 20 2000 - 02:15:58 EST


Jeremy Higdon writes:

> In reality, the switch does a 60 bit shift right, so I can cast to a
> uint, which is the right thing to do on old architectures :-), solving
> the problem. I had originally thought that the problem was in all the
> masks, shifts, and compares, but they are all inlined.

Well, what do you care about most? The problem can be solved in
other, more disturbing ways. :-) For example, gcc's computed goto.

uint64_t
former_user_of___ucmpdi2(uint64_t node, uint64_t port){
  static const void *jumps[16] = {
    &&case_foo, /* 0 */
    &&case_foo, /* 1 */
    &&case_foo, /* 2 */
    &&case_foo, /* 3 */
    &&case_foo, /* 4 */
    &&case_foo, /* 5 */
    &&case_foo, /* 6 */
    &&case_foo, /* 7 */
    &&case_bar, /* 8 */
    &&case_bar, /* 9 */
    &&case_bar, /* a */
    &&case_bar, /* b */
    &&case_baz, /* c */
    &&case_baz, /* d */
    &&case_xxx, /* e */
    &&case_yyy /* f */
  };

  goto *(jumps[node>>60]);
  
  case_foo:
    /* foo code here */
    return 42;

  case_bar:
    /* bar code here */
    return 18;

  case_baz:
    /* baz code here */
    return 34;

  case_xxx:
    /* xxx code here */
    return 63;

  case_yyy:
    /* yyy code here */
    return 81;

}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 21:00:22 EST