Hi, On 16/6/2022 下午 7:24, Segher Boessenkool wrote: > There is no normal way to get at bit 3 of a CR field. We can use some > unspec though, which is total cheating but it does work, and it is > safe, albeit sometimes suboptimal.
Thanks so much for your advice. I will use an unspec for setting reg from the BCD overflow bit. > > You shouldn't need anything like this, bcdinvalid will work just fine if > written as bcdadd_ov (with vector of 0 as the second op)? The vector of 0 is not equal to BCD 0, I think. The BCD number contains preferred sign (PS) bit. So all zeros itself is an invalid encoding. We may use bcdsub_ov with duplicated op to implement bcdinvalid.