Commit d6a46fe8c264b5853ccf8f966f7bd00c1c32c877
1 parent
e4704b3b
Add helper macros for later patches.
Remove N_ELEMS, VECTOR_FOR, and VECTOR_FOR_I macros. Retain the VECTOR_FOR_INORDER_I macros as the clearest way of expressing the intent of iterating over elements in their stored target-endian order. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6153 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
22 additions
and
0 deletions
target-ppc/op_helper.c
... | ... | @@ -1954,6 +1954,28 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_ |
1954 | 1954 | } |
1955 | 1955 | |
1956 | 1956 | /*****************************************************************************/ |
1957 | +/* Altivec extension helpers */ | |
1958 | +#if defined(WORDS_BIGENDIAN) | |
1959 | +#define HI_IDX 0 | |
1960 | +#define LO_IDX 1 | |
1961 | +#else | |
1962 | +#define HI_IDX 1 | |
1963 | +#define LO_IDX 0 | |
1964 | +#endif | |
1965 | + | |
1966 | +#if defined(WORDS_BIGENDIAN) | |
1967 | +#define VECTOR_FOR_INORDER_I(index, element) \ | |
1968 | + for (index = 0; index < ARRAY_SIZE(r->element); index++) | |
1969 | +#else | |
1970 | +#define VECTOR_FOR_INORDER_I(index, element) \ | |
1971 | + for (index = ARRAY_SIZE(r->element)-1; index >= 0; index--) | |
1972 | +#endif | |
1973 | + | |
1974 | +#undef VECTOR_FOR_INORDER_I | |
1975 | +#undef HI_IDX | |
1976 | +#undef LO_IDX | |
1977 | + | |
1978 | +/*****************************************************************************/ | |
1957 | 1979 | /* SPE extension helpers */ |
1958 | 1980 | /* Use a table to make this quicker */ |
1959 | 1981 | static uint8_t hbrev[16] = { | ... | ... |