;; Extension insns.
;; Those for integer source operand are ordered widest source type first.
-;; When TARGET_64BIT, all SImode integer registers should already be in
-;; sign-extended form (see TRULY_NOOP_TRUNCATION and truncdisi2). We can
-;; therefore get rid of register->register instructions if we constrain
-;; the source to be in the same register as the destination.
-;;
-;; The register alternative has type "arith" so that the pre-reload
-;; scheduler will treat it as a move. This reflects what happens if
-;; the register alternative needs a reload.
+;; When TARGET_64BIT, all SImode integer and accumulator registers
+;; should already be in sign-extended form (see TRULY_NOOP_TRUNCATION
+;; and truncdisi2). We can therefore get rid of register->register
+;; instructions if we constrain the source to be in the same register as
+;; the destination.
+;;
+;; Only the pre-reload scheduler sees the type of the register alternatives;
+;; we split them into nothing before the post-reload scheduler runs.
+;; These alternatives therefore have type "move" in order to reflect
+;; what happens if the two pre-reload operands cannot be tied, and are
+;; instead allocated two separate GPRs. We don't distinguish between
+;; the GPR and LO cases because we don't usually know during pre-reload
+;; scheduling whether an operand will be LO or not.
(define_insn_and_split "extendsidi2"
- [(set (match_operand:DI 0 "register_operand" "=d,d")
- (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "0,m")))]
+ [(set (match_operand:DI 0 "register_operand" "=d,l,d")
+ (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "0,0,m")))]
"TARGET_64BIT"
"@
+ #
#
lw\t%0,%1"
"&& reload_completed && register_operand (operands[1], VOIDmode)"
emit_note (NOTE_INSN_DELETED);
DONE;
}
- [(set_attr "move_type" "move,load")
+ [(set_attr "move_type" "move,move,load")
(set_attr "mode" "DI")])
(define_expand "extend<SHORT:mode><GPR:mode>2"