diff options
author | Yvan Roux <yvan.roux@linaro.org> | 2016-09-02 10:09:01 +0200 |
---|---|---|
committer | Yvan Roux <yvan.roux@linaro.org> | 2016-09-07 22:08:28 +0200 |
commit | a7c74eef31eb345b44a373065ccc3f71dc5d340d (patch) | |
tree | 9fc0b7142a33153a43df6a48bde6553a1472321e | |
parent | 22faddec1af60b6bd0057ffd00a16f05c45908b8 (diff) |
gcc/
Backport from trunk r237597.
2016-06-20 Wilco Dijkstra <wdijkstr@arm.com>
* config/aarch64/aarch64.c (aarch64_modes_tieable_p):
Allow scalar/single vector modes to be tieable.
Change-Id: I66a08134bfd3a73d65bd84ad3a72bac1756caee4
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 760c8c97ece..8d78100e8e6 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -12941,7 +12941,14 @@ aarch64_reverse_mask (enum machine_mode mode) return force_reg (V16QImode, mask); } -/* Implement MODES_TIEABLE_P. */ +/* Implement MODES_TIEABLE_P. In principle we should always return true. + However due to issues with register allocation it is preferable to avoid + tieing integer scalar and FP scalar modes. Executing integer operations + in general registers is better than treating them as scalar vector + operations. This reduces latency and avoids redundant int<->FP moves. + So tie modes if they are either the same class, or vector modes with + other vector modes, vector structs or any scalar mode. +*/ bool aarch64_modes_tieable_p (machine_mode mode1, machine_mode mode2) @@ -12952,9 +12959,12 @@ aarch64_modes_tieable_p (machine_mode mode1, machine_mode mode2) /* We specifically want to allow elements of "structure" modes to be tieable to the structure. This more general condition allows other rarer situations too. */ - if (TARGET_SIMD - && aarch64_vector_mode_p (mode1) - && aarch64_vector_mode_p (mode2)) + if (aarch64_vector_mode_p (mode1) && aarch64_vector_mode_p (mode2)) + return true; + + /* Also allow any scalar modes with vectors. */ + if (aarch64_vector_mode_supported_p (mode1) + || aarch64_vector_mode_supported_p (mode2)) return true; return false; |