Bug 25376

Summary: Setting FPU reset's MVE feature bits but FPU can't set MVE feature bits
Product: binutils Reporter: Andre Vieira <avieira>
Component: gasAssignee: Andre Vieira <avieira>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.33   
Target Milestone: ---   
Host: Target: arm-none-eabi
Build: 2.33 Last reconfirmed:

Description Andre Vieira 2020-01-13 10:10:02 UTC
GAS -mfpu command-line option and .fpu assembler directive reset the MVE feature bits but can't set it. I.e. -mfpu or .fpu will disable mve but aren't able to set it. 

It would be more natural if -mfpu and .fpu would only reset the set of bits they can set.
Comment 1 Sourceware Commits 2020-01-16 14:41:36 UTC
The master branch has been updated by Andre Simoes Dias Vieira <avieira@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2da2eaf4ce299c84c5a1f1bc6f7944266cb36d6e

commit 2da2eaf4ce299c84c5a1f1bc6f7944266cb36d6e
Author: Andre Vieira <andre.simoesdiasvieira@arm.com>
Date:   Thu Jan 16 13:50:52 2020 +0000

    [binutils][arm] PR25376 Change MVE into a CORE_HIGH feature
    
    This patch moves MVE feature bits into the CORE_HIGH section.  This makes sure
    .fpu and -mfpu does not reset the bits set by MVE. This is important because
    .fpu has no option to "set" these same bits and thus, mimic'ing GCC, we choose
    to define MVE as an architecture extension rather than put it together with
    other the legacy fpu features.
    
    This will enable the following behavior:
    .arch armv8.1-m.main
    .arch mve
    .fpu fpv5-sp-d16               #does not disable mve.
    vadd.i32 q0, q1, q2
    
    This patch also makes sure MVE is not taken into account during auto-detect.
    This was already the case, but because we moved the MVE bits to the
    architecture feature space we must make sure ARM_ANY does not include MVE.
    
    gas/ChangeLog:
    2020-01-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
    
    	PR 25376
    	* config/tc-arm.c (mve_ext, mve_fp_ext): Use CORE_HIGH.
    	(armv8_1m_main_ext_table): Use CORE_HIGH for mve.
    	* testsuite/arm/armv8_1-m-fpu-mve-1.s: New.
    	* testsuite/arm/armv8_1-m-fpu-mve-1.d: New.
    	* testsuite/arm/armv8_1-m-fpu-mve-2.s: New.
    	* testsuite/arm/armv8_1-m-fpu-mve-2.d: New.
    
    include/ChangeLog:
    2020-01-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
    
    	PR 25376
    	* opcodes/arm.h (FPU_MVE, FPU_MVE_FPU): Move these features to...
    	(ARM_EXT2_MVE, ARM_EXT2_MVE_FP): ... the CORE_HIGH space.
    	(ARM_ANY): Redefine to not include any MVE bits.
    	(ARM_FEATURE_ALL): Removed.
    
    opcodes/ChangeLog:
    2020-01-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
    
    	PR 25376
    	* opcodes/arm-dis.c (coprocessor_opcodes): Use CORE_HIGH for MVE bits.
    	(neon_opcodes): Likewise.
    	(select_arm_features): Make sure we enable MVE bits when selecting
    	armv8.1-m.main.  Make sure we do not enable MVE bits when not selecting
    	any architecture.
Comment 2 Andre Vieira 2020-03-13 13:47:31 UTC
Fixed in master, 2.34 and 2.33