This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [ARC] Fix unwanted match for sign extend 16-bit constant.
- From: Joern Wolfgang Rennecke <gnu at amylaar dot uk>
- To: Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>, gcc-patches at gcc dot gnu dot org
- Cc: Francois dot Bedard at synopsys dot com, jeremy dot bennett at embecosm dot com
- Date: Thu, 28 Apr 2016 18:46:16 +0100
- Subject: Re: [PATCH] [ARC] Fix unwanted match for sign extend 16-bit constant.
- Authentication-results: sourceware.org; auth=none
- References: <5721F84D dot 2090002 at amylaar dot uk> <1461863430-22916-1-git-send-email-claziss at synopsys dot com>
On 28/04/16 18:10, Claudiu Zissulescu wrote:
Please find the updated patch.
Claudiu
gcc/
2016-04-28 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.h (UNSIGNED_INT12, UNSIGNED_INT16): Define.
* config/arc/arc.md (umulhisi3): Use arc_short_operand predicate.
(umulhisi3_imm): Update predicates and constraint letters.
(umulhisi3_reg): Declare instruction as commutative.
* config/arc/constraints.md (U12, U16): New constraints.
I'm not sure how to feel about this. U16 looks intuitive, but we have
traditionally used U for memory constraints. And we use it for ARC
for that purpose, too, even though with a compatible constraint
length of 3.
I suppose it's fine if you're sure we never want to have an addressing
mode that's best described with "12" or "16", or some other number
we might want for an unsigned integer.
Otherwise, I'd suggest using a traditional integer letter. 'J' is free.
(define_expand "umulhisi3"
[(set (match_operand:SI 0 "register_operand" "")
(mult:SI (zero_extend:SI (match_operand:HI 1 "register_operand" ""))
- (zero_extend:SI (match_operand:HI 2 "nonmemory_operand" ""))))]
+ (zero_extend:SI (match_operand:HI 2 "arc_short_operand" ""))))]
"TARGET_MPYW"
"{
if (CONSTANT_P (operands[2]))
{
- emit_insn (gen_umulhisi3_imm (operands[0], operands[1], operands[2]));
- DONE;
+ emit_insn (gen_umulhisi3_imm (operands[0], operands[1], operands[2]));
+ DONE;
Why do you remove half of the indentation?