From 0eda40338e214245b14933f5ef6d73848f52f577 Mon Sep 17 00:00:00 2001 From: Catherine Moore Date: Wed, 20 Apr 2011 12:54:32 -0400 Subject: [PATCH] mips.opt (mfix-24k): New. 2011-04-20 Catherine Moore * config/mips/mips.opt (mfix-24k): New. * config/mips/mips.h (ASM_SPEC): Handle -mfix-24k. * config/mips/mips.md (length): Increase by 4 for stores if fixing 24K errata. * config/mips/mips.c (mips_reorg_process_insns): Do not allow all noreorder if fixing 24K errata. * doc/invoke.texi: Document mfix-24k. From-SVN: r172780 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/mips/mips.c | 6 +++--- gcc/config/mips/mips.h | 1 + gcc/config/mips/mips.md | 4 +++- gcc/config/mips/mips.opt | 4 ++++ gcc/doc/invoke.texi | 8 ++++++++ 6 files changed, 29 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c70cdb62c2d..2b7e5313a49 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2011-04-20 Catherine Moore + + * config/mips/mips.opt (mfix-24k): New. + * config/mips/mips.h (ASM_SPEC): Handle -mfix-24k. + * config/mips/mips.md (length): Increase by 4 for stores if + fixing 24K errata. + * config/mips/mips.c (mips_reorg_process_insns): Do not allow + all noreorder if fixing 24K errata. + * doc/invoke.texi: Document mfix-24k. + 2011-04-20 Chung-Lin Tang * config/arm/arm.c (arm_legitimize_reload_address): For NEON diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index e075c4f2648..55d3e9fcdf2 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -14886,9 +14886,9 @@ mips_reorg_process_insns (void) if (crtl->profile) cfun->machine->all_noreorder_p = false; - /* Code compiled with -mfix-vr4120 can't be all noreorder because - we rely on the assembler to work around some errata. */ - if (TARGET_FIX_VR4120) + /* Code compiled with -mfix-vr4120 or -mfix-24k can't be all noreorder + because we rely on the assembler to work around some errata. */ + if (TARGET_FIX_VR4120 || TARGET_FIX_24K) cfun->machine->all_noreorder_p = false; /* The same is true for -mfix-vr4130 if we might generate MFLO or diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index ba226bf8f4a..1c1917c18ac 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -1134,6 +1134,7 @@ enum mips_code_readable_setting { %{msmartmips} %{mno-smartmips} \ %{mmt} %{mno-mt} \ %{mfix-vr4120} %{mfix-vr4130} \ +%{mfix-24k} \ %(subtarget_asm_optimizing_spec) \ %(subtarget_asm_debugging_spec) \ %{mabi=*} %{!mabi=*: %(asm_abi_default_spec)} \ diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index c5276c0dcfa..d7e59f877f8 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -479,7 +479,9 @@ (eq_attr "move_type" "load,fpload") (symbol_ref "mips_load_store_insns (operands[1], insn) * 4") (eq_attr "move_type" "store,fpstore") - (symbol_ref "mips_load_store_insns (operands[0], insn) * 4") + (cond [(eq (symbol_ref "TARGET_FIX_24K") (const_int 0)) + (symbol_ref "mips_load_store_insns (operands[0], insn) * 4")] + (symbol_ref "mips_load_store_insns (operands[0], insn) * 4 + 4")) ;; In the worst case, a call macro will take 8 instructions: ;; diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt index 20b0b6cde6a..4ce3c40c7c1 100644 --- a/gcc/config/mips/mips.opt +++ b/gcc/config/mips/mips.opt @@ -110,6 +110,10 @@ mextern-sdata Target Report Var(TARGET_EXTERN_SDATA) Init(1) Use -G for data that is not defined by the current object +mfix-24k +Target Report Var(TARGET_FIX_24K) +Work around certain 24K errata + mfix-r4000 Target Report Mask(FIX_R4000) Work around certain R4000 errata diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 7ca4405a18f..4377f346c7b 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -714,6 +714,7 @@ Objective-C and Objective-C++ Dialects}. -mdivide-traps -mdivide-breaks @gol -mmemcpy -mno-memcpy -mlong-calls -mno-long-calls @gol -mmad -mno-mad -mfused-madd -mno-fused-madd -nocpp @gol +-mfix-24k -mno-fix-24k @gol -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400 @gol -mfix-r10000 -mno-fix-r10000 -mfix-vr4120 -mno-fix-vr4120 @gol -mfix-vr4130 -mno-fix-vr4130 -mfix-sb1 -mno-fix-sb1 @gol @@ -14602,6 +14603,13 @@ circumstances. Tell the MIPS assembler to not run its preprocessor over user assembler files (with a @samp{.s} suffix) when assembling them. +@item -mfix-24k +@item -mno-fix-24k +@opindex mfix-24k +@opindex mno-fix-24k +Work around the 24K E48 (lost data on stores during refill) errata. +The workarounds are implemented by the assembler rather than by GCC. + @item -mfix-r4000 @itemx -mno-fix-r4000 @opindex mfix-r4000 -- 2.30.2