On 1/9/20 11:49 AM, Palmer Dabbelt wrote: >> + irqs = (pending & ~env->mideleg & -mie) | (pending & env->mideleg & >> -sie); > > Isn't "-unsigned" implementation defined? I can't get GCC to throw a warning > and it was already there, so maybe I'm just wrong?
(1) You're confusing implementation defined with undefined, and unsigned arithmetic is the former not the latter. (2) There is no such thing as ones-compliment or sign-magnitude integer hardware anymore, so for this case "implementation defined" is in fact universal. (3) We build with -fwrapv, so we're explicitly asking for sane behaviour from our signed types as well. r~
