17 |
17 |
* License along with this library; if not, write to the Free Software
|
18 |
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
|
19 |
19 |
*/
|
|
20 |
#include <string.h>
|
20 |
21 |
#include "exec.h"
|
21 |
22 |
#include "host-utils.h"
|
22 |
23 |
#include "helper.h"
|
... | ... | |
2103 |
2104 |
VSL(w, u32)
|
2104 |
2105 |
#undef VSL
|
2105 |
2106 |
|
|
2107 |
void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
|
|
2108 |
{
|
|
2109 |
int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf;
|
|
2110 |
|
|
2111 |
#if defined (WORDS_BIGENDIAN)
|
|
2112 |
memmove (&r->u8[0], &a->u8[sh], 16-sh);
|
|
2113 |
memset (&r->u8[16-sh], 0, sh);
|
|
2114 |
#else
|
|
2115 |
memmove (&r->u8[sh], &a->u8[0], 16-sh);
|
|
2116 |
memset (&r->u8[0], 0, sh);
|
|
2117 |
#endif
|
|
2118 |
}
|
|
2119 |
|
2106 |
2120 |
#define VSR(suffix, element) \
|
2107 |
2121 |
void helper_vsr##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
|
2108 |
2122 |
{ \
|
... | ... | |
2121 |
2135 |
VSR(w, u32)
|
2122 |
2136 |
#undef VSR
|
2123 |
2137 |
|
|
2138 |
void helper_vsro (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
|
|
2139 |
{
|
|
2140 |
int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf;
|
|
2141 |
|
|
2142 |
#if defined (WORDS_BIGENDIAN)
|
|
2143 |
memmove (&r->u8[sh], &a->u8[0], 16-sh);
|
|
2144 |
memset (&r->u8[0], 0, sh);
|
|
2145 |
#else
|
|
2146 |
memmove (&r->u8[0], &a->u8[sh], 16-sh);
|
|
2147 |
memset (&r->u8[16-sh], 0, sh);
|
|
2148 |
#endif
|
|
2149 |
}
|
|
2150 |
|
2124 |
2151 |
#undef VECTOR_FOR_INORDER_I
|
2125 |
2152 |
#undef HI_IDX
|
2126 |
2153 |
#undef LO_IDX
|