Revision c3e10c7b target-ppc/op.c
b/target-ppc/op.c | ||
---|---|---|
191 | 191 |
RETURN(); |
192 | 192 |
} |
193 | 193 |
|
194 |
void OPPROTO op_moven_T2_T0 (void) |
|
195 |
{ |
|
196 |
T2 = ~T0; |
|
197 |
RETURN(); |
|
198 |
} |
|
199 |
|
|
194 | 200 |
/* Generate exceptions */ |
195 | 201 |
void OPPROTO op_raise_exception_err (void) |
196 | 202 |
{ |
... | ... | |
847 | 853 |
|
848 | 854 |
void OPPROTO op_check_addo (void) |
849 | 855 |
{ |
850 |
if (likely(!(((uint32_t)T2 ^ (uint32_t)T1 ^ UINT32_MAX) & |
|
851 |
((uint32_t)T2 ^ (uint32_t)T0) & (1UL << 31)))) { |
|
852 |
xer_ov = 0; |
|
853 |
} else { |
|
854 |
xer_ov = 1; |
|
855 |
xer_so = 1; |
|
856 |
} |
|
856 |
xer_ov = (((uint32_t)T2 ^ (uint32_t)T1 ^ UINT32_MAX) & |
|
857 |
((uint32_t)T2 ^ (uint32_t)T0)) >> 31; |
|
858 |
xer_so |= xer_ov; |
|
857 | 859 |
RETURN(); |
858 | 860 |
} |
859 | 861 |
|
860 | 862 |
#if defined(TARGET_PPC64) |
861 | 863 |
void OPPROTO op_check_addo_64 (void) |
862 | 864 |
{ |
863 |
if (likely(!(((uint64_t)T2 ^ (uint64_t)T1 ^ UINT64_MAX) & |
|
864 |
((uint64_t)T2 ^ (uint64_t)T0) & (1ULL << 63)))) { |
|
865 |
xer_ov = 0; |
|
866 |
} else { |
|
867 |
xer_ov = 1; |
|
868 |
xer_so = 1; |
|
869 |
} |
|
865 |
xer_ov = (((uint64_t)T2 ^ (uint64_t)T1 ^ UINT64_MAX) & |
|
866 |
((uint64_t)T2 ^ (uint64_t)T0)) >> 63; |
|
867 |
xer_so |= xer_ov; |
|
870 | 868 |
RETURN(); |
871 | 869 |
} |
872 | 870 |
#endif |
... | ... | |
922 | 920 |
T0 += xer_ca + (-1); |
923 | 921 |
if (likely((uint32_t)T1 != 0)) |
924 | 922 |
xer_ca = 1; |
923 |
else |
|
924 |
xer_ca = 0; |
|
925 | 925 |
RETURN(); |
926 | 926 |
} |
927 | 927 |
|
... | ... | |
931 | 931 |
T0 += xer_ca + (-1); |
932 | 932 |
if (likely((uint64_t)T1 != 0)) |
933 | 933 |
xer_ca = 1; |
934 |
else |
|
935 |
xer_ca = 0; |
|
934 | 936 |
RETURN(); |
935 | 937 |
} |
936 | 938 |
#endif |
... | ... | |
1142 | 1144 |
RETURN(); |
1143 | 1145 |
} |
1144 | 1146 |
|
1145 |
void OPPROTO op_check_subfo (void) |
|
1146 |
{ |
|
1147 |
if (likely(!(((uint32_t)(~T2) ^ (uint32_t)T1 ^ UINT32_MAX) & |
|
1148 |
((uint32_t)(~T2) ^ (uint32_t)T0) & (1UL << 31)))) { |
|
1149 |
xer_ov = 0; |
|
1150 |
} else { |
|
1151 |
xer_ov = 1; |
|
1152 |
xer_so = 1; |
|
1153 |
} |
|
1154 |
RETURN(); |
|
1155 |
} |
|
1156 |
|
|
1157 |
#if defined(TARGET_PPC64) |
|
1158 |
void OPPROTO op_check_subfo_64 (void) |
|
1159 |
{ |
|
1160 |
if (likely(!(((uint64_t)(~T2) ^ (uint64_t)T1 ^ UINT64_MAX) & |
|
1161 |
((uint64_t)(~T2) ^ (uint64_t)T0) & (1ULL << 63)))) { |
|
1162 |
xer_ov = 0; |
|
1163 |
} else { |
|
1164 |
xer_ov = 1; |
|
1165 |
xer_so = 1; |
|
1166 |
} |
|
1167 |
RETURN(); |
|
1168 |
} |
|
1169 |
#endif |
|
1170 |
|
|
1171 | 1147 |
/* subtract from carrying */ |
1172 | 1148 |
void OPPROTO op_check_subfc (void) |
1173 | 1149 |
{ |
... | ... | |
1235 | 1211 |
void OPPROTO op_subfme (void) |
1236 | 1212 |
{ |
1237 | 1213 |
T0 = ~T0 + xer_ca - 1; |
1238 |
if (likely((uint32_t)T0 != (uint32_t)-1))
|
|
1214 |
if (likely((uint32_t)T0 != UINT32_MAX))
|
|
1239 | 1215 |
xer_ca = 1; |
1216 |
else |
|
1217 |
xer_ca = 0; |
|
1240 | 1218 |
RETURN(); |
1241 | 1219 |
} |
1242 | 1220 |
|
... | ... | |
1244 | 1222 |
void OPPROTO op_subfme_64 (void) |
1245 | 1223 |
{ |
1246 | 1224 |
T0 = ~T0 + xer_ca - 1; |
1247 |
if (likely((uint64_t)T0 != (uint64_t)-1))
|
|
1225 |
if (likely((uint64_t)T0 != UINT64_MAX))
|
|
1248 | 1226 |
xer_ca = 1; |
1227 |
else |
|
1228 |
xer_ca = 0; |
|
1249 | 1229 |
RETURN(); |
1250 | 1230 |
} |
1251 | 1231 |
#endif |
... | ... | |
2528 | 2508 |
RETURN(); |
2529 | 2509 |
} |
2530 | 2510 |
|
2531 |
void OPPROTO op_405_check_ov (void) |
|
2532 |
{ |
|
2533 |
do_405_check_ov(); |
|
2534 |
RETURN(); |
|
2535 |
} |
|
2536 |
|
|
2537 | 2511 |
void OPPROTO op_405_check_sat (void) |
2538 | 2512 |
{ |
2539 | 2513 |
do_405_check_sat(); |
Also available in: Unified diff