Article View: gnu.gcc.help
Article #53594Questions on m68k.md of GCC 1.39
From: shen xuemin
Date: Thu, 03 Oct 1991 05:36
Date: Thu, 03 Oct 1991 05:36
71 lines
3081 bytes
3081 bytes
---
hi
I have the pattern used for compare in my gcc-1.39 md file of Motorlar 68000 version, it looks as following:
(define_insn "cmpsi"
[(set (cc0)
(compare (match_operand:SI 0 "general_operand" "rKs,mr,>")
(match_operand:SI 1 "general_operand" "mr,Ksr,>")))]
""
"*
{
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
return \"cmpm%.l %1,%0\";
if (REG_P (operands[1])
|| (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
{ cc_status.flags |= CC_REVERSED;
#ifdef HPUX_ASM
return \"cmp%.l %d1,%d0\";
#else
return \"cmp%.l %d0,%d1\";
#endif
}
#ifdef HPUX_ASM
return \"cmp%.l %d0,%d1\";
#else
return \"cmp%.l %d1,%d0\";
#endif
}")
I don't know anything about the "HPUX_ASM" except it is a kind of assembler syntax, are there someone can give me some explanation?
The thing i want to understand is how does this pattern work? The pattern is asked to compare operand 0 with operand 1( subtract operand 1 from operand 0, then set the condition register without changing the operands), the assembly outputs are given with the _condition-include_ for different operand order in different assembler syntax, EXCEPT when those two operands are all memory ref, why the memory compare CMPM is spcial here? my cross assembler syntax is unfortunately to have the opposite operand order
in CMP instruction ( CMP dst,src), so i guess i should change the pattern of the CMPM too if there is no special meaning in the existing md file. On the other hand, if the "HPUX_ASM" is set, it seems the order of the operand in the HPUX_ASM between CMPM amd CMP is different, is it?
BTW, i also have a question on the next pattern in the same md file, it looks as:
(define_insn "cmphi"
[(set (cc0)
(compare (match_operand:HI 0 "general_operand" "rnm,d,n,m")
(match_operand:HI 1 "general_operand" "d,rnm,m,n")))]
""
"*
{
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
return \"cmpm%.w %1,%0\";
.....
when do these two operands fit the constraint and the this condition expression at the same time?
sorry, maybe the above is quite foolish, but i really need some explanations for
i can not find the answers from the manuals.
sherman
--------------------------------------------------
S H E R M A N
E-MAIL:sxm@lsa.ncl.omron.co.jp
sherman@nff.ncl.omron.co.jp
TELE :075-951-5111x3411
or 72313411
Technical Details
Message-ID:
<1037@frf.omron.co.jp>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!sun-barr!ccut!wnoc-tyo-news!astemgw!relay-omron!frf!sxmShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,ad102a108308f67b,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1991-10-03 17:52:04 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!sun-barr!ccut!wnoc-tyo-news!astemgw!relay-omron!frf!sxm From: sxm@lsa.ncl.omron (shen xuemin) Newsgroups: gnu.gcc.help Subject: Questions on m68k.md of GCC 1.39 Message-ID: <1037@frf.omron.co.jp> Date: 3 Oct 91 05:36:22 GMT Sender: news@frf.omron.co.jp Distribution: gnu Organization: OMRON Co., Ltd. Kyoto, Japan. Lines: 62