This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: moving v16sf reg with multiple sub-regs


I tried simplify_gen_subreg but it crashes with a compiler error. Maybe because V4SF isn't really thought of as a subreg of a V16SF at the moment? I am using gcc 3.3.3 right now so it might be just that it works in a later version of the compiler?

"Richard Sandiford" <rsandifo@redhat.com> wrote in message 87d5urs5ry.fsf@firetop.home">news:87d5urs5ry.fsf@firetop.home...
"Dylan Cuthbert" <dylan@q-games.com> writes:
   emit_move_insn( gen_rtx_SUBREG (V4SFmode, op0, 0  ), gen_rtx_MEM(
V4SFmode, src_reg ) );
   emit_move_insn( gen_rtx_SUBREG (V4SFmode, op0, 16 ), gen_rtx_MEM(
V4SFmode, plus_constant( src_reg, 16 ) ) );
   emit_move_insn( gen_rtx_SUBREG (V4SFmode, op0, 32 ), gen_rtx_MEM(
V4SFmode, plus_constant( src_reg, 32 ) ) );
   emit_move_insn( gen_rtx_SUBREG (V4SFmode, op0, 48 ), gen_rtx_MEM(
V4SFmode, plus_constant( src_reg, 48 ) ) );

Note that generating MEMs like this is a bad idea because it discards alias information. It's better to use functions like adjust_address instead.

It's probably also better to use simplify_gen_subreg instead of
gen_rtx_SUBREG.

Richard




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]