problem on modifying gcc backend for riscv

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I am modifying riscv.md to make some changes in gcc backend for RISC-V.

I want "mul<mode>3" insn to expand to twp RTL insns. "mul<mode>3" is
responsible for floating point multiplication. I also want it to access
floating point control and status register and  do some other operations.
I am using  define_expand for this. I renamed the original "mul<mode>3"
instruction pattern to "modfloatmul".

mul<mode>3 generate two RTL insns:
1. modfloatmul
    This insn pattern will be responsible for carrying original work of
mul<mode>3 insn pattern i.e. multiplying floating point number.
2. riscv_frflags

(define_expand "mul<mode>3"
  [(match_operand:ANYF               0 "register_operand" "=f")
(match_operand:ANYF    1 "register_operand" " f")
(match_operand:ANYF 2 "register_operand" " f")]
  "TARGET_HARD_FLOAT"
{
rtx reg = gen_reg_rtx (SImode);
emit_insn (gen_modfloatmul (operands[0], operands[1], operands[2]));
if( fpexception == 3)
{ emit_insn(gen_riscv_frflags(reg));}
DONE;
})

(define_insn "modfloatmul"
  [(set (match_operand:ANYF               0 "register_operand" "=f")
(mult:ANYF (match_operand:ANYF    1 "register_operand" " f")
     (match_operand:ANYF 2 "register_operand" " f")))(use (match_operand:SI
3 ""))]
  "TARGET_HARD_FLOAT"
  "fmul.<fmt>\t%0,%1,%2"
  [(set_attr "type" "fmul")
   (set_attr "mode" "<UNITMODE>")])

The build fails with the message:
../../../riscv-gcc/gcc/config/riscv/riscv.md:578:1: duplicate definition of
'modfloatmul'.

Faisal Riyaz



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux