On Thu, Apr 18, 2024 at 11:14:42AM +0800, Kewen.Lin wrote: > on 2024/4/18 10:01, HAO CHEN GUI wrote: > > This patch replace bcdadd. with bcdsub. for bcd invalid number checking. > > bcdadd on two same numbers might cause overflow which also set > > overflow/invalid bit so that we can't distinguish it's invalid or overflow. > > The bcdsub doesn't have the problem as subtracting on two same number never > > causes overflow. > > > > Bootstrapped and tested on powerpc64-linux BE and LE with no > > regressions. Is it OK for the trunk? > > Considering that this issue affects some basic functionality of bcd bifs > and the fix itself is simple and very safe, OK for trunk, thanks for fixing!
Yup. If a number X is invalid the X-X calculation might set the overflow flag as well, but we cannot see that difference at all anyway, it always has set the invalid flag after all. Thanks! Segher