Hi Thomas, Do you particularly need a switch for this? You could view this as simply relaxing the ABI requirements of a module, a switch would only serve to enforce the need for a compatible ABI and error if not. If you build something for a soft-float ABI and never actually trigger any of the soft-float specific parts of the ABI then you could safely mark the module as no-float ABI (same for hard-float). A simple check would be if floating point types are used in parameters or returns but actually it could be more refined still if none of the arguments or returns would be passed differently between the ABI types. The problem with relaxing the ABI is that you only know whether it can be relaxed at the end of compiling all functions, I am currently doing some work for MIPS where the assembler will be calculating overall requirements based on an initial setting and then analysis of the code in the module. To relax a floating point ABI I would expect to emit an ABI attribute at the head of a file, which is either soft or hard float, but then each function would get an attribute to say if it ended up as a compatible ABI. If all global functions say compatible then the module can be relaxed to be a compatible FP ABI.
I think the ability to detect the case of generating ABI agnostic code would be useful for other architectures too. MIPS does have an option for something similar to this which is -mno-float but it does not really do what you are aiming for here. The -mno-float option marks a module as float ABI agnostic but actually performs code gen for a soft-float ABI. It is up to the programmer to avoid floating point in function signatures. Perhaps this option would be useful to support the enforced compatible ABI but being able to relax the ABI is better still as it would require no effort from the end user. I'm planning on proposing these kind of changes for MIPS in the near future. Regards, Matthew > -----Original Message----- > From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf Of > Thomas Preudhomme > Sent: 04 March 2014 07:02 > To: gcc@gcc.gnu.org > Subject: [RFC][ARM] Naming for new switch to check for mixed > hardfloat/softfloat compat > > [Please CC me as I'm not subscribed to this list] > > Hi there, > > I'm currently working on adding a switch to check whether public > function involve float parameters or return values. Such a check would > be useful for people trying to write code that is compatible with both > base standard (softfloat) and standard variant (hardfloat) ARM calling > convention. I also intend to set the ELF attribute Tag_ABI_VFP_args to > value 3 (code compatible with both ABI) so this check would allow to > make sure such value would be set. > > I initially thought about reusing -mfloat-abi with the value none for > that purpose since it would somehow define a new ABI where no float can > be used. However, it would then not be possible to forbit float in > public interface with the use of VFP instructions for float arithmetic > (softfp) because this switch conflates the float ABI with the use of a > floating point unit for float arithmetic. Also, gcc passes -mfloat-abi > down to the assembler and that would mean teaching the assembler about - > mfloat-abi=none as well. > > I thus think that a new switch would be better and am asking for your > opinion about it as I would like this functionality to incorporate gcc > codebase. > > Best regards, > > Thomas Preud'homme