Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame] | 1 | From 336d984c580345eccdeb889af8ef8c986afc1dad Mon Sep 17 00:00:00 2001 |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 2 | From: Mahesh Bodapati <mbodapat@xilinx.com> |
| 3 | Date: Mon, 19 Feb 2018 18:06:16 +0530 |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame] | 4 | Subject: [PATCH 27/54] [Patch,Microblaze]: update in constraints for bitfield |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 5 | insert and extract instructions. |
| 6 | |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame] | 7 | Conflicts: |
| 8 | gcc/config/microblaze/microblaze.md |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 9 | --- |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame] | 10 | gcc/config/microblaze/microblaze.md | 45 +++++------------------------ |
| 11 | 1 file changed, 8 insertions(+), 37 deletions(-) |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 12 | |
| 13 | diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame] | 14 | index d938efcd762..63ad94b972f 100644 |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 15 | --- a/gcc/config/microblaze/microblaze.md |
| 16 | +++ b/gcc/config/microblaze/microblaze.md |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 17 | @@ -2492,33 +2492,17 @@ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 18 | DONE; |
| 19 | }") |
| 20 | |
| 21 | -(define_expand "extvsi" |
| 22 | +(define_expand "extzvsi" |
| 23 | [(set (match_operand:SI 0 "register_operand" "r") |
| 24 | (zero_extract:SI (match_operand:SI 1 "register_operand" "r") |
| 25 | (match_operand:SI 2 "immediate_operand" "I") |
| 26 | (match_operand:SI 3 "immediate_operand" "I")))] |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame] | 27 | +"TARGET_HAS_BITFIELD" |
| 28 | "" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 29 | -" |
| 30 | -{ |
| 31 | - unsigned HOST_WIDE_INT len = UINTVAL (operands[2]); |
| 32 | - unsigned HOST_WIDE_INT pos = UINTVAL (operands[3]); |
| 33 | - |
| 34 | - if ((len == 0) || (pos + len > 32) ) |
| 35 | - FAIL; |
| 36 | - |
| 37 | - ;;if (!register_operand (operands[1], VOIDmode)) |
| 38 | - ;; FAIL; |
| 39 | - if (operands[0] == operands[1]) |
| 40 | - FAIL; |
| 41 | - if (GET_CODE (operands[1]) == ASHIFT) |
| 42 | - FAIL; |
| 43 | -;; operands[2] = GEN_INT(INTVAL(operands[2])+1 ); |
| 44 | - emit_insn (gen_extv_32 (operands[0], operands[1], |
| 45 | - operands[2], operands[3])); |
| 46 | - DONE; |
| 47 | -}") |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 48 | +) |
| 49 | |
| 50 | -(define_insn "extv_32" |
| 51 | + |
| 52 | +(define_insn "extzv_32" |
| 53 | [(set (match_operand:SI 0 "register_operand" "=r") |
| 54 | (zero_extract:SI (match_operand:SI 1 "register_operand" "r") |
| 55 | (match_operand:SI 2 "immediate_operand" "I") |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame] | 56 | @@ -2534,22 +2518,9 @@ |
| 57 | (match_operand:SI 1 "immediate_operand" "I") |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 58 | (match_operand:SI 2 "immediate_operand" "I")) |
| 59 | (match_operand:SI 3 "register_operand" "r"))] |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame] | 60 | - "" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 61 | - " |
| 62 | -{ |
| 63 | - unsigned HOST_WIDE_INT len = UINTVAL (operands[1]); |
| 64 | - unsigned HOST_WIDE_INT pos = UINTVAL (operands[2]); |
| 65 | - |
| 66 | - if (len <= 0 || pos + len > 32) |
| 67 | - FAIL; |
| 68 | - |
| 69 | - ;;if (!register_operand (operands[0], VOIDmode)) |
| 70 | - ;; FAIL; |
| 71 | - |
| 72 | - emit_insn (gen_insv_32 (operands[0], operands[1], |
| 73 | - operands[2], operands[3])); |
| 74 | - DONE; |
| 75 | -}") |
Andrew Geissler | 10fa149 | 2020-12-11 16:25:29 -0600 | [diff] [blame] | 76 | + "TARGET_HAS_BITFIELD" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 77 | +"" |
| 78 | +) |
| 79 | |
| 80 | (define_insn "insv_32" |
| 81 | [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r") |
| 82 | -- |
Andrew Geissler | a9ff2b3 | 2020-10-16 10:11:54 -0500 | [diff] [blame] | 83 | 2.17.1 |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 84 | |