From 851a3d7218539c1a886edd92c57efe36b85e29be Mon Sep 17 00:00:00 2001
From: Mahesh Bodapati <mbodapat@xilinx.com>
Date: Thu, 16 Apr 2020 18:08:58 +0530
Subject: [PATCH 28/38]  [Patch,MicroBlaze m64] : This patch will remove imml 0
 and imml -1 instructions when the offset is less than 16 bit for Type A
 branch EA instructions.

---
 gas/config/tc-microblaze.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
index 68f19c965ef..805d250b6ac 100644
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -2158,9 +2158,7 @@ md_assemble (char * str)
       if (exp.X_op != O_constant)
 	{
 	  char *opc;
-          if (microblaze_arch_size == 64 && (streq (name, "breai") || 
-		 streq (name, "breaid") || 
-	         streq (name, "brai") || streq (name, "braid")))
+          if (microblaze_arch_size == 64 && (streq (name, "brai") || streq (name, "braid")))
             opc = str_microblaze_64;
 	  else
             opc = NULL;
@@ -2923,7 +2921,7 @@ md_apply_fix (fixS *   fixP,
     case BFD_RELOC_MICROBLAZE_64:
     case BFD_RELOC_MICROBLAZE_64_PCREL:
       if (fixP->fx_r_type == BFD_RELOC_MICROBLAZE_64
-            || fixP->fx_r_type == BFD_RELOC_MICROBLAZE_64_PCREL)
+            || fixP->fx_r_type == BFD_RELOC_MICROBLAZE_64_PCREL || (fixP->fx_r_type == BFD_RELOC_64_PCREL && microblaze_arch_size == 64))
         {
           /* Generate the imm instruction.  */
            if (((long long)val) > (long long)-549755813888 && ((long long)val) < (long long)549755813887)
-- 
2.17.1

