On Sun, 16 Aug 2020, Pip Cet via Gcc wrote: > For example, here's what I currently have: > > (define_expand "mov<mode>" > [(parallel [(set (match_operand:MOVMODE 0 "nonimmediate_operand" "") > (match_operand:MOVMODE 1 "general_operand" "")) > (clobber (reg:CC REG_CC))])] > ...) > > (define_insn "mov<mode>_insn" > [(set (match_operand:ALL1 0 "nonimmediate_operand" "=r,r ,d ,Qm > ,r ,q,r,*r") > (match_operand:ALL1 1 "nox_general_operand" "r,Y00,n Ynn,r > Y00,Qm,r,q,i")) > (clobber (match_scratch:CC 2 "=X,c,X,c,c,X,X,c"))] > ...) > > That works, but it results in an incorrect CC clobber for, say, > register-to-register movqi. For that, I'd need something like
Another way to re-use an existing "cc" attribute from cc0 times is like I did in a82c9fb3f70 (supporting machinery and movsi usage), minimizing code edits and duplication when using it for CC-setting insns. For an example of that, see the subsequent commit a33649e6664. (Just decorate the insn name with the appropriate define_subst ornament!) I'll be quiet now, but good luck. brgds, H-P