#49273 - ymalik - Thu Jul 28, 2005 12:26 am
When I use the % operator, is swi 6 called? If not, how is it being done, and is it slower than using the bios function?
Thanks,
Yasir
Thanks,
Yasir
| ymalik wrote: |
| When I use the % operator, is swi 6 called? |
| Quote: |
| If not, how is it being done |
| Quote: |
| and is it slower than using the bios function? |
| poslundc wrote: | ||||
No.
Using the GCC division algorithm. |
| tepples wrote: |
| Doesn't the latest version of devkitARM's libgba route the / and % operators through the BIOS in many cases? |
| poslundc wrote: |
|
1. You can beat the BIOS with your own routine. |
| Quote: |
|
2. You can get something very near to modulus with the bitwise-AND operator where the divisor is an even power of two. Eg. (x & 31) == (x % 32) for all positive values of x (negative values will "wrap around", which they don't do with modulus, but is actually a useful functionality). |
| ymalik wrote: | ||
How does the BIOS do it? |