public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] MIPS: define_attr perf_ratio in mips.md
@ 2024-01-04  1:58 YunQiang Su
  2024-01-04  1:58 ` [committed] MIPS: Implement TARGET_INSN_COSTS YunQiang Su
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: YunQiang Su @ 2024-01-04  1:58 UTC (permalink / raw)
  To: gcc-patches; +Cc: YunQiang Su

The accurate cost of an pattern can get with
	 insn_count * perf_ratio

The default value is set to 0 instead of 1, since that
we will need to distinguish the default value and it is
really set for an pattern.  Since it is not set for most
patterns yet, to use it, we will need to be sure that it's
value is greater than 0.

This attr will be used in `mips_insn_cost`.

gcc

	* config/mips/mips.md (perf_ratio): New attribute.
---
 gcc/config/mips/mips.md | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 6d47241ea3a..e1762ce105b 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -312,6 +312,10 @@ (define_attr "sync_insn2" "nop,and,xor,not"
 ;; "11" specifies MEMMODEL_ACQUIRE.
 (define_attr "sync_memmodel" "" (const_int 10))
 
+;; Performance ratio.  Add this attr to the slow INSNs.
+;; Used by mips_insn_cost.
+(define_attr "perf_ratio" "" (const_int 0))
+
 ;; Accumulator operand for madd patterns.
 (define_attr "accum_in" "none,0,1,2,3,4,5" (const_string "none"))
 
-- 
2.39.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-04  1:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-04  1:58 [committed] MIPS: define_attr perf_ratio in mips.md YunQiang Su
2024-01-04  1:58 ` [committed] MIPS: Implement TARGET_INSN_COSTS YunQiang Su
2024-01-04  1:58 ` [committed] MIPS: Add pattern insqisi_extended and inshisi_extended YunQiang Su
2024-01-04  1:58 ` [committed] MIPS/testsuite: Include stdio.h in mipscop tests YunQiang Su

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).