This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR target/16570: missing _mm_malloc and _mm_free functions in xmmintrin.h


On Tue, Aug 03, 2004 at 01:26:50PM +1200, Danny Smith wrote:
> 
> ----- Original Message -----
> From: "H. J. Lu"
> 
> | On Mon, Aug 02, 2004 at 02:33:47PM -0700, Richard Henderson wrote:
> | > On Mon, Aug 02, 2004 at 09:35:09AM -0700, H. J. Lu wrote:
> | > > +  /* Store the original pointer just before p.  */
> | > > +  * ((void **) ((size_t) aligned_ptr - 1)) = malloc_ptr;
> | >
> | > I suspect you havn't tested this.
> | >
> |
> | I was told that it worked.
> 
> 
> Argh,  In testing I failed to  actually write to the allocated memory,
> so I missed that.
> 
> The attached rervision replaces
>  * ((void **) ((size_t) aligned_ptr - 1)) = malloc_ptr;
> 
> with
>    *(((void **) ((size_t) aligned_ptr)) - 1) = malloc_ptr;
> 
> in both _mm_malloc and _mm_free.
> It works now with HJ's testcase.
> 
> Note in the testcase, the call to free needs to be replaced by  _mm_free
> 

Here is the updated patch.


H.J.

Attachment: gcc-3.4-mm_malloc-5.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]