public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h
@ 2004-07-15 17:18 tfautre at pandora dot be
  2004-07-15 17:21 ` [Bug c/16570] " tfautre at pandora dot be
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: tfautre at pandora dot be @ 2004-07-15 17:18 UTC (permalink / raw)
  To: gcc-bugs

To be 100% compatible with Intel C++ Compiler and MS VC++, there should be the
functions void * _mm_malloc(size_t size, size_t alignment) and void
_mm_free(void * ptr) in xmmintrin.h.
However these are missing.

Suggestion: add the following piece of code to xmmintrin.h (see further attachment).

-- 
           Summary: missing _mm_malloc and _mm_free functions in xmmintrin.h
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tfautre at pandora dot be
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
@ 2004-07-15 17:21 ` tfautre at pandora dot be
  2004-07-15 17:22 ` [Bug target/16570] " bangerth at dealii dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: tfautre at pandora dot be @ 2004-07-15 17:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tfautre at pandora dot be  2004-07-15 17:21 -------
Created an attachment (id=6754)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6754&action=view)
Contains the code that should be added to xmmintrin.h


-- 


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
  2004-07-15 17:21 ` [Bug c/16570] " tfautre at pandora dot be
@ 2004-07-15 17:22 ` bangerth at dealii dot org
  2004-07-15 19:12 ` hjl at lucon dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: bangerth at dealii dot org @ 2004-07-15 17:22 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl at gnu dot org
          Component|c                           |target


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
  2004-07-15 17:21 ` [Bug c/16570] " tfautre at pandora dot be
  2004-07-15 17:22 ` [Bug target/16570] " bangerth at dealii dot org
@ 2004-07-15 19:12 ` hjl at lucon dot org
  2004-07-15 19:13 ` hjl at lucon dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl at lucon dot org @ 2004-07-15 19:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hjl at lucon dot org  2004-07-15 19:12 -------
Is there a portable way to implement _mm_malloc?

-- 


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
                   ` (2 preceding siblings ...)
  2004-07-15 19:12 ` hjl at lucon dot org
@ 2004-07-15 19:13 ` hjl at lucon dot org
  2004-07-15 19:30 ` falk at debian dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl at lucon dot org @ 2004-07-15 19:13 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|hjl at gnu dot org          |hjl at lucon dot org


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
                   ` (3 preceding siblings ...)
  2004-07-15 19:13 ` hjl at lucon dot org
@ 2004-07-15 19:30 ` falk at debian dot org
  2004-07-15 19:47 ` tfautre at pandora dot be
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: falk at debian dot org @ 2004-07-15 19:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From falk at debian dot org  2004-07-15 19:30 -------
Sure. Allocate ALIGN bytes more than needed, clear the first ALIGN bytes, mark
the first byte with 1, and round up to proper alignment. On freeing you can then
scan back to the mark byte.


-- 


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
                   ` (4 preceding siblings ...)
  2004-07-15 19:30 ` falk at debian dot org
@ 2004-07-15 19:47 ` tfautre at pandora dot be
  2004-07-15 20:08 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: tfautre at pandora dot be @ 2004-07-15 19:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tfautre at pandora dot be  2004-07-15 19:47 -------
Isn't posix_memalign() portable enough ?



-- 


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
                   ` (5 preceding siblings ...)
  2004-07-15 19:47 ` tfautre at pandora dot be
@ 2004-07-15 20:08 ` pinskia at gcc dot gnu dot org
  2004-07-16 11:25 ` dannysmith at users dot sourceforge dot net
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-15 20:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-15 20:08 -------
No posix_memalign is not potable enough as Windows does not provide it.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-07-15 20:08:36
               date|                            |


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
                   ` (6 preceding siblings ...)
  2004-07-15 20:08 ` pinskia at gcc dot gnu dot org
@ 2004-07-16 11:25 ` dannysmith at users dot sourceforge dot net
  2004-07-16 18:38 ` hjl at lucon dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dannysmith at users dot sourceforge dot net @ 2004-07-16 11:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dannysmith at users dot sourceforge dot net  2004-07-16 11:25 -------
Hi, 
A version of _aligned_malloc and friends was submitted to mingw project and
declared as public domain.  I have been using it for some time with no problem. 
It works on i686 linux and mingw. You may want to look at it for a portable 
implemtation that could be used as mm_malloc.  It would also be useful for an 
overloaded (aligned) new/delete implementation


See the latest file attachments at this link:
https://sourceforge.net/tracker/index.php?
func=detail&aid=668224&group_id=2435&atid=102435

Danny

-- 


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
                   ` (7 preceding siblings ...)
  2004-07-16 11:25 ` dannysmith at users dot sourceforge dot net
@ 2004-07-16 18:38 ` hjl at lucon dot org
  2004-07-20 15:19 ` tfautre at pandora dot be
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl at lucon dot org @ 2004-07-16 18:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hjl at lucon dot org  2004-07-16 18:38 -------
I think we should have 2 versions. One uses posix_memalign and the other one
doesn't. A target can pick the best one.

-- 


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
                   ` (8 preceding siblings ...)
  2004-07-16 18:38 ` hjl at lucon dot org
@ 2004-07-20 15:19 ` tfautre at pandora dot be
  2004-08-02 16:56 ` hjl at lucon dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: tfautre at pandora dot be @ 2004-07-20 15:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tfautre at pandora dot be  2004-07-20 15:19 -------
> I think we should have 2 versions. One uses posix_memalign and the other one
> doesn't. A target can pick the best one.

Agreed.
As for the "other one", I like the _aligned_malloc implementation posted by
Danny, even though it's using more memory (from 32 to 64 bits) than the marker idea.



-- 


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
                   ` (9 preceding siblings ...)
  2004-07-20 15:19 ` tfautre at pandora dot be
@ 2004-08-02 16:56 ` hjl at lucon dot org
  2004-08-03 19:52 ` cvs-commit at gcc dot gnu dot org
  2004-08-03 20:33 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: hjl at lucon dot org @ 2004-08-02 16:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hjl at lucon dot org  2004-08-02 16:56 -------
An updated patch with testcase is posted at

http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00053.html

-- 


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
                   ` (10 preceding siblings ...)
  2004-08-02 16:56 ` hjl at lucon dot org
@ 2004-08-03 19:52 ` cvs-commit at gcc dot gnu dot org
  2004-08-03 20:33 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-03 19:52 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2231 bytes --]


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-03 19:52 -------
Subject: Bug 16570

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	hjl@gcc.gnu.org	2004-08-03 19:52:52

Modified files:
	gcc            : ChangeLog config.gcc 
	gcc/config/i386: xmmintrin.h 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/config/i386: gmm_malloc.h pmm_malloc.h t-gmm_malloc 
	                 t-pmm_malloc 
	gcc/testsuite/gcc.dg: i386-sse-9.c 

Log message:
	gcc/
	
	2004-08-03  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR target/16570
	* config.gcc (i[34567]86-*-* | x86_64-*-*): Add i386/t-gmm_malloc
	to tmake_file.
	(i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1): Likewise.
	(i[34567]86-*-linux* | x86_64-*-linux*): Add i386/t-pmm_malloc
	to tmake_file.
	
	* config/i386/t-gmm_malloc: New file.
	* config/i386/t-pmm_malloc: Likewise.
	
	* config/i386/xmmintrin.h: Include <mm_malloc.h>.
	
	2004-08-03  H.J. Lu  <hongjiu.lu@intel.com>
	Tanguy Fautrà <tfautre@pandora.be>
	
	* config/i386/pmm_malloc.h: New file.
	
	2004-08-03  Danny Smith  <dannysmith@users.sourceforge.net>
	
	* config/i386/gmm_malloc.h: New file.
	
	gcc/testsuite/
	
	2004-08-03  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR target/16570
	* gcc.dg/i386-sse-9.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4780&r2=2.4781
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config.gcc.diff?cvsroot=gcc&r1=1.475&r2=1.476
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/gmm_malloc.h.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/pmm_malloc.h.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/t-gmm_malloc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/t-pmm_malloc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/xmmintrin.h.diff?cvsroot=gcc&r1=1.29&r2=1.30
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4088&r2=1.4089
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/i386-sse-9.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug target/16570] missing _mm_malloc and _mm_free functions in xmmintrin.h
  2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
                   ` (11 preceding siblings ...)
  2004-08-03 19:52 ` cvs-commit at gcc dot gnu dot org
@ 2004-08-03 20:33 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-03 20:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-03 20:33 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


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


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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-15 17:18 [Bug c/16570] New: missing _mm_malloc and _mm_free functions in xmmintrin.h tfautre at pandora dot be
2004-07-15 17:21 ` [Bug c/16570] " tfautre at pandora dot be
2004-07-15 17:22 ` [Bug target/16570] " bangerth at dealii dot org
2004-07-15 19:12 ` hjl at lucon dot org
2004-07-15 19:13 ` hjl at lucon dot org
2004-07-15 19:30 ` falk at debian dot org
2004-07-15 19:47 ` tfautre at pandora dot be
2004-07-15 20:08 ` pinskia at gcc dot gnu dot org
2004-07-16 11:25 ` dannysmith at users dot sourceforge dot net
2004-07-16 18:38 ` hjl at lucon dot org
2004-07-20 15:19 ` tfautre at pandora dot be
2004-08-02 16:56 ` hjl at lucon dot org
2004-08-03 19:52 ` cvs-commit at gcc dot gnu dot org
2004-08-03 20:33 ` pinskia 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).