|
原帖由 SM5 于 2007-3-5 14:44 发表
G80的int指令只有24bit精度?不是32bit的么?:o
http://we.pcinlife.com/viewthread.php?tid=715490
32-bit integer multiplication takes 8 clock cycles, but __mul24 and __umul24 (see Appendix A) provide signed and unsigned 24-bit integer multiplication in 2 clock cycles. Integer division and modulo operation are particularly costly and should be avoided if possible or replaced with bitwise operations whenever possible: If n is apower of 2, (i/n) is equivalent to (i>>log2(n)) and (i%n) is equivalent to (i&(n-1)); the compiler will perform these conversions if n is literal. |
|