This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: cache enabled attribute by insn code


On 27/05/14 16:07, Richard Sandiford wrote:
> Richard Sandiford <rdsandiford@googlemail.com> writes:
>> Richard Sandiford <rsandifo@linux.vnet.ibm.com> writes:
>>> Does the following patch help?
>>
>> Bah, it won't of course: %i1 needs to be the operator.
> 
> Here's v2.  I tested that it worked for simple tests like:
> 
> int f1 (int x, int y) { return x + (y << 4); }
> int f2 (int x, int y) { return x - (y << 4); }
> int f3 (int x, int y) { return x & (y << 4); }
> int f4 (int x, int y) { return x | (y << 4); }
> int f5 (int x, int y) { return x ^ (y << 4); }
> int f6 (int x, int y) { return (y << 4) - x; }
> int g1 (int x, int y, int z) { return x + (y << z); }
> int g2 (int x, int y, int z) { return x - (y << z); }
> int g3 (int x, int y, int z) { return x & (y << z); }
> int g4 (int x, int y, int z) { return x | (y << z); }
> int g5 (int x, int y, int z) { return x ^ (y << z); }
> int g6 (int x, int y, int z) { return (y << z) - x; }
> 
> as well as the testcase.
> 
> Thanks,
> Richard
> 
> 
> gcc/
> 	* config/arm/iterators.md (shiftable_ops): New code iterator.
> 	(t2_binop0, arith_shift_insn): New code attributes.
> 	* config/arm/arm.md (insn_enabled): Delete.
> 	(enabled): Remove insn_enabled test.
> 	(*arith_shiftsi): Split out...
> 	(*arith_multsi): ...this pattern and remove insn_enabled attribute.
> 


Thanks, Richard.
I've tweaked this as followed and committed it.

I now consider "shift_operator" in the arm backend deprecated.  We
should be moving towards using shift_nomul_operator.

There's one final wart still to be handled, though.  'rotate' can only
take an immediate operand, not a register.  We can currently deal with
this, but it's not clean in terms of constraint handling.  I'll see if I
can fix this up sometime, but not today.

R.

2014-05-29  Richard Earnshaw <rearnsha@arm.com>
	Richard Sandiford  <rdsandiford@googlemail.com>

        * arm/iterators.md (shiftable_ops): New code iterator.
        (t2_binop0, arith_shift_insn): New code attributes.
	* arm/predicates.md (shift_nomul_operator): New predicate.
        * arm/arm.md (insn_enabled): Delete.
        (enabled): Remove insn_enabled test.
        (*arith_shiftsi): Delete.  Replace with ...
        (*<arith_shift_insn>_multsi): ... new pattern.
	(*<arith_shift_insn>_shiftsi): ... new pattern.
	* config/arm/arm.c (arm_print_operand): Handle operand format 'b'.





Attachment: bootstrap.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]