This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, GCC/ARM] Remove ARMv8-M code for D17-D31
- From: Thomas Preudhomme <thomas dot preudhomme at foss dot arm dot com>
- To: "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>, Kyrill Tkachov <kyrylo dot tkachov at arm dot com>, Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 29 Jun 2017 09:44:40 +0100
- Subject: Re: [PATCH, GCC/ARM] Remove ARMv8-M code for D17-D31
- Authentication-results: sourceware.org; auth=none
- References: <a83e0a14-3c4d-1df8-8210-22fbe1dd3fb8@foss.arm.com> <faba24a3-e07d-403d-b3ba-cc725fcdc742@arm.com>
Hi Richard,
On 28/06/17 16:56, Richard Earnshaw (lists) wrote:
On 20/06/17 16:01, Thomas Preudhomme wrote:
Hi,
Function cmse_nonsecure_entry_clear_before_return has code to deal with
high VFP register (D16-D31) while ARMv8-M Baseline and Mainline both do
not support more than 16 double VFP registers (D0-D15). This makes this
security-sensitive code harder to read for not much benefit since
libcall for cmse_nonsecure_call functions do not deal with those high
VFP registers anyway.
This commit gets rid of this code for simplicity and fixes 2 issues in
the same function:
- stop the first loop when reaching maxregno to avoid dealing with VFP
registers if targetting Thumb-1 or using -mfloat-abi=soft
- include maxregno in that loop
This is silently baking in dangerous assumptions about GCC's internal
numbering of the registers. That's not a good idea from a long-term
portability perspective.
At the very least you need to assert that all the interesting registers
are numbered in the range 0..63; but ideally the code should just handle
pretty much any assignment of internal register numbers.
Well there is already this:
gcc_assert ((unsigned) maxregno <= sizeof (to_clear_mask) * __CHAR_BIT__);
Did you consider using sbitmaps rather than doing all the multi-word
stuff by steam?
No but am happy to. I'll respin the patch.
Best regards,
Thomas