blob: 7627b76515a7b9ccf177bb7c951528a6bfc218e1 [file] [log] [blame]
Andrew Geissler10fa1492020-12-11 16:25:29 -06001From 336d984c580345eccdeb889af8ef8c986afc1dad Mon Sep 17 00:00:00 2001
Brad Bishop26bdd442019-08-16 17:08:17 -04002From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 19 Feb 2018 18:06:16 +0530
Andrew Geissler10fa1492020-12-11 16:25:29 -06004Subject: [PATCH 27/54] [Patch,Microblaze]: update in constraints for bitfield
Brad Bishop26bdd442019-08-16 17:08:17 -04005 insert and extract instructions.
6
Andrew Geissler10fa1492020-12-11 16:25:29 -06007Conflicts:
8 gcc/config/microblaze/microblaze.md
Brad Bishop26bdd442019-08-16 17:08:17 -04009---
Andrew Geissler10fa1492020-12-11 16:25:29 -060010 gcc/config/microblaze/microblaze.md | 45 +++++------------------------
11 1 file changed, 8 insertions(+), 37 deletions(-)
Brad Bishop26bdd442019-08-16 17:08:17 -040012
13diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
Andrew Geissler10fa1492020-12-11 16:25:29 -060014index d938efcd762..63ad94b972f 100644
Brad Bishop26bdd442019-08-16 17:08:17 -040015--- a/gcc/config/microblaze/microblaze.md
16+++ b/gcc/config/microblaze/microblaze.md
Andrew Geissler84ad7c52020-06-27 00:00:16 -050017@@ -2492,33 +2492,17 @@
Brad Bishop26bdd442019-08-16 17:08:17 -040018 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 Geissler10fa1492020-12-11 16:25:29 -060027+"TARGET_HAS_BITFIELD"
28 ""
Brad Bishop26bdd442019-08-16 17:08:17 -040029-"
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 Bishop26bdd442019-08-16 17:08:17 -040048+)
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 Geissler10fa1492020-12-11 16:25:29 -060056@@ -2534,22 +2518,9 @@
57 (match_operand:SI 1 "immediate_operand" "I")
Brad Bishop26bdd442019-08-16 17:08:17 -040058 (match_operand:SI 2 "immediate_operand" "I"))
59 (match_operand:SI 3 "register_operand" "r"))]
Andrew Geissler10fa1492020-12-11 16:25:29 -060060- ""
Brad Bishop26bdd442019-08-16 17:08:17 -040061- "
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 Geissler10fa1492020-12-11 16:25:29 -060076+ "TARGET_HAS_BITFIELD"
Brad Bishop26bdd442019-08-16 17:08:17 -040077+""
78+)
79
80 (define_insn "insv_32"
81 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r")
82--
Andrew Geisslera9ff2b32020-10-16 10:11:54 -0500832.17.1
Brad Bishop26bdd442019-08-16 17:08:17 -040084