This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING2] New port for ... TILE-Gx
On 11/07/2011 03:28 PM, Walter Lee wrote:
> http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02084.html
TileGx:
Almost all the same comments as for TilePro.
I see that you've started some macroization of the port, but havn't completed it. E.g. sub<mode>3 vs addsi3+adddi3.
> (define_expand "addsf3"
Clever. I do wonder if it wouldn't be better to wait until after reload to split these though.
> (define_insn "*and_0x00000000FFFFFFFF"
> (define_insn "*and_0xFFFFFFFF00000000"
These probably should be merged into the main AND pattern. But failing that, they're only applicable to DImode and needn't be macroized.
> (define_expand "clzsi2"
> [(set (match_dup 2)
> (ashift:DI (match_operand:SI 1 "reg_or_0_operand" "")
> (const_int 32)))
> (set (subreg:DI (match_operand:SI 0 "register_operand" "") 0)
> (clz:DI (match_dup 2)))]
> ""
Generic code can handle this. Likewise ctz, popcount, parity.
> (define_insn "insn_cmpexch<four_if_si>"
> (define_insn "insn_exch<four_if_si>"
> (define_insn "insn_fetchadd<four_if_si>"
> (define_insn "insn_fetchand<four_if_si>"
> (define_insn "insn_fetchor<four_if_si>"
Use the atomic_ names and interfaces.
> #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
> #define FUNCTION_VALUE_REGNO_P(N) ((N) < TILEGX_NUM_RETURN_REGS)
> #define FUNCTION_ARG_REGNO_P(N) ((N) < TILEGX_NUM_ARG_REGS)
> #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
> #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
All of these are now target hooks. There may be more.
> /* We represent all SI values as sign-extended DI values in
> registers. */
> #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) \
> ((INPREC) <= 32 || (OUTPREC) > 32)
I think you should be *very* careful before you insist on this. Do you not have a memory mode that ignores the high bits for 32-bit pointers? From the description of "memoryReadWord", it does seem like you've got modes that pre-process input addresses.
MIPS uses this because, techinically, the 32-bit operation insns produce undefined results when given inputs that are not sign-extended. I see no such restriction in the TileGx manual.
At least in 64-bit pointer mode, I think you should drop this and make sure that you've got appropriate sign_extend patterns for all of the "x" insns. Similar to how x86_64 does for the zero_extend patterns.
r~