This is the mail archive of the gcc@gcc.gnu.org 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: SH: may miscompile zero extension and test


kaz Kojima wrote:
(insn 52 51 53 1 (set (reg:SI 147 t)
        (eq:SI (subreg:SI (reg:QI 178 [ a ]) 0)
            (const_int 0 [0x0]))) 1 {cmpeqsi_t} (insn_list 50 (nil))
    (expr_list:REG_DEAD (reg:QI 178 [ a ])
        (nil)))

Subregs act much like regs when recognizing operands. So if (REG:SI ...) is a valid operand, then so is (subreg:SI ...).


The SH port defines WORD_REGISTER_OPERATIONS, which means if you put a QImode value in a register, then you can interchangable use either (reg:SI) or (reg:qi) because moving a QImode value sets the entire register.

You do have to get the signedness right though. There is some interaction with LOAD_EXTEND_OP here to only generate the paradoxical subreg when the signedness is OK. There are occasional problems with this code.

It isn't obvious what is wrong from your assembly language fragment.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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