target/ppc: Style fixes for int_helper.c

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
David Gibson 2019-03-21 16:50:18 +11:00
parent c647e3fe3d
commit b6cb41b22c

View file

@ -137,7 +137,8 @@ uint64_t helper_divde(CPUPPCState *env, uint64_t rau, uint64_t rbu, uint32_t oe)
/* if x = 0xab, returns 0xababababababababa */ /* if x = 0xab, returns 0xababababababababa */
#define pattern(x) (((x) & 0xff) * (~(target_ulong)0 / 0xff)) #define pattern(x) (((x) & 0xff) * (~(target_ulong)0 / 0xff))
/* substract 1 from each byte, and with inverse, check if MSB is set at each /*
* subtract 1 from each byte, and with inverse, check if MSB is set at each
* byte. * byte.
* i.e. ((0x00 - 0x01) & ~(0x00)) & 0x80 * i.e. ((0x00 - 0x01) & ~(0x00)) & 0x80
* (0xFF & 0xFF) & 0x80 = 0x80 (zero found) * (0xFF & 0xFF) & 0x80 = 0x80 (zero found)
@ -156,7 +157,8 @@ uint32_t helper_cmpeqb(target_ulong ra, target_ulong rb)
#undef haszero #undef haszero
#undef hasvalue #undef hasvalue
/* Return invalid random number. /*
* Return invalid random number.
* *
* FIXME: Add rng backend or other mechanism to get cryptographically suitable * FIXME: Add rng backend or other mechanism to get cryptographically suitable
* random number * random number
@ -370,7 +372,8 @@ target_ulong helper_divso(CPUPPCState *env, target_ulong arg1,
/* 602 specific instructions */ /* 602 specific instructions */
/* mfrom is the most crazy instruction ever seen, imho ! */ /* mfrom is the most crazy instruction ever seen, imho ! */
/* Real implementation uses a ROM table. Do the same */ /* Real implementation uses a ROM table. Do the same */
/* Extremely decomposed: /*
* Extremely decomposed:
* -arg / 256 * -arg / 256
* return 256 * log10(10 + 1.0) + 0.5 * return 256 * log10(10 + 1.0) + 0.5
*/ */
@ -634,7 +637,8 @@ void helper_v##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
} \ } \
} }
/* VABSDU - Vector absolute difference unsigned /*
* VABSDU - Vector absolute difference unsigned
* name - instruction mnemonic suffix (b: byte, h: halfword, w: word) * name - instruction mnemonic suffix (b: byte, h: halfword, w: word)
* element - element type to access from vector * element - element type to access from vector
*/ */
@ -739,7 +743,8 @@ void helper_vcmpne##suffix(CPUPPCState *env, ppc_avr_t *r, \
} \ } \
} }
/* VCMPNEZ - Vector compare not equal to zero /*
* VCMPNEZ - Vector compare not equal to zero
* suffix - instruction mnemonic suffix (b: byte, h: halfword, w: word) * suffix - instruction mnemonic suffix (b: byte, h: halfword, w: word)
* element - element type to access from vector * element - element type to access from vector
*/ */
@ -1736,9 +1741,11 @@ VEXTU_X_DO(vextuhrx, 16, 0)
VEXTU_X_DO(vextuwrx, 32, 0) VEXTU_X_DO(vextuwrx, 32, 0)
#undef VEXTU_X_DO #undef VEXTU_X_DO
/* The specification says that the results are undefined if all of the /*
* shift counts are not identical. We check to make sure that they are * The specification says that the results are undefined if all of the
* to conform to what real hardware appears to do. */ * shift counts are not identical. We check to make sure that they
* are to conform to what real hardware appears to do.
*/
#define VSHIFT(suffix, leftp) \ #define VSHIFT(suffix, leftp) \
void helper_vs##suffix(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ void helper_vs##suffix(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
{ \ { \
@ -1805,9 +1812,10 @@ void helper_vsrv(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
int i; int i;
unsigned int shift, bytes; unsigned int shift, bytes;
/* Use reverse order, as destination and source register can be same. Its /*
* being modified in place saving temporary, reverse order will guarantee * Use reverse order, as destination and source register can be
* that computed result is not fed back. * same. Its being modified in place saving temporary, reverse
* order will guarantee that computed result is not fed back.
*/ */
for (i = ARRAY_SIZE(r->u8) - 1; i >= 0; i--) { for (i = ARRAY_SIZE(r->u8) - 1; i >= 0; i--) {
shift = b->u8[i] & 0x7; /* extract shift value */ shift = b->u8[i] & 0x7; /* extract shift value */