Re Re "vector" Framework
Re Re "vector" Framework
- Subject: Re Re "vector" Framework
- From: Lionel Lacassagne <email@hidden>
- Date: Thu, 09 Feb 2006 13:21:33 +0100
- Organization: IEF
Eric Albert wrote:
On Feb 7, 2006, at 4:03 AM, Lionel Lacassagne wrote:
Thanks for the previous answers which help me to switch from XCode
1.5 to 2.2
I've succeeded in rebuilding my scalar Frameworks, by recreating them
from scratch.
In my current SIMD Framework, I have a set a definition like
typedef vector float vfloat;
typedef vector char vchar;
typedef vector signed int vsint8;
...
my definitions are - of course - very similar to the definitions in
vecLibTypes.h (the only diff is the use of UpperCase for Accelerate
Framework)
vUint8, vSInt8, ...
My problem is (not to swap from my previous definition with lowercase
to UpperCase) that the keyword "vector" seems to be no more
recognized...
In a stand alone project (with only Carbon.framework) I can use
redefinition like mine (typedef vector float vfloat;) the word
"vector" is accepted
But in a framework "vector" is not accepted (not in Release, not in
Debug)
Sounds like AltiVec isn't enabled for your target or project. Check
your settings to make sure the "Enable AltiVec Extensions" check box
is turned on.
That is what I'd wished, but definitively not.
As you can see below in a dummy Framework, I included
Accelerate.framework twice (to be sure that the typedef will be handled
properly)
The Framework has been created from srcratch (to prevent bug from XCode
1.5) - thanks to previous mail -
The build is correct in debug, but not in Release
errors are:
"systax error before "float"" in the header (line with typedef)
"incompatible type inassignment" for vec_ld, vec_add, ...
I can join a dummy Framework in attachment
Maybe / certainly I've missed to check a box somewhere, but I don't know
where :-(
Thanks for our help
Lionel
#include <Accelerate/Accelerate.h>
typedef vector float vfloat;
int myF(int x);
void appleFloat(vFloat *X, vFloat *Y, vFloat *Z);
void myVFloat(vfloat *X, vfloat *Y, vfloat *Z);
void altivecFloat(vector float *X, vector float *Y, vector float *Z);
and body
#include <stdio.h>
#include <stdlib.h>
#include <Accelerate/Accelerate.h>
#include "F.h"
int myF(int x)
{
return x*x;
}
void appleFloat(vFloat *X, vFloat *Y, vFloat *Z)
{
vFloat x, y, z;
x = vec_ld(0, &X[0]);
y = vec_ld(0, Y);
z = vec_add(x,y);
vec_st(z, 0, Z);
}
void myVFloat(vfloat *X, vfloat *Y, vfloat *Z)
{
vfloat x, y, z;
x = vec_ld(0, &X[0]);
y = vec_ld(0, Y);
z = vec_add(x,y);
vec_st(z, 0, Z);
}
void altivecFloat(vector float *X, vector float *Y, vector float *Z)
{
vector float x, y, z;
x = vec_ld(0, &X[0]);
y = vec_ld(0, Y);
z = vec_add(x,y);
vec_st(z, 0, Z);
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden