* config/i386/i386.md (bswaphi2): New expander.
(*bswaphi2_movbe): New insn pattern.
(bswaphi -> rorhi pepehole2): New peephole pattern.
testsuite/ChangeLog:
* gcc.target/i386/movbe-5.c: New test.
From-SVN: r254967
+2017-11-20 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (bswaphi2): New expander.
+ (*bswaphi2_movbe): New insn pattern.
+ (bswaphi -> rorhi pepehole2): New peephole pattern.
+
2017-11-20 Jeff Law <law@redhat.com>
* Makefile.in (OBJS): Add gimple-ssa-evrp-analyze.o.
2017-11-19 Jan Hubicka <hubicka@ucw.cz>
PR target/82713
- * i386.c (ix86_builtin_vectorization_cost): Be ready for insane
- types.
+ * i386.c (ix86_builtin_vectorization_cost): Be ready for insane types.
2017-11-19 Tom de Vries <tom@codesourcery.com>
2017-11-17 Jan Hubicka <hubicka@ucw.cz>
- * ipa-cp.c (update_profiling_info): Handle conversion to local
- profile.
+ * ipa-cp.c (update_profiling_info): Handle conversion to local profile.
* tree-cfg.c (execute_fixup_cfg): Do fixup same way as inliner does.
2017-11-17 Jeff Law <law@redhat.com>
* doc/invoke.texi (-std=c17): Refer to 2018 expected publication
date of C17.
- (-std=c18, -std=iso9899:2018, -std=gnu18): Document option
- aliases.
+ (-std=c18, -std=iso9899:2018, -std=gnu18): Document option aliases.
2017-11-16 Thomas Koenig <tkoenig@gcc.gnu.org>
2017-11-16 Jan Hubicka <hubicka@ucw.cz>
- * predict.c (combine_predictions_for_bb): Preserve zero predicted
- eges.
+ * predict.c (combine_predictions_for_bb): Preserve zero predicted
+ edges.
(expensive_function_p): Remove useless assert.
(determine_unlikely_bbs): Propagate also forward; determine cold blocks
2017-11-06 James Bowman <james.bowman@ftdichip.com>
- * gcc/dwarf2out.c (modified_type_die): Retain ADDR_SPACE
- qualifiers.
- (add_type_attribute) likewise.
+ * gcc/dwarf2out.c (modified_type_die): Retain ADDR_SPACE qualifiers.
+ (add_type_attribute) likewise.
2017-11-06 H.J. Lu <hongjiu.lu@intel.com>
* doc/tm.texi (TARGET_FLOATN_BUILTIN_P): Likewise.
2017-10-31 Matthew Fortune <matthew.fortune@imgtec.com>
- Eric Botcazou <ebotcazou@adacore.com>
+ Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/81803
* lra-constraints.c (curr_insn_transform): Also reload the whole
2017-10-31 Olivier Hainque <hainque@adacore.com>
- * gcc/Makefile.in (FLAGS_TO_PASS): Pass libsubdir as well.
+ * gcc/Makefile.in (FLAGS_TO_PASS): Pass libsubdir as well.
2017-10-31 Julia Koval <julia.koval@intel.com>
(set_attr "modrm" "0")
(set_attr "mode" "<MODE>")])
+(define_expand "bswaphi2"
+ [(set (match_operand:HI 0 "register_operand")
+ (bswap:HI (match_operand:HI 1 "nonimmediate_operand")))]
+ "TARGET_MOVBE")
+
+(define_insn "*bswaphi2_movbe"
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=Q,r,m")
+ (bswap:HI (match_operand:HI 1 "nonimmediate_operand" "0,m,r")))]
+ "TARGET_MOVBE
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "@
+ xchg{b}\t{%h0, %b0|%b0, %h0}
+ movbe\t{%1, %0|%0, %1}
+ movbe\t{%1, %0|%0, %1}"
+ [(set_attr "type" "imov")
+ (set_attr "modrm" "*,1,1")
+ (set_attr "prefix_0f" "*,1,1")
+ (set_attr "prefix_extra" "*,1,1")
+ (set_attr "pent_pair" "np,*,*")
+ (set_attr "athlon_decode" "vector,*,*")
+ (set_attr "amdfam10_decode" "double,*,*")
+ (set_attr "bdver1_decode" "double,*,*")
+ (set_attr "mode" "QI,HI,HI")])
+
+(define_peephole2
+ [(set (match_operand:HI 0 "general_reg_operand")
+ (bswap:HI (match_dup 0)))]
+ "TARGET_MOVBE
+ && !(TARGET_USE_XCHGB || optimize_function_for_size_p (cfun))
+ && peep2_regno_dead_p (0, FLAGS_REG)"
+ [(parallel [(set (match_dup 0) (rotate:HI (match_dup 0) (const_int 8)))
+ (clobber (reg:CC FLAGS_REG))])])
+
(define_insn "*bswaphi_lowpart_1"
[(set (strict_low_part (match_operand:HI 0 "register_operand" "+Q,r"))
(bswap:HI (match_dup 0)))
+2017-11-20 Uros Bizjak <ubizjak@gmail.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.target/i386/movbe-5.c: New test.
+
2017-11-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/79072
--- /dev/null
+/* PR tree-optimization/78821 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mmovbe" } */
+/* { dg-final { scan-assembler-times "movbe\[ \t\]" 2 } } */
+
+unsigned short
+foo (unsigned short *buf)
+{
+ unsigned short a = buf[0];
+ return ((unsigned short) (a >> 8)) | (unsigned short) (a << 8);
+}
+
+void
+bar (char *buf, unsigned int data)
+{
+ buf[0] = data >> 8;
+ buf[1] = data;
+}