Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: jose.marchesi@oracle.com (Jose E. Marchesi)
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] testsuite: endianness in gnu_vector.exp
Date: Mon, 07 Oct 2013 19:34:00 -0000	[thread overview]
Message-ID: <87txgslvq2.fsf@oracle.com> (raw)
In-Reply-To: <87y564kj5i.fsf@fleche.redhat.com> (Tom Tromey's message of "Mon,	07 Oct 2013 12:52:57 -0600")


    Jose> Small patch making gnu_vector.exp to work properly in big-endian
    Jose> machines.
    
    The patch looks reasonable enough, but is this how casting to vector
    types works?  That is, is the gdb result here consistent with what gcc
    does?  This isn't clear from the existing test.
    
Well, this is all I can find on the gcc manual on casting vectors:

"It is possible to cast from one vector type to another, provided they
 are of the same size (in fact, you can also cast vectors to and from
 other datatypes of the same size)."

No explicit mention to the endianness issue.  But then the behavior of
gcc indicates that it stores the elements of the vectors in memory
ordering: the following program generates different results in x86_64 (2
0) and SPARC/BE (0 2).

typedef int __attribute__((vector_size(8))) vector_t;

void
main()
{
  long i = 2;
  vector_t v = (vector_t) i;
  printf ("%d %d\n", v[0], v[1]);
}

So it looks like the test is now consistent with what gcc does...


  reply	other threads:[~2013-10-07 19:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-07 14:31 Jose E. Marchesi
2013-10-07 18:53 ` Tom Tromey
2013-10-07 19:34   ` Jose E. Marchesi [this message]
2013-10-07 19:36     ` Tom Tromey
2013-10-21 12:36       ` Jose E. Marchesi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txgslvq2.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox