10 messages in net.java.dev.jna.users[jna-users] setting structure alignment
FromSent OnAttachments
Rui CaridadeDec 8, 2008 6:07 pm 
Timothy WallDec 8, 2008 7:18 pm 
Rui CaridadeDec 8, 2008 8:26 pm 
Timothy WallDec 8, 2008 8:54 pm 
Rui CaridadeDec 8, 2008 9:05 pm 
Rui CaridadeDec 10, 2008 5:11 pm.log
Timothy WallDec 10, 2008 6:05 pm 
Rui CaridadeDec 10, 2008 6:13 pm 
Rui CaridadeDec 11, 2008 2:50 am 
Timothy WallDec 11, 2008 5:24 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[jna-users] setting structure alignmentActions...
From:Rui Caridade (waih@yahoo.com)
Date:Dec 8, 2008 6:07:54 pm
List:net.java.dev.jna.users

Hello. I'm currently working on creating bindings for libSIMDx86
(http://simdx86.sourceforge.net/). Some structures are aligned to the 16th byte for instance

typedef struct SIMDx86Vector { float x, y, z; float __SIMD_pad__; /* Padding to 16th byte for SIMD operations (3DNow!/SSE)
*/ } SIMDx86Vector ALIGNED;

Where aligned is

#if defined(__GNUC__) #define ALIGNED __attribute__(( aligned(16) )) #elif defined(_MSC_VER) #define ALIGNED __declspec(align(16)) #endif

My implementation is as follows

public class SIMDx86Vector extends Structure {

float x, y, z; float __SIMD_pad__; /* Padding to 16th byte for SIMD operations (3DNow!/SSE)
*/

public SIMDx86Vector allocate(){ return (SIMDx86Vector) Structure.newInstance(this.getClass()); } }

My question is do i need to do anything more on the Java side? All the best and thanks in advance