Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame^] | 1 | From 3a9ee185eb462f880ceb4ddd125d4a98e0759873 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 2 | From: Mahesh Bodapati <mbodapat@xilinx.com> |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 3 | Date: Tue, 17 Jan 2017 18:18:41 +0530 |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame^] | 4 | Subject: [PATCH 19/54] [Patch, microblaze]: Update ashlsi3 & movsf patterns |
| 5 | This patch removes the use of HOST_WIDE_INT_PRINT_HEX macro in print_operand |
| 6 | of ashlsi3_with_mul_nodelay,ashlsi3_with_mul_delay and movsf_internal |
| 7 | patterns beacuse HOST_WIDE_INT_PRINT_HEX is generating 64-bit value which our |
| 8 | instruction doesn't support so using gen_int_mode function |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 9 | |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 10 | Signed-off-by :Nagaraju Mekala <nmekala@xilix.com> |
| 11 | :Ajit Agarwal <ajitkum@xilinx.com> |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 12 | |
| 13 | ChangeLog: |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 14 | 2016-01-07 Nagaraju Mekala <nmekala@xilix.com> |
| 15 | Ajit Agarwal <ajitkum@xilinx.com> |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 16 | |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 17 | *microblaze.md (ashlsi3_with_mul_nodelay, |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 18 | ashlsi3_with_mul_delay, |
| 19 | movsf_internal): |
| 20 | Updated the patterns to use gen_int_mode function |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 21 | *microblaze.c (print_operand): |
| 22 | updated the 'F' case to use "unsinged int" instead |
| 23 | of HOST_WIDE_INT_PRINT_HEX |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 24 | --- |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame^] | 25 | gcc/config/microblaze/microblaze.c | 2 +- |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 26 | gcc/config/microblaze/microblaze.md | 10 ++++++++-- |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame^] | 27 | 2 files changed, 9 insertions(+), 3 deletions(-) |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 28 | |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame^] | 29 | diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c |
| 30 | index 9eae5515c60..0a4619eec0c 100644 |
| 31 | --- a/gcc/config/microblaze/microblaze.c |
| 32 | +++ b/gcc/config/microblaze/microblaze.c |
| 33 | @@ -2468,7 +2468,7 @@ print_operand (FILE * file, rtx op, int letter) |
| 34 | unsigned long value_long; |
| 35 | REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (op), |
| 36 | value_long); |
| 37 | - fprintf (file, "0x%lx", value_long); |
| 38 | + fprintf (file, "0x%08x", (unsigned int) value_long); |
| 39 | } |
| 40 | else |
| 41 | { |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 42 | diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md |
Andrew Geissler | a9ff2b3 | 2020-10-16 10:11:54 -0500 | [diff] [blame] | 43 | index efd2c34e0b7..be8bbda2bfb 100644 |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 44 | --- a/gcc/config/microblaze/microblaze.md |
| 45 | +++ b/gcc/config/microblaze/microblaze.md |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 46 | @@ -1368,7 +1368,10 @@ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 47 | (match_operand:SI 2 "immediate_operand" "I")))] |
| 48 | "!TARGET_SOFT_MUL |
| 49 | && ((1 << INTVAL (operands[2])) <= 32767 && (1 << INTVAL (operands[2])) >= -32768)" |
| 50 | - "muli\t%0,%1,%m2" |
| 51 | + { |
| 52 | + operands[2] = gen_int_mode (1 << INTVAL (operands[2]), SImode); |
| 53 | + return "muli\t%0,%1,%2"; |
| 54 | + } |
| 55 | ;; This MUL will not generate an imm. Can go into a delay slot. |
| 56 | [(set_attr "type" "arith") |
| 57 | (set_attr "mode" "SI") |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 58 | @@ -1380,7 +1383,10 @@ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 59 | (ashift:SI (match_operand:SI 1 "register_operand" "d") |
| 60 | (match_operand:SI 2 "immediate_operand" "I")))] |
| 61 | "!TARGET_SOFT_MUL" |
| 62 | - "muli\t%0,%1,%m2" |
| 63 | + { |
| 64 | + operands[2] = gen_int_mode (1 << INTVAL (operands[2]), SImode); |
| 65 | + return "muli\t%0,%1,%2"; |
| 66 | + } |
| 67 | ;; This MUL will generate an IMM. Cannot go into a delay slot |
| 68 | [(set_attr "type" "no_delay_arith") |
| 69 | (set_attr "mode" "SI") |
| 70 | -- |
Andrew Geissler | a9ff2b3 | 2020-10-16 10:11:54 -0500 | [diff] [blame] | 71 | 2.17.1 |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 72 | |