This is the mail archive of the 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: PATCH: Support -mmovbe

H.J. Lu wrote:

The constraints on expanders are actually not that important. The
constraints on the insns pattern operands are what matters, and combine does
a great job to merge memory operands whenever it can.
(define_expand "bswapsi2"
 [(set (match_operand:SI 0 "register_operand" "")
       (bswap:SI (match_operand:SI 1 "register_operand" "")))]

The new movbe pattern will be used optimizer.

Please see attached part of the patch. The patch assumes that
TARGET_MOVBE also supports bswap insn, so following part is not needed

+  /* Enable bswap if movbe is enabled.  */
+    TARGET_BSWAP = 1;

BTW: the patch uses shadowing to select between two patterns.

2009-05-21 H.J. Lu <>
Uros Bizjak <>

* config/i386/cpuid.h (bit_MOVBE): New.

* config/i386/driver-i386.c (host_detect_local_cpu): Check movbe.

	* config/i386/i386.c (OPTION_MASK_ISA_MOVBE_SET): New.
	(ix86_handle_option): Handle OPT_mmovbe.
	(ix86_target_string): Add -mmovbe.
	(pta_flags): Add PTA_MOVBE.
	(processor_alias_table): Add PTA_MOVBE to "atom".
	(override_options): Handle PTA_MOVBE.

* config/i386/i386.h (TARGET_MOVBE): New.

	* config/i386/ (bswapsi2): Check TARGET_MOVBE.
	(*bswapsi_movbe): New.
        (*bswapdi_movbe): Likewise.
	(bswapdi2): Renamed to ...
	(*bswapdi_1): This.
	(bswapdi2): New expander.

* config/i386/i386.opt (mmovbe): New.

* doc/invoke.texi: Document -mmovbe.


2009-05-21 H.J. Lu <>

* New.
* Likewise.
Here is the updated patch. There is no need to check TARGET_BSWAP
for TARGET_64BIT. OK for trunk?

This is OK for mainline.


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