|
|
Darren New <dne### [at] sanrrcom> wrote:
> > For example accessing the nth element of an array can usually be done
> > with a simple CPU opcode. However, if the system restricts this because
> > it cannot prove what that n might contain, it means that the compiler
> > cannot generate the single opcode for accessing that array, but must
> > perform something much more complicated to keep the system happy.
> Right. They actually check this, and discover it's about a 4% overhead
> to do the checks in software. And it's about a 6% overhead to do the
> checks in hardware. Where Is Your God Now? Mwa ha ha ha! ;-)
I have really hard time believing that if you, for example, calculate
the sum of all the integers in an array, adding boundary checks to every
single read operation will add only 4% of overhead.
Even if the boundary check would take 1 clock cycle, that would mean
that reading the value from the array and adding its value to a register
takes 25 clock cycles.
--
- Warp
Post a reply to this message
|
|