1 msggcc-4.4-20080321 is now available
3 msgWhat licence(s) does GNAT and the runtime fall ...
1 msggcc-4.3-20080320 is now available
6 msgexecutable stack in gcc shared libs?
1 msgRE: A proposal to align GCC stack
1 msgException handling on AIX5.3 with gcc 3.4.6
3 msgUnaligned attribute

Is vec_init<mode> allowed to FAIL?
\ Jan Hoogerbrugge (20 Mar 2008)
. \ Jim Wilson (22 Mar 2008)

3 msgHave proposals for 2008 gcc summit been reviewed?
2 msgLexer/cpplib improvements
8 msgObvious problem with Ada front-end patches hand...
1 msgCome join me on ssbbw4u...
1 msggcc-4.2-20080319 is now available
1 msgpush_secondary_reload: give me a break...
8 msgGCC 4.3 license in manual still under GPLv2
2 msgGNU linker ld
1 msgRe: Regression with ltrans-7.f90
2 msgC++0x rvalue references get clobbered somehow
2 msg4.3.0 manual vs changes.html
6 msggcj broken on darwin
Subject:Is vec_init<mode> allowed to FAIL?
Group:Gcc
From:Jan Hoogerbrugge
Date:20 Mar 2008


Hi,

I am trying to define vec_init<mode>. I can only do splats on register
values. So
operands[1] of vec_init should be registers and those registers should
be the same.

Here is some code:

(define_expand "vec_init<mode>"
[(match_operand:VEC_MODE32 0 "register_operand" "")
(match_operand 1 "register_operand" "")]
""
{
if(trimedia_expand_vector_init(operands[0], operands[1]))
DONE;
else
FAIL;
}
)

int
trimedia_expand_vector_init (rtx target, rtx vals)
{
enum machine_mode mode = GET_MODE (target);
enum machine_mode inner_mode = GET_MODE_INNER (mode);
int n_elts = GET_MODE_NUNITS (mode);
rtx elem, tmp1, tmp2;
int i;

for (i = 0; i < n_elts; ++i)
{
elem = XVECEXP (vals, 0, i);
if (CONSTANT_P (elem))
return 0;
if (!rtx_equal_p (elem, XVECEXP (vals, 0, 0)))
return 0;
}

tmp1 = gen_reg_rtx (SImode);
tmp2 = gen_reg_rtx (SImode);

if (GET_MODE_SIZE (mode) == 4)
{
if (inner_mode == QImode)
{
emit_insn (gen_packqi (tmp1, elem, elem));
emit_insn (gen_packhi (target, tmp1, tmp1));
return 1;
}
else if (inner_mode == HImode)
{
emit_insn (gen_packhi (target, elem, elem));
return 1;
}
}
else if (GET_MODE_SIZE (mode) == 8)
{
if (inner_mode == QImode)
{
emit_insn (gen_packqi (tmp1, elem, elem));
emit_insn (gen_packhi (tmp2, tmp1, tmp1));
emit_insn (gen_packsi (target, tmp2, tmp2));
return 1;
}
else if (inner_mode == HImode)
{
emit_insn (gen_packhi (tmp2, elem, elem));
emit_insn (gen_packsi (target, tmp2, tmp2));
return 1;
}
}

return 0;
}

I see however that no code is generated if trimedia_expand_vector_init()
returns 0 and the define_expand FAILs. I also see in other targets that a
vec_init always ends with a DONE. Could it be that vec_init is not allowed to
FAIL?

Regards,
Jan


© 2004-2008 readlist.com