Skip to content
Snippets Groups Projects
  • Richard Earnshaw's avatar
    fd9058b6
    arm: Fix an incorrect warning when -mcpu=cortex-a55 is used with -mfloat-abi=soft · fd9058b6
    Richard Earnshaw authored
    When a CPU such as cortex-a55 is used with the soft-float ABI variant,
    the compiler is incorrectly issuing a warning about a mismatch between
    the architecture (generated internally) and the CPU.  This is not
    expected or intended.
    
    The problem stems from the fact that we generate (correctly) an
    architecture for a soft-float compilation, but then try to compare it
    against the one recorded for the CPU.  Normally we strip out the
    floating point information before doing that comparison, but we
    currently only do that for the features that can be affected by the
    -mfpu option.  For a soft-float environment we also need to strip out
    any bits that depend on having floating-point present.
    
    So this patch implements that and does a bit of housekeeping at the
    same time:
    
    - in arm-cpus.in it is not necessary for a CPU to specify both
      +dotprod and +simd in its architecture specification, since +dotprod
      implies +simd.
    
    - I've refactored the ALL_SIMD fgroup in arm-cpus.in to create a new
      subgroup ALL_SIMD_EXTERNAL and containing the bits that were
      previously added directly to ALL_SIMD.  Similarly, I've added an
      ALL_FPU_EXTERNAL subgroup.
    
    - in arm.c rename fpu_bitlist and all_fpubits to fpu_bitlist_internal
      and all_fpubits_internal for consistency with the fgroup bits which
      they contain.
    
    	* config/arm/arm-cpus.in (ALL_SIMD_EXTERNAL): New fgroup.
    	(ALL_SIMD): Use it.
    	(ALL_FPU_EXTERNAL): New fgroup.
    	(ALL_FP): Use it.
    	(cortex-a55, cortex-a75, cortex-a76, cortex-a76ae): Remove redundant
    	+simd from architecture specification.
    	(cortex-a77, neoverse-n1, cortex-a75.cortex-a55): Likewise.
    	* config/arm/arm.c (isa_all_fpubits, fpu_bitlist): Rename to ...
    	(isa_all_fpubits_internal, fpu_bitlist_internal): ... these.
    	(isa_all_fpbits): New bitmap.
    	(arm_option_override): Initialize it.
    	(arm_configure_build_target): If the target isa does not have any
    	FP enabled, do not warn about mismatches in FP-related feature bits.
    
    From-SVN: r279219
    fd9058b6
    History
    arm: Fix an incorrect warning when -mcpu=cortex-a55 is used with -mfloat-abi=soft
    Richard Earnshaw authored
    When a CPU such as cortex-a55 is used with the soft-float ABI variant,
    the compiler is incorrectly issuing a warning about a mismatch between
    the architecture (generated internally) and the CPU.  This is not
    expected or intended.
    
    The problem stems from the fact that we generate (correctly) an
    architecture for a soft-float compilation, but then try to compare it
    against the one recorded for the CPU.  Normally we strip out the
    floating point information before doing that comparison, but we
    currently only do that for the features that can be affected by the
    -mfpu option.  For a soft-float environment we also need to strip out
    any bits that depend on having floating-point present.
    
    So this patch implements that and does a bit of housekeeping at the
    same time:
    
    - in arm-cpus.in it is not necessary for a CPU to specify both
      +dotprod and +simd in its architecture specification, since +dotprod
      implies +simd.
    
    - I've refactored the ALL_SIMD fgroup in arm-cpus.in to create a new
      subgroup ALL_SIMD_EXTERNAL and containing the bits that were
      previously added directly to ALL_SIMD.  Similarly, I've added an
      ALL_FPU_EXTERNAL subgroup.
    
    - in arm.c rename fpu_bitlist and all_fpubits to fpu_bitlist_internal
      and all_fpubits_internal for consistency with the fgroup bits which
      they contain.
    
    	* config/arm/arm-cpus.in (ALL_SIMD_EXTERNAL): New fgroup.
    	(ALL_SIMD): Use it.
    	(ALL_FPU_EXTERNAL): New fgroup.
    	(ALL_FP): Use it.
    	(cortex-a55, cortex-a75, cortex-a76, cortex-a76ae): Remove redundant
    	+simd from architecture specification.
    	(cortex-a77, neoverse-n1, cortex-a75.cortex-a55): Likewise.
    	* config/arm/arm.c (isa_all_fpubits, fpu_bitlist): Rename to ...
    	(isa_all_fpubits_internal, fpu_bitlist_internal): ... these.
    	(isa_all_fpbits): New bitmap.
    	(arm_option_override): Initialize it.
    	(arm_configure_build_target): If the target isa does not have any
    	FP enabled, do not warn about mismatches in FP-related feature bits.
    
    From-SVN: r279219