[arm] Fix gcc.target/arm/negdi-[12].c
commit83447a6fa1a4bc33c5c68a8378d14f24390bc272
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Jan 2018 10:41:57 +0000 (19 10:41 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Jan 2018 10:41:57 +0000 (19 10:41 +0000)
treeaae68d5cf391d72bb5f32d48321bd5f44a19a2b9
parent227887ae724776730f55198d702d539bcfafe9c5
[arm] Fix gcc.target/arm/negdi-[12].c

These tests are failing for a silly reason. They scan for an occurrence of the NEGS instruction.
NEGS (and NEG in general) is a pre-UAL alias of RSB with an immediate of 0 and we only emit it
in one pattern: *thumb2_negsi2_short in thumb2.md. In all other instances of negation we emit
the modern RSB mnemonic. This causes needless differences in assembly output.
For example, for these testcases we emit NEG when compiling for -march=armv7-a, but for armv7ve
we emit RSB, causing the scan-assembler tests to fail.

This patch updates the *thumb2_negsi2_short pattern to use the RSB mnemonic and
fixes the flaky scan-assembler directives.

These tests now pass for my compiler configured with:
--with-cpu=cortex-a15 --with-fpu=neon-vfpv4 --with-float=hard --with-mode=thumb

Bootstrapped and tested on arm-none-linux-gnueabihf as well.

* config/arm/thumb2.md (*thumb2_negsi2_short): Use RSB mnemonic
instead of NEG.

* gcc.target/arm/negdi-1.c: Remove bogus assembler scan for negs.
* gcc.target/arm/negdi-2.c: Likewise.
* gcc.target/arm/thumb-16bit-ops.c: Replace scan for NEGS with RSBS.
--This line,gand those below, will be ignored--

M    gcc/config/arm/thumb2.md
M    gcc/ChangeLog
M    gcc/testsuite/gcc.target/arm/thumb-16bit-ops.c
M    gcc/testsuite/gcc.target/arm/negdi-1.c
M    gcc/testsuite/gcc.target/arm/negdi-2.c
M    gcc/testsuite/ChangeLog

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256881 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/arm/thumb2.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/negdi-1.c
gcc/testsuite/gcc.target/arm/negdi-2.c
gcc/testsuite/gcc.target/arm/thumb-16bit-ops.c