|
From: Bernhard H. <Ber...@be...> - 2003-07-15 05:42:25
|
> So I understand that the mov command given above would not work, since it > never performs the read on the SFR. In my case I don't need the read, so to > avoid it I'll have to change the way my macro works. For the general case > though, wouldn't the following be correct? > > mov a,_P_Data ; Read the SFR into A > ; (or any register, if we can't trash A) > mov _P_Data,_main_response_1_1 ; Directly write the optimized result Ack. > To get to this optimization, you would have to go ahead and do constant > propagation for (P_Data&~P_Data_On_Mask) = 0x00. Then during dead code > elimination, we make sure that the read from the SFR is not killed as dead > code. I'm guessing this is the current bug you are talking about? So, I > think if you make sure the SFR read isn't killed, then the rest of the > optimizations may already be able to get it to the two lines I gave above. Yes. Bernhard |