On 18 March 2014 14:39, Richard Henderson <[email protected]> wrote: > On 03/18/2014 07:25 AM, Peter Maydell wrote: >> Why do you think this? tcg/README says out of >> range shifts are undefined behaviour. That means we >> mustn't execute them, and this code doesn't attempt >> to branch around or otherwise avoid the shift by -1. > > Bah. Stuff and nonsense. None of our backends are so > stupid as to start WWIII with an out of range input.
Then we should document that this case is an unspecified-result, not use the same term we do for division-by-zero or division-overflow (which really can cause things to blow up). > For most backends, the shift count gets (partially) > masked as it is inserted into the immediate field. The interesting question is not immediate shifts but variable ones. It's trivially easy for the frontend to avoid passing out of range immediate values and for the backend to screen them out. This case is a variable shift TCG op. thanks -- PMM
