View Single Post
  #5   Spotlight this post!  
Unread 27-02-2005, 00:51
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Which is faster?

Nate, x86 has a built in divide instruction, while the PIC does not, so I'd expect both to be similar in number of instructions on x86 but not on the PIC. You didn't say how long each took though, because the divide instruction will take several cycles to execute.

Gary, You can put both in your code and compare them in the list file. That will give you the exact answer for the PIC.

Also, is it absolutely necessary to divide by 126? It would be much faster to divide by 128, which boils down to a rotate and an AND.