Andrew Geissler | a9ff2b3 | 2020-10-16 10:11:54 -0500 | [diff] [blame^] | 1 | From 3e8779308d1901b273b2b360bea719aa72d24ab9 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 | a9ff2b3 | 2020-10-16 10:11:54 -0500 | [diff] [blame^] | 4 | Subject: [PATCH 32/58] [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 | |
| 7 | --- |
Andrew Geissler | a9ff2b3 | 2020-10-16 10:11:54 -0500 | [diff] [blame^] | 8 | gcc/config/microblaze/microblaze.md | 43 +++++------------------------ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 9 | 1 file changed, 7 insertions(+), 36 deletions(-) |
| 10 | |
| 11 | 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^] | 12 | index 9de46d0ce24..fe94807182b 100644 |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 13 | --- a/gcc/config/microblaze/microblaze.md |
| 14 | +++ b/gcc/config/microblaze/microblaze.md |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 15 | @@ -2492,33 +2492,17 @@ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 16 | DONE; |
| 17 | }") |
| 18 | |
| 19 | -(define_expand "extvsi" |
| 20 | +(define_expand "extzvsi" |
| 21 | [(set (match_operand:SI 0 "register_operand" "r") |
| 22 | (zero_extract:SI (match_operand:SI 1 "register_operand" "r") |
| 23 | (match_operand:SI 2 "immediate_operand" "I") |
| 24 | (match_operand:SI 3 "immediate_operand" "I")))] |
| 25 | "TARGET_HAS_BITFIELD" |
| 26 | -" |
| 27 | -{ |
| 28 | - unsigned HOST_WIDE_INT len = UINTVAL (operands[2]); |
| 29 | - unsigned HOST_WIDE_INT pos = UINTVAL (operands[3]); |
| 30 | - |
| 31 | - if ((len == 0) || (pos + len > 32) ) |
| 32 | - FAIL; |
| 33 | - |
| 34 | - ;;if (!register_operand (operands[1], VOIDmode)) |
| 35 | - ;; FAIL; |
| 36 | - if (operands[0] == operands[1]) |
| 37 | - FAIL; |
| 38 | - if (GET_CODE (operands[1]) == ASHIFT) |
| 39 | - FAIL; |
| 40 | -;; operands[2] = GEN_INT(INTVAL(operands[2])+1 ); |
| 41 | - emit_insn (gen_extv_32 (operands[0], operands[1], |
| 42 | - operands[2], operands[3])); |
| 43 | - DONE; |
| 44 | -}") |
| 45 | +"" |
| 46 | +) |
| 47 | |
| 48 | -(define_insn "extv_32" |
| 49 | + |
| 50 | +(define_insn "extzv_32" |
| 51 | [(set (match_operand:SI 0 "register_operand" "=r") |
| 52 | (zero_extract:SI (match_operand:SI 1 "register_operand" "r") |
| 53 | (match_operand:SI 2 "immediate_operand" "I") |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 54 | @@ -2535,21 +2519,8 @@ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 55 | (match_operand:SI 2 "immediate_operand" "I")) |
| 56 | (match_operand:SI 3 "register_operand" "r"))] |
| 57 | "TARGET_HAS_BITFIELD" |
| 58 | - " |
| 59 | -{ |
| 60 | - unsigned HOST_WIDE_INT len = UINTVAL (operands[1]); |
| 61 | - unsigned HOST_WIDE_INT pos = UINTVAL (operands[2]); |
| 62 | - |
| 63 | - if (len <= 0 || pos + len > 32) |
| 64 | - FAIL; |
| 65 | - |
| 66 | - ;;if (!register_operand (operands[0], VOIDmode)) |
| 67 | - ;; FAIL; |
| 68 | - |
| 69 | - emit_insn (gen_insv_32 (operands[0], operands[1], |
| 70 | - operands[2], operands[3])); |
| 71 | - DONE; |
| 72 | -}") |
| 73 | +"" |
| 74 | +) |
| 75 | |
| 76 | (define_insn "insv_32" |
| 77 | [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r") |
| 78 | -- |
Andrew Geissler | a9ff2b3 | 2020-10-16 10:11:54 -0500 | [diff] [blame^] | 79 | 2.17.1 |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 80 | |