mips: Tweak location of ';' in macros

It is more typical to provide the ';' by the caller of a macro
than to embed it in the macro itself; this is because syntax
highlight engines can get confused if a macro is called without
a semicolon before the closing '}'.

Backports commit 94f5c480e9b5ce95394026b3f025816470e23eaf from qemu
This commit is contained in:
Eric Blake 2018-03-06 09:03:51 -05:00 committed by Lioncash
parent cf80a410a9
commit 20da22732f
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -682,13 +682,13 @@ static inline int64_t msa_mod_u_df(uint32_t df, int64_t arg1, int64_t arg2)
do { \ do { \
e = SIGNED_EVEN(a, df); \ e = SIGNED_EVEN(a, df); \
o = SIGNED_ODD(a, df); \ o = SIGNED_ODD(a, df); \
} while (0); } while (0)
#define UNSIGNED_EXTRACT(e, o, a, df) \ #define UNSIGNED_EXTRACT(e, o, a, df) \
do { \ do { \
e = UNSIGNED_EVEN(a, df); \ e = UNSIGNED_EVEN(a, df); \
o = UNSIGNED_ODD(a, df); \ o = UNSIGNED_ODD(a, df); \
} while (0); } while (0)
static inline int64_t msa_dotp_s_df(uint32_t df, int64_t arg1, int64_t arg2) static inline int64_t msa_dotp_s_df(uint32_t df, int64_t arg1, int64_t arg2)
{ {
@ -1120,9 +1120,11 @@ void helper_msa_splat_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
#define MSA_LOOP_COND_D MSA_LOOP_COND(DF_DOUBLE) #define MSA_LOOP_COND_D MSA_LOOP_COND(DF_DOUBLE)
#define MSA_LOOP(DF) \ #define MSA_LOOP(DF) \
do { \
for (i = 0; i < (MSA_LOOP_COND_ ## DF) ; i++) { \ for (i = 0; i < (MSA_LOOP_COND_ ## DF) ; i++) { \
MSA_DO_ ## DF \ MSA_DO_ ## DF; \
} } \
} while (0)
#define MSA_FN_DF(FUNC) \ #define MSA_FN_DF(FUNC) \
void helper_msa_##FUNC(CPUMIPSState *env, uint32_t df, uint32_t wd, \ void helper_msa_##FUNC(CPUMIPSState *env, uint32_t df, uint32_t wd, \
@ -1135,17 +1137,17 @@ void helper_msa_##FUNC(CPUMIPSState *env, uint32_t df, uint32_t wd, \
uint32_t i; \ uint32_t i; \
switch (df) { \ switch (df) { \
case DF_BYTE: \ case DF_BYTE: \
MSA_LOOP_B \ MSA_LOOP_B; \
break; \ break; \
case DF_HALF: \ case DF_HALF: \
MSA_LOOP_H \ MSA_LOOP_H; \
break; \ break; \
case DF_WORD: \ case DF_WORD: \
MSA_LOOP_W \ MSA_LOOP_W; \
break; \ break; \
case DF_DOUBLE: \ case DF_DOUBLE: \
MSA_LOOP_D \ MSA_LOOP_D; \
break; \ break; \
default: \ default: \
assert(0); \ assert(0); \
} \ } \
@ -1168,7 +1170,7 @@ void helper_msa_##FUNC(CPUMIPSState *env, uint32_t df, uint32_t wd, \
do { \ do { \
R##DF(pwx, i) = pwt->DF[2*i]; \ R##DF(pwx, i) = pwt->DF[2*i]; \
L##DF(pwx, i) = pws->DF[2*i]; \ L##DF(pwx, i) = pws->DF[2*i]; \
} while (0); } while (0)
MSA_FN_DF(pckev_df) MSA_FN_DF(pckev_df)
#undef MSA_DO #undef MSA_DO
@ -1176,7 +1178,7 @@ MSA_FN_DF(pckev_df)
do { \ do { \
R##DF(pwx, i) = pwt->DF[2*i+1]; \ R##DF(pwx, i) = pwt->DF[2*i+1]; \
L##DF(pwx, i) = pws->DF[2*i+1]; \ L##DF(pwx, i) = pws->DF[2*i+1]; \
} while (0); } while (0)
MSA_FN_DF(pckod_df) MSA_FN_DF(pckod_df)
#undef MSA_DO #undef MSA_DO
@ -1184,7 +1186,7 @@ MSA_FN_DF(pckod_df)
do { \ do { \
pwx->DF[2*i] = L##DF(pwt, i); \ pwx->DF[2*i] = L##DF(pwt, i); \
pwx->DF[2*i+1] = L##DF(pws, i); \ pwx->DF[2*i+1] = L##DF(pws, i); \
} while (0); } while (0)
MSA_FN_DF(ilvl_df) MSA_FN_DF(ilvl_df)
#undef MSA_DO #undef MSA_DO
@ -1192,7 +1194,7 @@ MSA_FN_DF(ilvl_df)
do { \ do { \
pwx->DF[2*i] = R##DF(pwt, i); \ pwx->DF[2*i] = R##DF(pwt, i); \
pwx->DF[2*i+1] = R##DF(pws, i); \ pwx->DF[2*i+1] = R##DF(pws, i); \
} while (0); } while (0)
MSA_FN_DF(ilvr_df) MSA_FN_DF(ilvr_df)
#undef MSA_DO #undef MSA_DO
@ -1200,7 +1202,7 @@ MSA_FN_DF(ilvr_df)
do { \ do { \
pwx->DF[2*i] = pwt->DF[2*i]; \ pwx->DF[2*i] = pwt->DF[2*i]; \
pwx->DF[2*i+1] = pws->DF[2*i]; \ pwx->DF[2*i+1] = pws->DF[2*i]; \
} while (0); } while (0)
MSA_FN_DF(ilvev_df) MSA_FN_DF(ilvev_df)
#undef MSA_DO #undef MSA_DO
@ -1208,7 +1210,7 @@ MSA_FN_DF(ilvev_df)
do { \ do { \
pwx->DF[2*i] = pwt->DF[2*i+1]; \ pwx->DF[2*i] = pwt->DF[2*i+1]; \
pwx->DF[2*i+1] = pws->DF[2*i+1]; \ pwx->DF[2*i+1] = pws->DF[2*i+1]; \
} while (0); } while (0)
MSA_FN_DF(ilvod_df) MSA_FN_DF(ilvod_df)
#undef MSA_DO #undef MSA_DO
#undef MSA_LOOP_COND #undef MSA_LOOP_COND
@ -1222,7 +1224,7 @@ MSA_FN_DF(ilvod_df)
uint32_t k = (pwd->DF[i] & 0x3f) % (2 * n); \ uint32_t k = (pwd->DF[i] & 0x3f) % (2 * n); \
pwx->DF[i] = \ pwx->DF[i] = \
(pwd->DF[i] & 0xc0) ? 0 : k < n ? pwt->DF[k] : pws->DF[k - n]; \ (pwd->DF[i] & 0xc0) ? 0 : k < n ? pwt->DF[k] : pws->DF[k - n]; \
} while (0); } while (0)
MSA_FN_DF(vshf_df) MSA_FN_DF(vshf_df)
#undef MSA_DO #undef MSA_DO
#undef MSA_LOOP_COND #undef MSA_LOOP_COND