blob: d8eb76955f7abb46046ac8b2fe31ee6a458166ff [file] [log] [blame]
Brad Bishop286d45c2018-10-02 15:21:57 -04001From f269f552e1abf182dc3749e0f29b1529fc82644a Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:42 -0700
4Subject: [PATCH] Update MicroBlaze ashlsi3 & movsf patterns
5
6This patch removes the use of HOST_WIDE_INT_PRINT_HEX macro in
7print_operand of ashlsi3_with_mul_nodelay,ashlsi3_with_mul_delay and
8movsf_internal patterns beacuse HOST_WIDE_INT_PRINT_HEX is generating
964-bit value which our instruction doesn't support so using gen_int_mode
10function
11
12ChangeLog:
13
142016-01-07 Nagaraju Mekala <nagaraju.mekala@xilinx.com>
15 Ajit Agarwal <ajitkum@xilinx.com>
16
17 * microblaze.md (ashlsi3_with_mul_nodelay,
18 ashlsi3_with_mul_delay,
19 movsf_internal):
20 Updated the patterns to use gen_int_mode function
21 * microblaze.c (print_operand):
22 updated the 'F' case to use "unsinged int" instead
23 of HOST_WIDE_INT_PRINT_HEX
24
25Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
26Signed-off-by: Ajit Agarwal <ajitkum@xilinx.com>
27Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
28Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
29Upstream-Status: Pending
30---
31 gcc/config/microblaze/microblaze.c | 2 +-
32 gcc/config/microblaze/microblaze.md | 10 ++++++++--
33 2 files changed, 9 insertions(+), 3 deletions(-)
34
35diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
36index f46dffff0d..663b20a022 100644
37--- a/gcc/config/microblaze/microblaze.c
38+++ b/gcc/config/microblaze/microblaze.c
39@@ -2507,7 +2507,7 @@ print_operand (FILE * file, rtx op, int letter)
40 unsigned long value_long;
41 REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (op),
42 value_long);
43- fprintf (file, HOST_WIDE_INT_PRINT_HEX, value_long);
44+ fprintf (file, "0x%08x", (unsigned int) value_long);
45 }
46 else
47 {
48diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
49index 13f8803428..b9c62b6d0f 100644
50--- a/gcc/config/microblaze/microblaze.md
51+++ b/gcc/config/microblaze/microblaze.md
52@@ -1366,7 +1366,10 @@
53 (match_operand:SI 2 "immediate_operand" "I")))]
54 "!TARGET_SOFT_MUL
55 && ((1 << INTVAL (operands[2])) <= 32767 && (1 << INTVAL (operands[2])) >= -32768)"
56- "muli\t%0,%1,%m2"
57+ {
58+ operands[2] = gen_int_mode (1 << INTVAL (operands[2]), SImode);
59+ return "muli\t%0,%1,%2";
60+ }
61 ;; This MUL will not generate an imm. Can go into a delay slot.
62 [(set_attr "type" "arith")
63 (set_attr "mode" "SI")
64@@ -1378,7 +1381,10 @@
65 (ashift:SI (match_operand:SI 1 "register_operand" "d")
66 (match_operand:SI 2 "immediate_operand" "I")))]
67 "!TARGET_SOFT_MUL"
68- "muli\t%0,%1,%m2"
69+ {
70+ operands[2] = gen_int_mode (1 << INTVAL (operands[2]), SImode);
71+ return "muli\t%0,%1,%2";
72+ }
73 ;; This MUL will generate an IMM. Cannot go into a delay slot
74 [(set_attr "type" "no_delay_arith")
75 (set_attr "mode" "SI")
76--
772.14.2
78