Re: [myrinet] division operation

Timothy Sirianni <[email protected]>
Newsgroups gmane.network.myrinet.general
Message-ID <[email protected]>
The compiler can do the math at compile-time since both operands of the
division are constants.

Tim

>From [email protected]  Thu Nov 29 14:53:06 2001
>
>
>Considering that there's no division in the LANai instruction set, I
>find interesting that in the file gmcp.c, part of the mcp code uses
>divisions. Anybody knows why is that? 
>
>In particular, here's part of the code:
>
>static inline void
>gm_ethernet_addr_table_set (unsigned int node_id, gm_u8_t *addr)
>{
>  gm_dp_t entry_logical_addr;
>  gm_dp_t piece;
>
>  /* compute logical address of addr table entry, aborting if not possible. */
>  piece = gm.ethernet.addr_table_piece[node_id / (GM_PAGE_LEN / 8)];
>
>  /* Catch case where MCP supports ethernet, but host does not */
>  if (!piece)
>    return;
>
>  entry_logical_addr = piece + 8 * (node_id % (GM_PAGE_LEN / 8));
>
>  /* Copy the ethernet address to a known 8-byte aligned buffer with
>     the last two bytes cleared. */
>  ether_addr_copy (addr, gm.ethernet.addr_stage);
>  gm.ethernet.addr_stage[6] = gm.ethernet.addr_stage[7] = 0;
>
>  /* wait for DMA engine to be free */
>  await_free_DMA_engine ();
>
>  /* DMA the address to the host. */
>  start_RDMA (&gm.ethernet.addr_stage,
>	      entry_logical_addr,
>	      8);
>}
>
>Any comments are appreciated. 
>Thanks. 
>
>-- 
>Edgar A. Lesn
>
>(:)-) likes to scuba dive
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.