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]

sign_extending to values wider than hard registers


Hello,

I am quite new in writing .md files and I have got a question about
sign_extending to values wider than hard registers:

Let's imagine I have got a machine where the wider hard registers are HImode.
If I want to use a sign_extend pattern, how would it look like?

I have tried the following one:

(define_insn "extendhisi2"
    [(set (subreg:SI (match_operand:HI 0 "register_operand" "=r") 4)
          (sign_extend:SI (match_operand:HI 1 "register_operand" "r")))]

But it does not work.

Moreover, operands[0] is not the actual register I want to modify, in fact, it
would be the following one (Ex: If operands[0] is R0, I want to modify R1).

I am worried about that, because when expanding a value placed in R0 (for
instance), then gcc assumes that R1 has the sign_extension (which is false,
because nobody has put it there).

Surely I am missing something, but I do not know what :(

Thanks!

Pau Cabre
UPC Barcelona


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