[PATCH 3/3] MIPS/GAS: Correct note on the R5900 instruction count short loop fix

Fredrik Noring noring@nocrew.org
Thu Oct 11 16:26:00 GMT 2018


The code applying the short loop fix, its test cases, and the original
note by Sony confirm that the correct instruction count including the
branch and the delay slot is six instructions or fewer.

This change amends the note in the code that (incorrectly) says that
the count is strictly less than six instructions.
---
 gas/config/tc-mips.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index cab1c4c6c8..918525b4e9 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -7014,8 +7014,8 @@ can_swap_branch_p (struct mips_cl_insn *ip, expressionS *address_expr,
 	|| (ip->insn_opcode & 0xffff0000) == 0x04110000)) /* bgezal $0 */
     {
       int distance;
-      /* Check if loop is shorter than 6 instructions including
-         branch and delay slot.  */
+      /* Check if loop is shorter than or equal to 6 instructions
+         including branch and delay slot.  */
       distance = frag_now_fix () - S_GET_VALUE (address_expr->X_add_symbol);
       if (distance <= 20)
         {
-- 
2.16.4



More information about the Binutils mailing list