[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 20/36] target/riscv: Add support for virtual interrupt set
Re: [PATCH v1 20/36] target/riscv: Add support for virtual interrupt setting
Fri, 10 Jan 2020 15:21:48 -0800 (PST)
On Wed, 08 Jan 2020 18:33:40 PST (-0800), address@hidden wrote:
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
(3) We build with -fwrapv, so we're explicitly asking for sane behaviour from
our signed types as well.
Ah, thanks -- I didn't know we had -fwrapv. In that case we're safe!