2019-03-12 22:28:36 |
Dominic Plunkett |
description |
If you have an area of memory which is greater than 2Gbytes with a start and end pointers. Then if you do end -start
the compiler generates a signed shift right ASR and thus bit 31 stays set. The compiler needs to check for a carry from the subtraction and either do ASR #2 or LSR #2
See below for an example.
https://godbolt.org/z/iVE4J5 |
32bit gcc 8.2 -o2
If you have an area of memory which is greater than 2Gbytes with a start and end pointers. Then if you do end -start
the compiler generates a signed shift right ASR and thus bit 31 stays set. The compiler needs to check for a carry from the subtraction and either do ASR #2 or LSR #2
See below for an example.
https://godbolt.org/z/iVE4J5 |
|