aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/loongarch/loongarch.h
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-09-05 21:02:38 +0800
committerXi Ruoyao <xry111@xry111.site>2023-09-09 14:32:55 +0800
commit35adc54b55aa199f17e2c84e382792e424b6171e (patch)
tree4f6baa46f463fd871e4648a531734dc5d72dbc6b /gcc/config/loongarch/loongarch.h
parentdf9a25384e6c484643b48b59b4e6e07504889b61 (diff)
downloadgcc-35adc54b55aa199f17e2c84e382792e424b6171e.zip
gcc-35adc54b55aa199f17e2c84e382792e424b6171e.tar.gz
gcc-35adc54b55aa199f17e2c84e382792e424b6171e.tar.bz2
LoongArch: Use LSX and LASX for block move
gcc/ChangeLog: * config/loongarch/loongarch.h (LARCH_MAX_MOVE_PER_INSN): Define to the maximum amount of bytes able to be loaded or stored with one machine instruction. * config/loongarch/loongarch.cc (loongarch_mode_for_move_size): New static function. (loongarch_block_move_straight): Call loongarch_mode_for_move_size for machine_mode to be moved. (loongarch_expand_block_move): Use LARCH_MAX_MOVE_PER_INSN instead of UNITS_PER_WORD. gcc/testsuite/ChangeLog: * gcc.target/loongarch/memcpy-vec-1.c: New test. * gcc.target/loongarch/memcpy-vec-2.c: New test. * gcc.target/loongarch/memcpy-vec-3.c: New test.
Diffstat (limited to 'gcc/config/loongarch/loongarch.h')
-rw-r--r--gcc/config/loongarch/loongarch.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
index 3fc9dc4..7e39120 100644
--- a/gcc/config/loongarch/loongarch.h
+++ b/gcc/config/loongarch/loongarch.h
@@ -1181,6 +1181,9 @@ typedef struct {
least twice. */
#define LARCH_MAX_MOVE_OPS_STRAIGHT (LARCH_MAX_MOVE_OPS_PER_LOOP_ITER * 2)
+#define LARCH_MAX_MOVE_PER_INSN \
+ (ISA_HAS_LASX ? 32 : (ISA_HAS_LSX ? 16 : UNITS_PER_WORD))
+
/* The base cost of a memcpy call, for MOVE_RATIO and friends. These
values were determined experimentally by benchmarking with CSiBE.
*/