]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386.c (ix86_print_operand_punct_valid_p): Add '^'.
authorUros Bizjak <uros@gcc.gnu.org>
Wed, 7 Mar 2012 15:44:52 +0000 (16:44 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 7 Mar 2012 15:44:52 +0000 (16:44 +0100)
* config/i386/i386.c (ix86_print_operand_punct_valid_p): Add '^'.
(ix86_print_operand): Handle '^'.
* config/i386/i386.md (*strmovdi_rex_1): Macroize memory operands
using P mode iterator.  Add %^ to asm template to conditionally emit
addr32 prefix.
(*rep_movdi_rex64): Ditto.
(*strsetdi_rex_1): Ditto.
(*rep_stosdi_rex64): Ditto.
(*strmov{si,hi,qi}_1): Add %^ to asm template to
conditionally emit addr32 prefix.
(*rep_mov{si,qi}): Ditto.
(*strset{si,hi,qi}): Ditto.
(*rep_stos{si,qi}): Ditto.
(*cmpstrnqi_nz_1): Ditto.
(*cmpstrnqi_1): Ditto.
(*strlenqi_1): Ditto.

From-SVN: r185058

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.md

index a4236cd14964ca0bef50fbaf68ce5ddfc856a582..2c270fb2aa4db5bc8932ce47a782e595288a7531 100644 (file)
@@ -1,3 +1,22 @@
+2012-03-07  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.c (ix86_print_operand_punct_valid_p): Add '^'.
+       (ix86_print_operand): Handle '^'.
+       * config/i386/i386.md (*strmovdi_rex_1): Macroize memory operands
+       using P mode iterator.  Add %^ to asm template to conditionally emit
+       addr32 prefix.
+       (*rep_movdi_rex64): Ditto.
+       (*strsetdi_rex_1): Ditto.
+       (*rep_stosdi_rex64): Ditto.
+       (*strmov{si,hi,qi}_1): Add %^ to asm template to
+       conditionally emit addr32 prefix.
+       (*rep_mov{si,qi}): Ditto.
+       (*strset{si,hi,qi}): Ditto.
+       (*rep_stos{si,qi}): Ditto.
+       (*cmpstrnqi_nz_1): Ditto.
+       (*cmpstrnqi_1): Ditto.
+       (*strlenqi_1): Ditto.
+
 2012-03-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/i386.c (function_value_64): Return pointers in
@@ -10,8 +29,7 @@
        (get_gcov_unsigned_t): Likewise.
        * expr.c (store_constructor): Use type_for_mode.
        (try_casesi): Likewise.
-       * tree-ssa-loop-ivopts.c (add_standard_iv_candidates_for_size):
-       Remove.
+       * tree-ssa-loop-ivopts.c (add_standard_iv_candidates_for_size): Remove.
        (add_standard_iv_candidates): Use standard type trees.
        * dojump.c (do_jump): Remove dead code.
 
        all callers to pass NULL except ...
        (reset_sched_cycles_in_current_ebb): ... here, save the value
        in new variable 'empty'.  Increase issue_rate only for
-       non-empty insns. 
+       non-empty insns.
 
 2012-03-07  Ralf Corsépius  <ralf.corsepius@rtems.org>
 
        PR target/51417
-       * Makefile.in: Let install-gcc-ar depend on installdirs, gcc-ar$(exeext),
-       gcc-nm$(exeext), gcc-ranlib$(exeext).
+       * Makefile.in: Let install-gcc-ar depend on installdirs,
+       gcc-ar$(exeext), gcc-nm$(exeext), gcc-ranlib$(exeext).
        Don't double canonicalize if cross-compiling.
 
 2012-03-07  Georg-Johann Lay  <avr@gjlay.de>
        (vector_ltgt<mode>): Likewise.
        (vector_ordered<mode>): Likewise.
        (vector_unordered<mode>): Likewise.
-       * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner):
-       Likewise.
+       * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise.
 
 2012-03-06  Aldy Hernandez  <aldyh@redhat.com>
 
 
 2012-03-06  Tristan Gingold  <gingold@adacore.com>
 
-       * config/vms/vms-c.c (vms_pragma_nomember_alignment): Handle
-       octaword.
+       * config/vms/vms-c.c (vms_pragma_nomember_alignment): Handle octaword.
        (external_model_kind): Improve documentation.
        (vms_pragma_extern_model): Handle relaxed_redef.
        (vms_c_register_pragma): Allow expansion for nomember_alignment.
        * genautomata.c (parse_automata_opt): New static function.
        (initiate_automaton_gen): Remove all option handling code.  Remove
        argc argument.  All callers changed.
-       (main): Call init_rtx_reader_args_cb with the new function as
-       argument.
+       (main): Call init_rtx_reader_args_cb with the new function as argument.
 
 2012-03-05  Richard Guenther  <rguenther@suse.de>
 
index 0527a2f2e1c9134ca51de7300185599366b490ec..7361df894a421c05d63babc60d34d8023390e90a 100644 (file)
@@ -13743,6 +13743,7 @@ get_some_local_dynamic_name (void)
    ; -- print a semicolon (after prefixes due to bug in older gas).
    ~ -- print "i" if TARGET_AVX2, "f" otherwise.
    @ -- print a segment register of thread base pointer load
+   ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode
  */
 
 void
@@ -14248,6 +14249,11 @@ ix86_print_operand (FILE *file, rtx x, int code)
          putc (TARGET_AVX2 ? 'i' : 'f', file);
          return;
 
+       case '^':
+         if (TARGET_64BIT && Pmode != word_mode)
+           fputs ("addr32 ", file);
+         return;
+
        default:
            output_operand_lossage ("invalid operand code '%c'", code);
        }
@@ -14387,8 +14393,8 @@ ix86_print_operand (FILE *file, rtx x, int code)
 static bool
 ix86_print_operand_punct_valid_p (unsigned char code)
 {
-  return (code == '@' || code == '*' || code == '+'
-         || code == '&' || code == ';' || code == '~');
+  return (code == '@' || code == '*' || code == '+' || code == '&'
+         || code == ';' || code == '~' || code == '^');
 }
 \f
 /* Print a memory operand whose address is ADDR.  */
index bfbf5bf14bcd4a8240eebc487fd8991103cd1886..f000cc6a271b2969c599fcb5d1ec8d575d604a60 100644 (file)
@@ -60,7 +60,9 @@
 ;; Y -- print condition for XOP pcom* instruction.
 ;; + -- print a branch hint as 'cs' or 'ds' prefix
 ;; ; -- print a semicolon (after prefixes due to bug in older gas).
+;; ~ -- print "i" if TARGET_AVX2, "f" otherwise.
 ;; @ -- print a segment register of thread base pointer load
+;; ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode
 
 (define_c_enum "unspec" [
   ;; Relocation specifiers
   "ix86_current_function_needs_cld = 1;")
 
 (define_insn "*strmovdi_rex_1"
-  [(set (mem:DI (match_operand:DI 2 "register_operand" "0"))
-       (mem:DI (match_operand:DI 3 "register_operand" "1")))
-   (set (match_operand:DI 0 "register_operand" "=D")
-       (plus:DI (match_dup 2)
-                (const_int 8)))
-   (set (match_operand:DI 1 "register_operand" "=S")
-       (plus:DI (match_dup 3)
-                (const_int 8)))]
+  [(set (mem:DI (match_operand:P 2 "register_operand" "0"))
+       (mem:DI (match_operand:P 3 "register_operand" "1")))
+   (set (match_operand:P 0 "register_operand" "=D")
+       (plus:P (match_dup 2)
+               (const_int 8)))
+   (set (match_operand:P 1 "register_operand" "=S")
+       (plus:P (match_dup 3)
+               (const_int 8)))]
   "TARGET_64BIT
    && !(fixed_regs[SI_REG] || fixed_regs[DI_REG])"
-  "movsq"
+  "%^movsq"
   [(set_attr "type" "str")
    (set_attr "memory" "both")
    (set_attr "mode" "DI")])
        (plus:P (match_dup 3)
                (const_int 4)))]
   "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])"
-  "movs{l|d}"
+  "%^movs{l|d}"
   [(set_attr "type" "str")
    (set_attr "memory" "both")
    (set_attr "mode" "SI")])
        (plus:P (match_dup 3)
                (const_int 2)))]
   "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])"
-  "movsw"
+  "%^movsw"
   [(set_attr "type" "str")
    (set_attr "memory" "both")
    (set_attr "mode" "HI")])
        (plus:P (match_dup 3)
                (const_int 1)))]
   "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])"
-  "movsb"
+  "%^movsb"
   [(set_attr "type" "str")
    (set_attr "memory" "both")
    (set (attr "prefix_rex")
   "ix86_current_function_needs_cld = 1;")
 
 (define_insn "*rep_movdi_rex64"
-  [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0))
-   (set (match_operand:DI 0 "register_operand" "=D")
-        (plus:DI (ashift:DI (match_operand:DI 5 "register_operand" "2")
-                           (const_int 3))
-                (match_operand:DI 3 "register_operand" "0")))
-   (set (match_operand:DI 1 "register_operand" "=S")
-        (plus:DI (ashift:DI (match_dup 5) (const_int 3))
-                (match_operand:DI 4 "register_operand" "1")))
+  [(set (match_operand:P 2 "register_operand" "=c") (const_int 0))
+   (set (match_operand:P 0 "register_operand" "=D")
+        (plus:P (ashift:P (match_operand:P 5 "register_operand" "2")
+                         (const_int 3))
+               (match_operand:P 3 "register_operand" "0")))
+   (set (match_operand:P 1 "register_operand" "=S")
+        (plus:P (ashift:P (match_dup 5) (const_int 3))
+               (match_operand:P 4 "register_operand" "1")))
    (set (mem:BLK (match_dup 3))
        (mem:BLK (match_dup 4)))
    (use (match_dup 5))]
   "TARGET_64BIT
    && !(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])"
-  "rep{%;} movsq"
+  "%^rep{%;} movsq"
   [(set_attr "type" "str")
    (set_attr "prefix_rep" "1")
    (set_attr "memory" "both")
        (mem:BLK (match_dup 4)))
    (use (match_dup 5))]
   "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])"
-  "rep{%;} movs{l|d}"
+  "%^rep{%;} movs{l|d}"
   [(set_attr "type" "str")
    (set_attr "prefix_rep" "1")
    (set_attr "memory" "both")
        (mem:BLK (match_dup 4)))
    (use (match_dup 5))]
   "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])"
-  "rep{%;} movsb"
+  "%^rep{%;} movsb"
   [(set_attr "type" "str")
    (set_attr "prefix_rep" "1")
    (set_attr "memory" "both")
   "ix86_current_function_needs_cld = 1;")
 
 (define_insn "*strsetdi_rex_1"
-  [(set (mem:DI (match_operand:DI 1 "register_operand" "0"))
+  [(set (mem:DI (match_operand:P 1 "register_operand" "0"))
        (match_operand:DI 2 "register_operand" "a"))
-   (set (match_operand:DI 0 "register_operand" "=D")
-       (plus:DI (match_dup 1)
-                (const_int 8)))]
+   (set (match_operand:P 0 "register_operand" "=D")
+       (plus:P (match_dup 1)
+               (const_int 8)))]
   "TARGET_64BIT
    && !(fixed_regs[AX_REG] || fixed_regs[DI_REG])"
-  "stosq"
+  "%^stosq"
   [(set_attr "type" "str")
    (set_attr "memory" "store")
    (set_attr "mode" "DI")])
        (plus:P (match_dup 1)
                (const_int 4)))]
   "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])"
-  "stos{l|d}"
+  "%^stos{l|d}"
   [(set_attr "type" "str")
    (set_attr "memory" "store")
    (set_attr "mode" "SI")])
        (plus:P (match_dup 1)
                (const_int 2)))]
   "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])"
-  "stosw"
+  "%^stosw"
   [(set_attr "type" "str")
    (set_attr "memory" "store")
    (set_attr "mode" "HI")])
        (plus:P (match_dup 1)
                (const_int 1)))]
   "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])"
-  "stosb"
+  "%^stosb"
   [(set_attr "type" "str")
    (set_attr "memory" "store")
    (set (attr "prefix_rex")
   "ix86_current_function_needs_cld = 1;")
 
 (define_insn "*rep_stosdi_rex64"
-  [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0))
-   (set (match_operand:DI 0 "register_operand" "=D")
-        (plus:DI (ashift:DI (match_operand:DI 4 "register_operand" "1")
-                           (const_int 3))
-                (match_operand:DI 3 "register_operand" "0")))
+  [(set (match_operand:P 1 "register_operand" "=c") (const_int 0))
+   (set (match_operand:P 0 "register_operand" "=D")
+        (plus:P (ashift:P (match_operand:P 4 "register_operand" "1")
+                         (const_int 3))
+                (match_operand:P 3 "register_operand" "0")))
    (set (mem:BLK (match_dup 3))
        (const_int 0))
    (use (match_operand:DI 2 "register_operand" "a"))
    (use (match_dup 4))]
   "TARGET_64BIT
    && !(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])"
-  "rep{%;} stosq"
+  "%^rep{%;} stosq"
   [(set_attr "type" "str")
    (set_attr "prefix_rep" "1")
    (set_attr "memory" "store")
    (use (match_operand:SI 2 "register_operand" "a"))
    (use (match_dup 4))]
   "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])"
-  "rep{%;} stos{l|d}"
+  "%^rep{%;} stos{l|d}"
   [(set_attr "type" "str")
    (set_attr "prefix_rep" "1")
    (set_attr "memory" "store")
    (use (match_operand:QI 2 "register_operand" "a"))
    (use (match_dup 4))]
   "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])"
-  "rep{%;} stosb"
+  "%^rep{%;} stosb"
   [(set_attr "type" "str")
    (set_attr "prefix_rep" "1")
    (set_attr "memory" "store")
    (clobber (match_operand:P 1 "register_operand" "=D"))
    (clobber (match_operand:P 2 "register_operand" "=c"))]
   "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])"
-  "repz{%;} cmpsb"
+  "%^repz{%;} cmpsb"
   [(set_attr "type" "str")
    (set_attr "mode" "QI")
    (set (attr "prefix_rex")
    (clobber (match_operand:P 1 "register_operand" "=D"))
    (clobber (match_operand:P 2 "register_operand" "=c"))]
   "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])"
-  "repz{%;} cmpsb"
+  "%^repz{%;} cmpsb"
   [(set_attr "type" "str")
    (set_attr "mode" "QI")
    (set (attr "prefix_rex")
    (clobber (match_operand:P 1 "register_operand" "=D"))
    (clobber (reg:CC FLAGS_REG))]
   "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])"
-  "repnz{%;} scasb"
+  "%^repnz{%;} scasb"
   [(set_attr "type" "str")
    (set_attr "mode" "QI")
    (set (attr "prefix_rex")