HI:
   There is comment on lui_movf in mips.md like following,

;; because we don't split it.  FIXME: we should split instead.

I can split it into a move and a condmove(movesi_on_cc) insns , like

(define_split
 [(set (match_operand:CC 0 "d_operand" "")
       (match_operand:CC 1 "fcc_reload_operand" ""))]
 "reload_completed && ISA_HAS_8CC && TARGET_HARD_FLOAT && ISA_HAS_CONDMOVE
 && !CANNOT_CHANGE_MODE_CLASS(CCmode, SImode,

REGNO_REG_CLASS(REGNO(operands[0])))"
 [(set (match_dup 2) (match_dup 3))
  (set (match_dup 2)
       (if_then_else:SI
          (eq:SI (match_dup 1)
                 (match_dup 4))
          (match_dup 2)
          (match_dup 4)))]
 "
 {
   operands[2] = gen_rtx_REG(SImode, REGNO(operands[0]));
   operands[3] = GEN_INT(0x3f800000);
   operands[4] = const0_rtx;
 }
 ")

But I have two questions.

Firstly, the lui_movf pattern is output as
"lui\t%0,0x3f80\n\tmovf\t%0,%.,%1" in mips_output_move,
why 0x3f80? is it some kind of magic number, or anything else important?

Secondly, I have to change mode of operands[0] into SImode when
splitting, otherwise there is no
insn pattern matching the first insn generated.
Since no new REG generated I assuming the mode transforming is OK
here, any suggestion?

Thanks.
-- 
Best Regards.

Reply via email to