Re: [PATCH] target/loongarch: Avoid shifting with bool type variable

2024-09-13 Thread maobibo
On 2024/9/14 上午10:58, Richard Henderson wrote: On 9/13/24 18:43, Bibo Mao wrote: Variable env->cf[i] is defined as bool type, it cannot be used with left shifting operation. Not true; it promotes to 'int'.  But that isn't wide enough for the value that you're trying to construct. yeap, yo

Re: [PATCH] target/loongarch: Avoid shifting with bool type variable

2024-09-13 Thread Richard Henderson
On 9/13/24 18:43, Bibo Mao wrote: Variable env->cf[i] is defined as bool type, it cannot be used with left shifting operation. Not true; it promotes to 'int'. But that isn't wide enough for the value that you're trying to construct. There is existing api read_fcc(), it can be used when du

[PATCH] target/loongarch: Avoid shifting with bool type variable

2024-09-13 Thread Bibo Mao
Variable env->cf[i] is defined as bool type, it cannot be used with left shifting operation. There is existing api read_fcc(), it can be used when dumping fp registers into coredump note segment. Resolves: Coverity CID 1561133 Signed-off-by: Bibo Mao --- target/loongarch/arch_dump.c | 6 +-