This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: unspec in machine description file
- From: Andrew Haley <aph at redhat dot com>
- To: Cherry Vanc <cherry dot vanc at gmail dot com>, gcc-help at gcc dot gnu dot org
- Date: Wed, 03 Sep 2014 11:03:07 +0100
- Subject: Re: unspec in machine description file
- Authentication-results: sourceware.org; auth=none
- References: <CANqEaAd1CBza16pNUz911i9tQS+U_HX1s1v6wEMwqRDB6B09Fg at mail dot gmail dot com>
On 03/09/14 02:31, Cherry Vanc wrote:
> I cannot seem to pin down the scope of the keyword "unspec" in the
> machine description files. From the MIPS backend files, I see the word
> "unspec" being used in two ways :
>
> 1. names of constants (UNSPEC_LOAD_LOW, UNSPEC_LOAD_HIGH, .. so on) :
> I understand that these are just names, but Why UNSPEC_ preceding each
> name ?
> 2. some define_insn patterns have the "unspec" rtl expression. What
> does "unspec" precisely mean here - unspecified operation ? How does
> that work in the RTL generation pass ? E.g. :
>
> (define_insn "<u>mulsidi3_64bit_hilo"
> [(set (match_operand:TI 0 "register_operand" "=x")
> (unspec:TI
> [(mult:DI
> (any_extend:DI (match_operand:SI 1 "register_operand" "d"))
> (any_extend:DI (match_operand:SI 2 "register_operand" "d")))]
> UNSPEC_SET_HILO))]
> "TARGET_64BIT && !TARGET_FIX_R4000"
> "mult<u>\t%1,%2"
> [(set_attr "type" "imul")
> (set_attr "mode" "SI")])
Look at
(define_expand "<u>mulsidi3_64bit_split"
[(set (match_operand:DI 0 "register_operand")
(mult:DI (any_extend:DI (match_operand:SI 1 "register_operand"))
(any_extend:DI (match_operand:SI 2 "register_operand"))))
(clobber (match_operand:DI 3 "register_operand"))]
""
{
rtx hilo;
hilo = gen_rtx_REG (TImode, MD_REG_FIRST);
emit_insn (gen_<u>mulsidi3_64bit_hilo (hilo, operands[1], operands[2]));
...
Andrew.