Commit e343da72b6b99495174f1eeb4af74e70c3147a86

Authored by aurel32
1 parent 7b239bec

Add v{add,sub}cuw instructions.

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@6168 c046a42c-6fe2-441c-8c8c-71466251a162
target-ppc/helper.h
@@ -148,6 +148,8 @@ DEF_HELPER_3(vslh, void, avr, avr, avr) @@ -148,6 +148,8 @@ DEF_HELPER_3(vslh, void, avr, avr, avr)
148 DEF_HELPER_3(vslw, void, avr, avr, avr) 148 DEF_HELPER_3(vslw, void, avr, avr, avr)
149 DEF_HELPER_3(vslo, void, avr, avr, avr) 149 DEF_HELPER_3(vslo, void, avr, avr, avr)
150 DEF_HELPER_3(vsro, void, avr, avr, avr) 150 DEF_HELPER_3(vsro, void, avr, avr, avr)
  151 +DEF_HELPER_3(vaddcuw, void, avr, avr, avr)
  152 +DEF_HELPER_3(vsubcuw, void, avr, avr, avr)
151 153
152 DEF_HELPER_1(efscfsi, i32, i32) 154 DEF_HELPER_1(efscfsi, i32, i32)
153 DEF_HELPER_1(efscfui, i32, i32) 155 DEF_HELPER_1(efscfui, i32, i32)
target-ppc/op_helper.c
@@ -1972,6 +1972,14 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_ @@ -1972,6 +1972,14 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_
1972 for (index = ARRAY_SIZE(r->element)-1; index >= 0; index--) 1972 for (index = ARRAY_SIZE(r->element)-1; index >= 0; index--)
1973 #endif 1973 #endif
1974 1974
  1975 +void helper_vaddcuw (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
  1976 +{
  1977 + int i;
  1978 + for (i = 0; i < ARRAY_SIZE(r->u32); i++) {
  1979 + r->u32[i] = ~a->u32[i] < b->u32[i];
  1980 + }
  1981 +}
  1982 +
1975 #define VARITH_DO(name, op, element) \ 1983 #define VARITH_DO(name, op, element) \
1976 void helper_v##name (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ 1984 void helper_v##name (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
1977 { \ 1985 { \
@@ -2148,6 +2156,14 @@ void helper_vsro (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) @@ -2148,6 +2156,14 @@ void helper_vsro (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
2148 #endif 2156 #endif
2149 } 2157 }
2150 2158
  2159 +void helper_vsubcuw (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
  2160 +{
  2161 + int i;
  2162 + for (i = 0; i < ARRAY_SIZE(r->u32); i++) {
  2163 + r->u32[i] = a->u32[i] >= b->u32[i];
  2164 + }
  2165 +}
  2166 +
2151 #undef VECTOR_FOR_INORDER_I 2167 #undef VECTOR_FOR_INORDER_I
2152 #undef HI_IDX 2168 #undef HI_IDX
2153 #undef LO_IDX 2169 #undef LO_IDX
target-ppc/translate.c
@@ -6230,6 +6230,8 @@ GEN_VXFORM(vsrah, 2, 13); @@ -6230,6 +6230,8 @@ GEN_VXFORM(vsrah, 2, 13);
6230 GEN_VXFORM(vsraw, 2, 14); 6230 GEN_VXFORM(vsraw, 2, 14);
6231 GEN_VXFORM(vslo, 6, 16); 6231 GEN_VXFORM(vslo, 6, 16);
6232 GEN_VXFORM(vsro, 6, 17); 6232 GEN_VXFORM(vsro, 6, 17);
  6233 +GEN_VXFORM(vaddcuw, 0, 6);
  6234 +GEN_VXFORM(vsubcuw, 0, 22);
6233 6235
6234 /*** SPE extension ***/ 6236 /*** SPE extension ***/
6235 /* Register moves */ 6237 /* Register moves */