public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <bug-20020-9975@http.gcc.gnu.org/bugzilla/>]
* [Bug target/20020] New: x86_64 - 128 bit structs not targeted to TImode
@ 2005-02-17 13:46 gary at intrepid dot com
  2005-02-17 14:04 ` [Bug target/20020] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 53+ messages in thread
From: gary at intrepid dot com @ 2005-02-17 13:46 UTC (permalink / raw)
  To: gcc-bugs

[Also posted to the GCC mailing list, http://gcc.gnu.org/ml/gcc/2005-
02/msg00692.html]


Given,

struct shared_ptr_struct
  {
    unsigned int phase  : 24;
    unsigned short thread : 16;
    void *addr;
  };

On the x86_64 (ie, Opteron[tm]) platform, GCC appears to designate the
underlying mode of this type as a BLKmode, instead of a TImode.  This
has implications in terms of the quality of the code that is generated
to copy and manipulate 128 bit structures (as defined in the example
above).

The decision to commit this type to a BLKmode value, originates
in this logic in mode_for_size():

      if (limit && size > MAX_FIXED_MODE_SIZE)
         return BLKmode;

On the x86 platform, there appears to be no target definition for
MAX_FIELD_SIZE. Thus, the default in stor-layout.c applies:

#ifndef MAX_FIXED_MODE_SIZE
#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
#endif

Other 64 bit targets define MAX_FIXED_MODE_SIZE along these lines
(some line wrapping may occur below):

config/i960/i960.h:#define    MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE
(TImode)
config/ia64/ia64.h:#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TImode)
config/mips/mips.h:#define MAX_FIXED_MODE_SIZE LONG_DOUBLE_TYPE_SIZE
config/sh/sh.h:#define MAX_FIXED_MODE_SIZE (TARGET_SH5 ? 128 : 64)

on MIPS, LONG_DOUBLE_TYPE_SIZE is defined as follows:

/* A C expression for the size in bits of the type `long double' on
   the target machine.  If you don't define this, the default is two
   words.  */
#define LONG_DOUBLE_TYPE_SIZE \
  (mips_abi == ABI_N32 || mips_abi == ABI_64 ? 128 : 64)

In the 'dev' tree, the s390 defines MAX_FIXED_MODE_SIZE as follows:

config/s390/s390.h:#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE
(TARGET_64BIT ? TImode : DImode)

(Arguably, the s390 variant might be a better default value to be defined
in stor-layout.c)

-- 
           Summary: x86_64 - 128 bit structs not targeted to TImode
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gary at intrepid dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20020


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

end of thread, other threads:[~2012-08-17 20:03 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-20020-4@http.gcc.gnu.org/bugzilla/>
2011-07-08 16:22 ` [Bug target/20020] x86_64 - 128 bit structs not targeted to TImode gary at intrepid dot com
2011-07-08 17:00 ` gary at intrepid dot com
2011-07-08 17:21 ` gary at intrepid dot com
2011-07-09 10:28 ` ebotcazou at gcc dot gnu.org
2012-08-06 22:54 ` chip at pobox dot com
2012-08-11  3:23 ` gary at intrepid dot com
2012-08-11 14:38 ` hjl.tools at gmail dot com
2012-08-12 18:09 ` gary at intrepid dot com
2012-08-12 18:12 ` gary at intrepid dot com
2012-08-12 18:18 ` gary at intrepid dot com
2012-08-12 18:31 ` gary at intrepid dot com
2012-08-12 19:51 ` hjl.tools at gmail dot com
2012-08-12 21:25 ` gary at intrepid dot com
2012-08-12 21:46 ` gary at intrepid dot com
2012-08-12 21:48 ` gary at intrepid dot com
2012-08-12 21:51 ` gary at intrepid dot com
2012-08-12 22:09 ` gary at intrepid dot com
2012-08-12 22:15 ` gary at intrepid dot com
2012-08-12 22:31 ` hjl.tools at gmail dot com
2012-08-12 22:44 ` gary at intrepid dot com
2012-08-13  2:18 ` hjl.tools at gmail dot com
2012-08-14  4:26 ` gary at intrepid dot com
2012-08-14 22:47 ` chip at pobox dot com
2012-08-14 23:10 ` chip at pobox dot com
2012-08-14 23:44 ` hjl.tools at gmail dot com
2012-08-14 23:56 ` gary at intrepid dot com
2012-08-15  0:01 ` gary at intrepid dot com
2012-08-15  1:24 ` hjl.tools at gmail dot com
2012-08-15  3:35 ` gary at intrepid dot com
2012-08-15  8:58 ` rguenth at gcc dot gnu.org
2012-08-15  9:15 ` chip at pobox dot com
2012-08-15  9:30 ` rguenther at suse dot de
2012-08-15 13:48 ` gary at intrepid dot com
2012-08-15 13:59 ` hjl.tools at gmail dot com
2012-08-15 14:22 ` hjl.tools at gmail dot com
2012-08-15 14:46 ` gary at intrepid dot com
2012-08-15 14:56 ` jakub at gcc dot gnu.org
2012-08-15 16:02 ` hjl.tools at gmail dot com
2012-08-16  0:01 ` hjl.tools at gmail dot com
2012-08-17 20:01 ` hjl at gcc dot gnu.org
2012-08-17 20:01 ` hjl.tools at gmail dot com
2012-08-17 20:03 ` hjl at gcc dot gnu.org
     [not found] <bug-20020-9975@http.gcc.gnu.org/bugzilla/>
2008-08-03 17:45 ` ubizjak at gmail dot com
2005-02-17 13:46 [Bug target/20020] New: " gary at intrepid dot com
2005-02-17 14:04 ` [Bug target/20020] " pinskia at gcc dot gnu dot org
2005-02-17 16:44 ` matz at suse dot de
2005-02-17 23:25 ` gary at intrepid dot com
2005-02-17 23:51   ` Andrew Pinski
2005-02-17 23:52 ` pinskia at physics dot uc dot edu
2005-02-18  4:14 ` gary at intrepid dot com
2005-02-18  4:32 ` matz at suse dot de
2005-02-18  4:52 ` gary at intrepid dot com
2005-05-22 14:10 ` pinskia at gcc dot gnu dot org
2005-06-25 11:56 ` steven at gcc dot gnu dot org

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).