LoongArch: Add prefetch instructions.
authorLulu Cheng <chenglulu@loongson.cn>
Wed, 16 Nov 2022 01:25:14 +0000 (09:25 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Wed, 23 Nov 2022 03:05:50 +0000 (11:05 +0800)
commit3138db588a46d445876c0358df55fa3995c6f221
tree364ff091e86c314e8dc43f6029fbf615d711ba89
parent04711f5189a72c2fcaeed520d65582704adca042
LoongArch: Add prefetch instructions.

Enable sw prefetching at -O3 and higher.

Co-Authored-By: xujiahao <xujiahao@loongson.cn>
gcc/ChangeLog:

* config/loongarch/constraints.md (ZD): New constraint.
* config/loongarch/loongarch-def.c: Initial number of parallel prefetch.
* config/loongarch/loongarch-tune.h (struct loongarch_cache):
Define number of parallel prefetch.
* config/loongarch/loongarch.cc (loongarch_option_override_internal):
Set up parameters to be used in prefetching algorithm.
* config/loongarch/loongarch.md (prefetch): New template.
gcc/config/loongarch/constraints.md
gcc/config/loongarch/loongarch-def.c
gcc/config/loongarch/loongarch-tune.h
gcc/config/loongarch/loongarch.cc
gcc/config/loongarch/loongarch.md