diff options
author | David S. Miller <davem@davemloft.net> | 2013-04-10 19:41:57 +0000 |
---|---|---|
committer | David S. Miller <davem@gcc.gnu.org> | 2013-04-10 12:41:57 -0700 |
commit | 42e37616ecd67d50559ca16df0e4228397b0668c (patch) | |
tree | 03cbdc17b2b7d1af99a46a569ba37bb1f11fc28f /gcc/target.h | |
parent | 95ca411e0437d9954a40a2134bba237b1f2ef0fc (diff) | |
download | gcc-42e37616ecd67d50559ca16df0e4228397b0668c.zip gcc-42e37616ecd67d50559ca16df0e4228397b0668c.tar.gz gcc-42e37616ecd67d50559ca16df0e4228397b0668c.tar.bz2 |
Improve cstore code generation on 64-bit sparc.
One major suboptimal area of the sparc back end is cstore generation
on 64-bit.
Due to the way arguments and return values of functions must be
promoted, the ideal mode for cstore's result would be DImode.
But this hasn't been done because of a fundamental limitation
of the cstore patterns. They require a fixed mode be used for
the boolean result value.
I've decided to work around this by building a target hook which
specifies the type to use for conditional store results, and then I
use a special predicate for operans 0 in the cstore expanders so
that they still match even when we use DImode.
The default version of the target hook just does what it does now,
so no other target should be impacted by this at all.
Regstrapped on 32-bit sparc-linux-gnu and I've run the testsuite
with "-m64" to validate the 64-bit side.
gcc/
* target.def (cstore_mode): New hook.
* target.h: Include insn-codes.h
* targhooks.c: Likewise.
(default_cstore_mode): New function.
* targhooks.h: Declare it.
* doc/tm.texi.in: New hook slot for TARGET_CSTORE_MODE.
* doc/tm.texi: Rebuild.
* expmed.c (emit_cstore): Obtain cstore boolean result mode using
target hook, rather than inspecting the insn_data.
* config/sparc/sparc.c (sparc_cstore_mode): New function.
(TARGET_CSTORE_MODE): Redefine.
(emit_scc_insn): When TARGET_ARCH64, emit new 64-bit boolean
result patterns.
* config/sparc/predicates.md (cstore_result_operand): New special
predicate.
* config/sparc/sparc.md (cstoresi4, cstoredi4, cstore<F:mode>4):
Use it for operand 0.
(*seqsi_special): Rewrite using 'P' mode iterator on operand 0.
(*snesi_special): Likewise.
(*snesi_zero): Likewise.
(*seqsi_zero): Likewise.
(*sltu_insn): Likewise.
(*sgeu_insn): Likewise.
(*seqdi_special): Make operand 0 and comparison operation be of
DImode.
(*snedi_special): Likewise.
(*snedi_special_vis3): Likewise.
(*neg_snesi_zero): Rename to *neg_snesisi_zero.
(*neg_snesi_sign_extend): Rename to *neg_snesidi_zero.
(*snesi_zero_extend): Delete, covered by 'P' mode iterator.
(*neg_seqsi_zero): Rename to *neg_seqsisi_zero.
(*neg_seqsi_sign_extend): Rename to *neg_seqsidi_zero.
(*seqsi_zero_extend): Delete, covered by 'P' mode iterator.
(*sltu_extend_sp64): Likewise.
(*neg_sltu_insn): Rename to *neg_sltusi_insn.
(*neg_sltu_extend_sp64): Rename to *neg_sltudi_insn.
(*sgeu_extend_sp64): Delete, covered by 'P' mode iterator.
(*neg_sgeu_insn): Rename to *neg_sgeusi_insn.
(*neg_sgeu_extend_sp64): Rename to *neg_sgeudi_insn.
gcc/testsuite/
* gcc.target/sparc/setcc-4.c: New test.
* gcc.target/sparc/setcc-5.c: New test.
From-SVN: r197679
Diffstat (limited to 'gcc/target.h')
-rw-r--r-- | gcc/target.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/target.h b/gcc/target.h index c868118..405e292 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -49,6 +49,7 @@ #define GCC_TARGET_H #include "insn-modes.h" +#include "insn-codes.h" #ifdef ENABLE_CHECKING |