diff options
Diffstat (limited to 'meta-microblaze/recipes-devtools/binutils/binutils/0025-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch')
-rw-r--r-- | meta-microblaze/recipes-devtools/binutils/binutils/0025-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0025-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0025-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch new file mode 100644 index 00000000..74fcea81 --- /dev/null +++ b/meta-microblaze/recipes-devtools/binutils/binutils/0025-Fixed-bug-in-generation-of-IMML-instruction-for-the.patch | |||
@@ -0,0 +1,86 @@ | |||
1 | From 0ba14f999b266406e7e86fc0e7311ebb275e7b97 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mahesh Bodapati <mbodapat@xilinx.com> | ||
3 | Date: Wed, 3 Nov 2021 12:13:32 +0530 | ||
4 | Subject: [PATCH 25/34] Fixed bug in generation of IMML instruction for the | ||
5 | |||
6 | new MB-64 instructions with single register. | ||
7 | --- | ||
8 | gas/config/tc-microblaze.c | 50 +++++++++++++++++++++++++++++++++++--- | ||
9 | 1 file changed, 47 insertions(+), 3 deletions(-) | ||
10 | |||
11 | diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c | ||
12 | index 4c455ff02b8..bccaafe296c 100644 | ||
13 | --- a/gas/config/tc-microblaze.c | ||
14 | +++ b/gas/config/tc-microblaze.c | ||
15 | @@ -1643,12 +1643,56 @@ md_assemble (char * str) | ||
16 | exp.X_add_symbol, | ||
17 | exp.X_add_number, | ||
18 | (char *) opc); | ||
19 | - immedl = 0L; | ||
20 | + immed = 0L; | ||
21 | } | ||
22 | else | ||
23 | { | ||
24 | output = frag_more (isize); | ||
25 | immed = exp.X_add_number; | ||
26 | + temp = ((long long)immed) & 0xFFFFFFFFFFFF8000; | ||
27 | + if (temp != 0 && temp != 0xFFFFFFFFFFFF8000 && temp != 0x8000) | ||
28 | + { | ||
29 | + /* Needs an immediate inst. */ | ||
30 | + if (((long long)immed) > (long long)-549755813888 && ((long long)immed) < (long long)549755813887) | ||
31 | + { | ||
32 | + opcode1 = (struct op_code_struct *) str_hash_find (opcode_hash_control, "imml"); | ||
33 | + if (opcode1 == NULL) | ||
34 | + { | ||
35 | + as_bad (_("unknown opcode \"%s\""), "imml"); | ||
36 | + return; | ||
37 | + } | ||
38 | + inst1 = opcode1->bit_sequence; | ||
39 | + inst1 |= ((immed & 0x000000FFFFFF0000L) >> 16) & IMML_MASK; | ||
40 | + output[0] = INST_BYTE0 (inst1); | ||
41 | + output[1] = INST_BYTE1 (inst1); | ||
42 | + output[2] = INST_BYTE2 (inst1); | ||
43 | + output[3] = INST_BYTE3 (inst1); | ||
44 | + output = frag_more (isize); | ||
45 | + } | ||
46 | + else { | ||
47 | + opcode2 = (struct op_code_struct *) str_hash_find (opcode_hash_control, "imml"); | ||
48 | + opcode1 = (struct op_code_struct *) str_hash_find (opcode_hash_control, "imml"); | ||
49 | + if (opcode1 == NULL || opcode2 == NULL) | ||
50 | + { | ||
51 | + as_bad (_("unknown opcode \"%s\""), "imml"); | ||
52 | + return; | ||
53 | + } | ||
54 | + inst1 = opcode2->bit_sequence; | ||
55 | + inst1 |= ((immed & 0xFFFFFF0000000000L) >> 40) & IMML_MASK; | ||
56 | + output[0] = INST_BYTE0 (inst1); | ||
57 | + output[1] = INST_BYTE1 (inst1); | ||
58 | + output[2] = INST_BYTE2 (inst1); | ||
59 | + output[3] = INST_BYTE3 (inst1); | ||
60 | + output = frag_more (isize); | ||
61 | + inst1 = opcode1->bit_sequence; | ||
62 | + inst1 |= ((immed & 0x000000FFFFFF0000L) >> 16) & IMML_MASK; | ||
63 | + output[0] = INST_BYTE0 (inst1); | ||
64 | + output[1] = INST_BYTE1 (inst1); | ||
65 | + output[2] = INST_BYTE2 (inst1); | ||
66 | + output[3] = INST_BYTE3 (inst1); | ||
67 | + output = frag_more (isize); | ||
68 | + } | ||
69 | + } | ||
70 | } | ||
71 | inst |= (reg1 << RD_LOW) & RD_MASK; | ||
72 | inst |= (immed << IMM_LOW) & IMM16_MASK; | ||
73 | @@ -2146,8 +2190,8 @@ md_assemble (char * str) | ||
74 | streq (name, "breaid") || | ||
75 | streq (name, "brai") || streq (name, "braid"))) | ||
76 | { | ||
77 | - temp = immed & 0xFFFFFFFFFFFF8000; | ||
78 | - if (temp != 0) | ||
79 | + temp = ((long long)immed) & 0xFFFFFFFFFFFF8000; | ||
80 | + if (temp != 0 && temp != 0xFFFFFFFFFFFF8000 && temp != 0x8000) | ||
81 | { | ||
82 | /* Needs an immediate inst. */ | ||
83 | if (((long long)immed) > (long long)-549755813888 && ((long long)immed) < (long long)549755813887) | ||
84 | -- | ||
85 | 2.37.1 (Apple Git-137.1) | ||
86 | |||