[Bug rtl-optimization/109592] Failure to recognize shifts as sign/zero extension

2023-05-30 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109592 --- Comment #10 from Jeffrey A. Law --- Created attachment 55218 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55218&action=edit (Incomplete) Patch

[Bug rtl-optimization/109592] Failure to recognize shifts as sign/zero extension

2023-05-30 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109592 --- Comment #9 from Jeffrey A. Law --- Weird, I don't see the attachment either. I'll extract & upload it again. WRT costing. fwprop and combine will both query the target rtx costs and will reject when the target costing model indicates the

[Bug rtl-optimization/109592] Failure to recognize shifts as sign/zero extension

2023-05-29 Thread wangfeng at eswincomputing dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109592 --- Comment #8 from Feng Wang --- (In reply to Jeffrey A. Law from comment #7) > Attached is what I cobbled together. It doesn't use magic numbers. But it > doesn't yet handle zero extensions in the simplify-rtx code. But I think it > shows t

[Bug rtl-optimization/109592] Failure to recognize shifts as sign/zero extension

2023-05-29 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109592 --- Comment #7 from Jeffrey A. Law --- Attached is what I cobbled together. It doesn't use magic numbers. But it doesn't yet handle zero extensions in the simplify-rtx code. But I think it shows the overall direction fairly well.

[Bug rtl-optimization/109592] Failure to recognize shifts as sign/zero extension

2023-05-11 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109592 --- Comment #6 from Jeffrey A. Law --- I would still rather not introduce special cases for SUBREGs if we can avoid it. I think the question remains whether or not patching simplify-rtx's canonicalize_shift is sufficient to fix this problem (pe

[Bug rtl-optimization/109592] Failure to recognize shifts as sign/zero extension

2023-05-11 Thread wangfeng at eswincomputing dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109592 --- Comment #5 from Feng Wang --- I found something interesting, these operations such as zero_extend,sign_extend,zero_extract,sign_extract will be considered as compound operation and will transform to the approriate shifts and AND operations(T

[Bug rtl-optimization/109592] Failure to recognize shifts as sign/zero extension

2023-04-28 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109592 --- Comment #4 from Jeffrey A. Law --- If we need to handle subregs here, I would suggest something like this if (SUBREG_P (XEXP (op0, 0)) && subreg_lowpart_p (op0) ... other tests ... That way we know we're extracting the low word of

[Bug rtl-optimization/109592] Failure to recognize shifts as sign/zero extension

2023-04-24 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109592 Richard Biener changed: What|Removed |Added Last reconfirmed||2023-04-24 Status|UNCONFIR

[Bug rtl-optimization/109592] Failure to recognize shifts as sign/zero extension

2023-04-23 Thread wangfeng at eswincomputing dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109592 --- Comment #2 from Feng Wang --- (In reply to Feng Wang from comment #1) > Hi Jeff, > > I have modified some code according to your suggestion. > In simplify-rtx.cc I add below part in canonicalize_shift: > if ((code == ASHIFTRT) >

[Bug rtl-optimization/109592] Failure to recognize shifts as sign/zero extension

2023-04-23 Thread wangfeng at eswincomputing dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109592 Feng Wang changed: What|Removed |Added CC||wangfeng at eswincomputing dot com --- Com