public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@gcc.gnu.org>
To: Christian Schoenebeck <cuse@users.sourceforge.net>
Cc: gcc-help@gcc.gnu.org, linuxsampler-devel@lists.sourceforge.net
Subject: Re: GCC Vector Extensions
Date: Wed, 19 Apr 2006 14:03:00 -0000	[thread overview]
Message-ID: <17478.17160.976293.718811@zapata.pink> (raw)
In-Reply-To: <200604191440.05820.cuse@users.sourceforge.net>

Christian Schoenebeck writes:
 > Es geschah am Wednesday, 19. April 2006 10:30 als Andrew Haley schrieb:
 > >  > Unfortunately we found a case [1] which did not work at all: a type cast
 > >  > from float vector to integer vector, like:
 > >  >
 > >  >     typedef float   v4sf  __attribute__ ((vector_size(16),aligned(16)));
 > >  >     typedef int     v4i   __attribute__ ((vector_size(sizeof(int)*4)));
 > >  >
 > >  >     int main() {
 > >  >         const v4sf v = { 1.2f ,2.2f ,3.3f, 4.4f };
 > >  >         const v4i vRes = (v4i) v;
 > >  >     }
 > >  >
 > >  > The resulting integer vector vRes would simply contain crap.
 > >  > Is this a bug, not implemented yet or even intentional?
 > >
 > > I don't know, because there's not enough information here.  Can you
 > > produce a runnable test case?
 > 
 > Ok, attached you find one with output. When you run it, it should actually 
 > show this:
 > 
 > 	v4sf v = { 1.200000, 2.200000, 3.300000, 4.400000 }
 > 	v4i vRes = { 1, 2, 3, 4 }
 > 
 > but instead I get this:
 > 
 > 	v4sf v = { 1.200000, 2.200000, 3.300000, 4.400000 }
 > 	v4i vRes = { 1067030938, 1074580685, 1079194419, 1082969293 }
 > 
 > I can hardly believe this is intentional, is it?

I've started a conversation on the gcc discuss list, and we think it's
probably a bug.  There's a thread at
http://gcc.gnu.org/ml/gcc/2006-04/msg00349.html.

Andrew.



  parent reply	other threads:[~2006-04-19 14:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-07 19:03 Christian Schoenebeck
2006-04-07 20:16 ` Greg Buchholz
2006-04-15  0:58   ` Christian Schoenebeck
2006-04-18 10:04     ` Andrew Haley
2006-04-18 23:38       ` Christian Schoenebeck
2006-04-19  8:30         ` Andrew Haley
2006-04-19 12:19           ` Christian Schoenebeck
2006-04-19 13:13             ` John Love-Jensen
2006-04-19 14:03             ` Andrew Haley [this message]
2006-04-19 15:20               ` Andrew Haley
2006-04-19 20:05                 ` Christian Schoenebeck
2006-04-19 20:25                   ` Andrew Haley
2006-04-19 14:58             ` [Linuxsampler-devel] " Harri Järvi
2006-04-19 15:14               ` Brian Budge
2010-11-04 16:14 GCC vector extensions Hariharan Sandanagobalane
2010-11-04 18:59 ` Ian Lance Taylor
2011-02-28 23:37 Gcc " Hari Sandanagobalane
2011-02-28 23:55 ` Ian Lance Taylor

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=17478.17160.976293.718811@zapata.pink \
    --to=aph@gcc.gnu.org \
    --cc=cuse@users.sourceforge.net \
    --cc=gcc-help@gcc.gnu.org \
    --cc=linuxsampler-devel@lists.sourceforge.net \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).