This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, microblaze]: Add support for swap instructions and reorder option
- From: Michael Eager <eager at eagerm dot com>
- To: David Holsgrove <david dot holsgrove at xilinx dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "Michael Eager (eager at eagercon dot com)" <eager at eagercon dot com>, John Williams <jwilliams at xilinx dot com>, "Edgar E. Iglesias (edgar dot iglesias at gmail dot com)" <edgar dot iglesias at gmail dot com>, Vinod Kathail <vinodk at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, Nagaraju Mekala <nmekala at xilinx dot com>, Tom Shui <tshui at xilinx dot com>
- Date: Tue, 26 Feb 2013 09:50:18 -0800
- Subject: Re: [Patch, microblaze]: Add support for swap instructions and reorder option
- References: <e490d104-284e-49f2-ac2e-cabc9c4543a5@DB3EHSMHS010.ehs.local>
On 02/10/2013 10:39 PM, David Holsgrove wrote:
Add support for swap instructions and reorder option
swapb and swaph instructions are introduced in microblaze cpu (mcpu) v8.30a,
but have an undocumented dependence on -mxl-pattern-compare being set.
The conditions for their use are;
mcpu < 8.30a; no swap insns, use of -mxl-reorder produces warning
and ignored
mcpu == 8.30a and -mxl-pattern-compare specified;
and if -mno-xl-reorder not specified, then swap insns allowed
mcpu > 8.30a;
if -mno-xl-reorder not specified, then swap insns allowed
Changelog
2013-02-11 David Holsgrove <david.holsgrove@xilinx.com>
Is this correct?
* config/microblaze/microblaze.c: microblaze_has_swap = 0
Add version check for v8.30.a to enable microblaze_has_swap
* config/microblaze/microblaze.h: Add TARGET_HAS_SWAP
* config/microblaze/microblaze.md: New bswapsi2 and bswaphi2
instructions
* config/microblaze/microblaze.opt: New options -mxl-reorder
and -mno-xl-reorder
Don't specify both -mxl-reorder and -mno-xl-reorder as options.
Don't specify a "no" version with the RejectNegative option.
GCC option handling already process the "no" prefix automatically.
There is no need to have both TARGET_REORDER and TARGET_NOREORDER
since they have exactly the same information. Define only TARGET_REORDER.
How does the name of the option (-mxl-reorder) relate to using swap
instructions? Nothing is being reordered. What are "reorder" instructions?
How about -mxl-swap, similar to -mxl-pattern-compare or -mxl-float-sqrt?
+ else if (ver == 0)
+ {
+ if (!TARGET_NO_REORDER)
+ {
+ target_flags |= MASK_REORDER;
+ /* MicroBlaze v8.30a has an undocumented dependency on
+ pattern compare for swapb / swaph insns. */
+ if (TARGET_PATTERN_COMPARE)
+ microblaze_has_swap = 1;
+ }
+ }
+ else
+ {
+ if (!TARGET_NO_REORDER)
+ {
+ target_flags |= MASK_REORDER;
+ /* Microblaze versions greater than v8.30a will be able to use
+ swapb / swaph without pattern compare */
+ microblaze_has_swap = 1;
+ }
+ }
+
Refactor to eliminate duplicated code.
Why set the MASK_REORDER flag in target_flags if this is never used?
Options processing will set this automatically since you have
mxl-reorder
Target RejectNegative Mask(REORDER)
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077