[Bug testsuite/51524] [BMI2] New regression on 182266 vs 182257

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 13 14:07:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51524

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-12-13
          Component|target                      |testsuite
     Ever Confirmed|0                           |1

--- Comment #1 from Uros Bizjak <ubizjak at gmail dot com> 2011-12-13 14:02:33 UTC ---
Actually, not a bug but problem with the testcase.

Previously, %edx was allocated for temporary, resulting in:

gen_mulx:
.LFB30:
    .cfi_startproc
#(insn:TI 20 4 23 2 (set (reg/v:SI 1 dx [orig:64 b ] [64])
#        (mem/c/i:SI (plus:SI (reg/f:SI 7 sp)
#                (const_int 8 [0x8])) [2 b+0 S4 A32])) bmi2-mulx32-1.c:24 64
{*movsi_internal}
#     (expr_list:REG_EQUIV (mem/c/i:SI (plus:SI (reg/f:SI 7 sp)
#                (const_int 8 [0x8])) [2 b+0 S4 A32])
#        (nil)))
    movl    8(%esp), %edx    # 20    *movsi_internal/1    [length = 4]
#(insn:TI 23 20 17 2 (parallel [
#            (set (reg:SI 0 ax [65])
#                (mult:SI (reg/v:SI 1 dx [orig:64 b ] [64])
#                    (mem/c/i:SI (plus:SI (reg/f:SI 7 sp)
#                            (const_int 4 [0x4])) [2 a+0 S4 A32])))
#            (set (reg:SI 1 dx [+4 ])
#                (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (reg/v:SI 1
dx [orig:64 b ] [64]))
#                            (zero_extend:DI (mem/c/i:SI (plus:SI (reg/f:SI 7
sp)
#                                        (const_int 4 [0x4])) [2 a+0 S4 A32])))
#                        (const_int 32 [0x20]))))
#        ]) bmi2-mulx32-1.c:24 337 {*bmi2_umulsidi3_1}
#     (nil))
    mulx    4(%esp), %eax, %edx    # 23    *bmi2_umulsidi3_1    [length = 7]

But now, %eax gets allocated as temporary, resulting in:

gen_mulx:
.LFB30:
    .cfi_startproc
#(insn:TI 20 4 9 2 (set (reg/v:SI 0 ax [orig:64 b ] [64])
#        (mem/c/i:SI (plus:SI (reg/f:SI 7 sp)
#                (const_int 8 [0x8])) [2 b+0 S4 A32])) bmi2-mulx32-1.c:24 64
{*movsi_internal}
#     (expr_list:REG_EQUIV (mem/c/i:SI (plus:SI (reg/f:SI 7 sp)
#                (const_int 8 [0x8])) [2 b+0 S4 A32])
#        (nil)))
    movl    8(%esp), %eax    # 20    *movsi_internal/1    [length = 4]
#(insn:TI 9 20 17 2 (parallel [
#            (set (reg:DI 0 ax [65])
#                (mult:DI (zero_extend:DI (reg/v:SI 0 ax [orig:64 b ] [64]))
#                    (zero_extend:DI (mem/c/i:SI (plus:SI (reg/f:SI 7 sp)
#                                (const_int 4 [0x4])) [2 a+0 S4 A32]))))
#            (clobber (reg:CC 17 flags))
#        ]) bmi2-mulx32-1.c:24 338 {*umulsidi3_1}
#     (expr_list:REG_UNUSED (reg:CC 17 flags)
#        (nil)))
    mull    4(%esp)    # 9    *umulsidi3_1/1    [length = 4]

(The latter version is IMO even better in this case).

A testcase should be fixed to force bmi2 alternative in:

(define_insn "*umul<mode><dwi>3_1"
  [(set (match_operand:<DWI> 0 "register_operand" "=A,r")
    (mult:<DWI>
      (zero_extend:<DWI>
        (match_operand:DWIH 1 "nonimmediate_operand" "%0,d"))
      (zero_extend:<DWI>
        (match_operand:DWIH 2 "nonimmediate_operand" "rm,rm"))))
   (clobber (reg:CC FLAGS_REG))]
  "!(MEM_P (operands[1]) && MEM_P (operands[2]))"
  "@
   mul{<imodesuffix>}\t%2
   #"
  [(set_attr "isa" "*,bmi2")
   ...



More information about the Gcc-bugs mailing list