public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Vector modes under hppa64-hpu
@ 2002-07-24 17:42 Steve Ellcey
  2002-07-24 18:12 ` Aldy Hernandez
  0 siblings, 1 reply; 26+ messages in thread
From: Steve Ellcey @ 2002-07-24 17:42 UTC (permalink / raw)
  To: aldyh; +Cc: gcc, dave

>  > Well, following up to my own mail, I have a couple of questions.  If I
>  > am on a system that does not support the VECTOR modes, should I ever see
>  > any rtx with a type of V2SImode?  I don't think I should, but I am
>  > not
> 
> yes.  It should opencode the V2SI with a pair of SIs.

I don't understand exactly what you mean by "opencode" but I assume you
are saying that it is OK to generate V2SI rtx nodes and they they will
get transformed into two SImode nodes at some point.  Is there a single
place where this transformation happens?  If so, where?

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Vector modes under hppa64-hpu
@ 2002-07-25 22:07 Joern Rennecke
  2002-07-26  1:56 ` John David Anglin
  0 siblings, 1 reply; 26+ messages in thread
From: Joern Rennecke @ 2002-07-25 22:07 UTC (permalink / raw)
  To: Aldy Hernandez; +Cc: sje, gcc, dave

>> Well, following up to my own mail, I have a couple of questions.  If I
>> am on a system that does not support the VECTOR modes, should I ever see
>> any rtx with a type of V2SImode?  I don't think I should, but I am
>> not
>
>yes.  It should opencode the V2SI with a pair of SIs.

It should be OK to use V2SImode as long as only subregs of that appear in operands
of insns.  e.g. if the targets supports DImode, you could move a V2SImode value
using DImode.
	
-- 
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Vector modes under hppa64-hpu
@ 2002-07-25 20:57 Joern Rennecke
  2002-07-25 21:21 ` Aldy Hernandez
  2002-07-27  7:35 ` Aldy Hernandez
  0 siblings, 2 replies; 26+ messages in thread
From: Joern Rennecke @ 2002-07-25 20:57 UTC (permalink / raw)
  To: Aldy Hernandez; +Cc: Steve Ellcey, gcc, dave

  	  else
  	    t = simplify_gen_subreg (submode, target, mode, i * subsize);
! 	  if (CONSTANT_P (op0) || GET_CODE (op0) == REG)
  	    a = simplify_gen_subreg (submode, op0, mode, i * subsize);
  	  else
  	    a = extract_bit_field (op0, subbitsize, i * subbitsize, unsignedp,
  				   NULL_RTX, submode, submode, size);
! 	  if (CONSTANT_P (op1) || GET_CODE (op1) == REG)
  	    b = simplify_gen_subreg (submode, op1, mode, i * subsize);
  	  else
  	    b = extract_bit_field (op1, subbitsize, i * subbitsize, unsignedp,


That doesn't work when submode is smaller than a word.  At register allocation
time, every subreg of a single hard register is assumed to be a low part,
even if its not.

-- 
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Vector modes under hppa64-hpu
@ 2002-07-25 15:19 Steve Ellcey
  2002-07-25 15:28 ` Aldy Hernandez
  0 siblings, 1 reply; 26+ messages in thread
From: Steve Ellcey @ 2002-07-25 15:19 UTC (permalink / raw)
  To: aldyh; +Cc: gcc, dave

I didn't do a full test suite run but it does fix simd-2 and simd-4 on
PA32 (the only simd failures I had last night).

Steve Ellcey
sje@cup.hp.com

> It looks like it's Joern's new simd code that's generating your bad
> instruction.  I have a quick fix for this [untested].  Can you give it
> a whirl and run tests?
> 
> Aldy

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Vector modes under hppa64-hpu
@ 2002-07-25 11:40 Steve Ellcey
  2002-07-25 14:52 ` Aldy Hernandez
  0 siblings, 1 reply; 26+ messages in thread
From: Steve Ellcey @ 2002-07-25 11:40 UTC (permalink / raw)
  To: aldyh, gcc; +Cc: dave

> With a checkout yesterday evening, I can confirm that simd-1.c no
> longers fails on hppa64-hp-hpux11.00.  On the minus side, there are
> a whole bunch on new regressions in other areas.

I got a pass on simd-1.c too.  I ran tests on PA32, PA64, and IA64;
while simd-1.c passed on all of them simd-2 and simd-4 failed on PA32
(hppa1.1-hp-hpux11.00) with -O2 but passed on PA64 or IA64.  On PA32 I
got:

[hpsje - sje_merge] $ obj_pa_gcc/gcc/cc1 -O2 simd-2.c
 tempf
simd-2.c: In function `tempf':
simd-2.c:17: error: unrecognizable insn:
(insn 24 23 25 0 7afa84c0 (set (subreg:SI (reg:SF 105) 0)
        (sign_extract:SI (subreg:SI (reg:DI 104) 0)
            (const_int 32 [0x20])
            (const_int 0 [0x0]))) -1 (insn_list 23 (nil))
    (nil))
simd-2.c:17: internal compiler error: Internal compiler error in extract_insn, at recog.c:2163
Please submit a full bug report,


Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Vector modes under hppa64-hpu
@ 2002-07-25  3:53 Steve Ellcey
  0 siblings, 0 replies; 26+ messages in thread
From: Steve Ellcey @ 2002-07-25  3:53 UTC (permalink / raw)
  To: aldyh; +Cc: dave, gcc

I'll try updating my sources and see if I can still reproduce it.  It
may be tomorrow before I have a chance to get back to you on my
success/failure.

Steve Ellcey
sje@cup.hp.com

> flamingo:~/build/pa64/gcc$ ./cc1 a.c -O2 -quiet
> flamingo:~/build/pa64/gcc$ ./cc1 a.c -O1 -quiet
> flamingo:~/build/pa64/gcc$ ./cc1 a.c -O -quiet
> flamingo:~/build/pa64/gcc$ 
> 
> no problem here either.  This is with a checkout from cvs as of right
> now.
> 
> 
> Aldy

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Vector modes under hppa64-hpu
@ 2002-07-25  2:02 Steve Ellcey
  2002-07-25  2:36 ` Aldy Hernandez
  0 siblings, 1 reply; 26+ messages in thread
From: Steve Ellcey @ 2002-07-25  2:02 UTC (permalink / raw)
  To: aldyh; +Cc: gcc, dave

> Can you post x.c so I can try to debug this?

Sorry, x.c is just gcc.c-torture/compile/simd-1.c, I rename all my tests
to x.c when I work on them.

$ cat x.c
typedef int v2si __attribute__ ((mode(V2SI)));
typedef unsigned di __attribute__ ((mode(DI)));
void foo(unsigned long);
void bar() {
    v2si x = { 1, 2 };
    foo((di) x);
}

> Also, can I can make a cross ia64-hpux (or whatever) to reproduce your
> error, as I don't have neither an ia64 nor a pa64.

I don't know if building a cross ia64-hpux will work or not, but a pa64
version should at least build cc1.  These two platforms are behaving
slightly differently for me.  I can make IA64 work at all optimization
levels with the change that I included in my earlier mail
(http://gcc.gnu.org/ml/gcc/2002-07/msg01148.html) but PA64 will only
work at -O0 with that change, -O1/-O2/etc still fail with the
simplify_gen_subreg message.

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Vector modes under hppa64-hpu
@ 2002-07-25  0:09 Steve Ellcey
  2002-07-25  1:01 ` Aldy Hernandez
  0 siblings, 1 reply; 26+ messages in thread
From: Steve Ellcey @ 2002-07-25  0:09 UTC (permalink / raw)
  To: aldyh; +Cc: gcc, dave

> see optabs.c:expand_vector_binop()

Well, it doesn't look like expand_vector_binop or expand_vector_unop are
the problem because they are never used when compiling simd-1.c.  This
is because neither expand_binop or expand_unop are ever called.  I just
have a SET rtx and this isn't handled by expand_binop.

So, should there be some code in (or called by) expand_assignment that
handles transforming V2SI into a couple of SI's.

On PA64 I go to expand_assignment and I call store_expr and I don't see
any code to map V2SI to SI in either of these routines so the V2SI types
just percolate through until they cause an error during optimization.

  [hpsje - sje_simd] $ obj_pa64_gcc/gcc/cc1 -O1 x.c
   bar
  x.c: In function `bar':
  x.c:7: internal compiler error: Internal compiler error in simplify_gen_subreg, at simplify-rtx.c:2598


Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Vector modes under hppa64-hpu
@ 2002-07-24 15:22 Steve Ellcey
  2002-07-24 16:30 ` Aldy Hernandez
  0 siblings, 1 reply; 26+ messages in thread
From: Steve Ellcey @ 2002-07-24 15:22 UTC (permalink / raw)
  To: gcc; +Cc: aldyh, dave

Well, following up to my own mail, I have a couple of questions.  If I
am on a system that does not support the VECTOR modes, should I ever see
any rtx with a type of V2SImode?  I don't think I should, but I am not
sure.  When I run simd-1.c with -O0 on IA64 or PA64 I never see any code
with this mode.  When I run with -O1 I do see such code.  I believe that
this code is coming from store_constructor in expr.c.  With -O1, when
"TREE_CODE (type) == VECTOR_TYPE" I wind up setting need_to_clear to 1
because I am storing into a (64 bit) register, and that in turn winds up
calling emit_move_insn with a mode of V2SImode and I think that is wrong
since my platform does not support V2SImode.  With -O0, I do not store
into a register so store_constructor doesn't set need_to_clear and
everything works OK.

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Vector modes under hppa64-hpu
@ 2002-07-24 14:11 Steve Ellcey
  0 siblings, 0 replies; 26+ messages in thread
From: Steve Ellcey @ 2002-07-24 14:11 UTC (permalink / raw)
  To: gcc; +Cc: aldyh, dave

I was looking at simd-1.c on IA64 HP-UX and PA64 HP-UX and I think I
have a fix for simd-1.c that works on IA64 all the time and on PA64 *if*
I do not optimize.  To get rid of the problem in emit_move_insn I made
the change shown in the attached patch.  The problem is that the size of
V2SI is the same as UNITS_PER_WORD on a 64 bit machine so
emit_move_insn_1 didn't handle it with its slow method but it also had
no code to handle it directly before it got to this test.  On a 32 bit
machine this test would be true because V2SI is 8 bytes and
UNITS_PER_WORD is 4.  I modified the test to allow it to be true for
vectors even if the size is not greater then UNITS_PER_WORD.

Does this seem like a reasonable fix?  Or should there be code to handle
this somewhere else in emit_move_insn_1?  I think the generated code
would be correct, just slow, but that shouldn't matter if the platform
we are on doesn't support VECTOR modes anyway.

The problem I have with this patch, and the reason I haven't submitted
it to gcc-patches is that even with this patch PA64 fails to compile
simd-1.c at -O1 or higher optimizations.  I get the following message:

 [hpsje - sje_simd] $ obj_pa64_gcc/gcc/cc1 -O1 simd-1.c
  bar
 simd-1.c: In function `bar':
 simd-1.c:7: internal compiler error: Internal compiler error in simplify_gen_subreg, at simplify-rtx.c:2598
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

I haven't figured out what the problem is here.  Any ideas on what to be
looking for?  I wind up in simplify_gen_subreg with innermode == VOIDmode
and outermode == DImode.  op is "(clobber (const_int 0 [0x0]))" and
byte is 0.

Steve Ellcey
sje@cup.hp.com





*** expr.c@@/main/hp/LATEST     Wed Jul 10 13:06:24 2002
--- expr.c      Tue Jul 23 11:29:21 2002
*************** emit_move_insn_1 (x, y)
*** 3043,3049 ****
    /* This will handle any multi-word mode that lacks a move_insn pattern.
       However, you will get better code if you define such patterns,
       even if they must turn into multiple assembler instructions.  */
!   else if (GET_MODE_SIZE (mode) > UNITS_PER_WORD)
      {
        rtx last_insn = 0;
        rtx seq, inner;
--- 3043,3050 ----
    /* This will handle any multi-word mode that lacks a move_insn pattern.
       However, you will get better code if you define such patterns,
       even if they must turn into multiple assembler instructions.  */
!   else if ((VECTOR_MODE_P (mode) && !VECTOR_MODE_SUPPORTED_P (mode))
!           || GET_MODE_SIZE (mode) > UNITS_PER_WORD)
      {
        rtx last_insn = 0;
        rtx seq, inner;

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Vector modes under hppa64-hpu
@ 2002-07-14 23:15 Aldy Hernandez
  0 siblings, 0 replies; 26+ messages in thread
From: Aldy Hernandez @ 2002-07-14 23:15 UTC (permalink / raw)
  To: John David Anglin, gcc

>>>>> "John" == John David Anglin <dave@hiauly1.hia.nrc.ca> writes:

 > The gcc.c-torture/compile/simd-1.c test fails under hppa64-hp-hpux11.x
 > because emit_move_insn is called with the following:

 > (gdb) p debug_rtx (x)
 > (subreg:V2SI (reg:DI 69) 0)
 > $2 = void
 > (gdb) p debug_rtx (y)
 > (mem/f:V2SI (reg/f:DI 62 virtual-stack-vars) [0 x+0 S8 A64])

 > There is no support to move V2SI modes, so this causes an abort.
 > VECTOR_MODE_SUPPORTED_P is not defined for the target.

It doesn't matter if VECTOR_MODE_SUPPORTED_P is defined or not.  The
purpose of simd-1.c is to test gcc's ability to synthesize the V2SI
from a pair of SI's.

So the bug is in the inability to open code the simd instruction, or
in the subreg.  Could you do a little more investigating please?

Aldy

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2002-07-27 22:18 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-24 17:42 Vector modes under hppa64-hpu Steve Ellcey
2002-07-24 18:12 ` Aldy Hernandez
  -- strict thread matches above, loose matches on Subject: below --
2002-07-25 22:07 Joern Rennecke
2002-07-26  1:56 ` John David Anglin
2002-07-25 20:57 Joern Rennecke
2002-07-25 21:21 ` Aldy Hernandez
2002-07-26  3:20   ` Joern Rennecke
2002-07-27  5:54     ` John David Anglin
2002-07-27  7:35 ` Aldy Hernandez
2002-07-28  9:52   ` Richard Henderson
2002-07-25 15:19 Steve Ellcey
2002-07-25 15:28 ` Aldy Hernandez
2002-07-25 11:40 Steve Ellcey
2002-07-25 14:52 ` Aldy Hernandez
2002-07-25  3:53 Steve Ellcey
2002-07-25  2:02 Steve Ellcey
2002-07-25  2:36 ` Aldy Hernandez
2002-07-25  2:54   ` John David Anglin
2002-07-25  2:56     ` Aldy Hernandez
2002-07-25 11:22       ` John David Anglin
2002-07-25  0:09 Steve Ellcey
2002-07-25  1:01 ` Aldy Hernandez
2002-07-24 15:22 Steve Ellcey
2002-07-24 16:30 ` Aldy Hernandez
2002-07-24 14:11 Steve Ellcey
2002-07-14 23:15 Aldy Hernandez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).