This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC PR43721] Optimize a/b and a%b to single divmod call
- From: Jim Wilson <jim dot wilson at linaro dot org>
- To: Richard Biener <rguenther at suse dot de>
- Cc: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>, Kugan Vivekanandarajah <kugan dot vivekanandarajah at linaro dot org>, Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, richard dot sandiford at arm dot com
- Date: Sun, 31 Jan 2016 21:01:30 -0800
- Subject: Re: [RFC PR43721] Optimize a/b and a%b to single divmod call
- Authentication-results: sourceware.org; auth=none
- References: <CAAgBjMmSzFUwa8W2Tc6GzGcA3nTZ_7oOfyB-UPmRLtfKXioUMQ at mail dot gmail dot com> <CAAgBjM=XtqUa60TOdRXnpMkMcGO7fAupbuYWGmTPbt_qkkOrgQ at mail dot gmail dot com> <CAAgBjMmF4kUK2Uovw=rxYF1vpjAmfzFTsXQaRj9yj7v+ep1-Ag at mail dot gmail dot com> <alpine dot LSU dot 2 dot 11 dot 1511021342240 dot 10078 at zhemvz dot fhfr dot qr> <CAAgBjMmB=ow24szF+qW01+ordKGcOEHRLcx5fLyQnzvHND0fow at mail dot gmail dot com> <alpine dot LSU dot 2 dot 11 dot 1511041546420 dot 10078 at zhemvz dot fhfr dot qr> <CAAgBjMnL__ZhkLZG=kOL3xrf-s6gGvW6EGBvqeizrE0WDdQ8Zg at mail dot gmail dot com> <alpine dot LSU dot 2 dot 11 dot 1511101522180 dot 10078 at zhemvz dot fhfr dot qr> <CAAgBjM=9Uu_=SQp+v6nM3xK_7Eg6AFcDTfVO2EQP_Z_vUeg93g at mail dot gmail dot com> <alpine dot LSU dot 2 dot 11 dot 1511111127310 dot 4884 at t29 dot fhfr dot qr> <CAAgBjMn2MtfChCkk0ZQ-n10t_gzHviUBu+NDZNfLNFBmT35xAw at mail dot gmail dot com> <alpine dot LSU dot 2 dot 11 dot 1511111429220 dot 4884 at t29 dot fhfr dot qr> <CAAgBjM=FZEoU2c+OAnunCx4teZdBXOxAwyf5V3BFSD1PL08vUg at mail dot gmail dot com> <alpine dot LSU dot 2 dot 11 dot 1601281434470 dot 31122 at t29 dot fhfr dot qr> <CABXYE2VZ+jpy=2YDdYK9udy3iObXWNrnpUh0wTk3YGU+C9PFuw at mail dot gmail dot com> <alpine dot LSU dot 2 dot 11 dot 1601290906220 dot 31122 at t29 dot fhfr dot qr>
On Fri, Jan 29, 2016 at 12:09 AM, Richard Biener <rguenther@suse.de> wrote:
> I wonder if rather than introducing a target hook ports could use
> a define_expand expanding to a libcall for this case?
Of the two divmod libcall APIs, one requires a stack temporary, which
would be awkward to allocate in a define_expand. Though we could have
expand_twoval_binop implement the libgcc udivmoddi4 API which requires
a stack temp, and then add an ARM divmod expander that implements the
ARM API which has a double-wide result. That sounds like it could
work.
Jim