1 #ifndef HARDWARE_VECTOR_H 2 #define HARDWARE_VECTOR_H 3 4 /* 5 useful macros for AltiVec(tm) programming 6 7 Copyright © 2004 The MorphOS Development Team, All Rights Reserved. 8 */ 9 10 11 /* 12 * Macro for creating a vector value assignment (for compiler abstraction). 13 * 14 * vector float foo = (vector float)VEC_VALUE(1.0, 2.0, 3.0, 4.0); 15 * 16 */ 17 18 #if (__GNUC__ == 2) 19 # define VEC_VALUE(...) (__VA_ARGS__) 20 #else 21 # define VEC_VALUE(...) {__VA_ARGS__} 22 #endif 23 24 25 /* 26 * Macro for creating magic value to describe datastreaming blocks. 27 * 28 * vec_dst[st][t](<addr>, VEC_DST_BLOCKS(<size>, <num>, <stride>), <streamid>); 29 * 30 * <size> - Size of blocks to stream, will be rounded to multiple of 16 and cropped at 512 (496 (0 == 512)). 31 * <num> - Number of blocks to stream, will be cropped at 256 (255 (0 == 256)). 32 * <stride> - Blockstride, should be >= blocksize (can be negative for reverse stride), *you* must crop at (-)32768 (+32767 (0 == +32768)). 33 * 34 */ 35 36 #define VEC_DST_BLOCKS(size,num,stride) (((((size) + 15) & 0x1F0) << 20) | (((num) & 0xFF) << 16) | (unsigned short)((signed short)(stride))) 37 38 39 #endif /* HARDWARE_VECTOR_H */