[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 39/51] mips: Tweak location of ';' in macros
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 39/51] mips: Tweak location of ';' in macros |
Date: |
Tue, 16 Jan 2018 15:17:21 +0100 |
From: Eric Blake <address@hidden>
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 '}'.
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
target/mips/msa_helper.c | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/target/mips/msa_helper.c b/target/mips/msa_helper.c
index f167a42..8fb7a36 100644
--- a/target/mips/msa_helper.c
+++ b/target/mips/msa_helper.c
@@ -682,13 +682,13 @@ static inline int64_t msa_mod_u_df(uint32_t df, int64_t
arg1, int64_t arg2)
do { \
e = SIGNED_EVEN(a, df); \
o = SIGNED_ODD(a, df); \
- } while (0);
+ } while (0)
#define UNSIGNED_EXTRACT(e, o, a, df) \
do { \
e = UNSIGNED_EVEN(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)
{
@@ -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(DF) \
+ do { \
for (i = 0; i < (MSA_LOOP_COND_ ## DF) ; i++) { \
- MSA_DO_ ## DF \
- }
+ MSA_DO_ ## DF; \
+ } \
+ } while (0)
#define MSA_FN_DF(FUNC) \
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; \
switch (df) { \
case DF_BYTE: \
- MSA_LOOP_B \
+ MSA_LOOP_B; \
break; \
case DF_HALF: \
- MSA_LOOP_H \
+ MSA_LOOP_H; \
break; \
case DF_WORD: \
- MSA_LOOP_W \
+ MSA_LOOP_W; \
break; \
case DF_DOUBLE: \
- MSA_LOOP_D \
- break; \
+ MSA_LOOP_D; \
+ break; \
default: \
assert(0); \
} \
@@ -1168,7 +1170,7 @@ void helper_msa_##FUNC(CPUMIPSState *env, uint32_t df,
uint32_t wd, \
do { \
R##DF(pwx, i) = pwt->DF[2*i]; \
L##DF(pwx, i) = pws->DF[2*i]; \
- } while (0);
+ } while (0)
MSA_FN_DF(pckev_df)
#undef MSA_DO
@@ -1176,7 +1178,7 @@ MSA_FN_DF(pckev_df)
do { \
R##DF(pwx, i) = pwt->DF[2*i+1]; \
L##DF(pwx, i) = pws->DF[2*i+1]; \
- } while (0);
+ } while (0)
MSA_FN_DF(pckod_df)
#undef MSA_DO
@@ -1184,7 +1186,7 @@ MSA_FN_DF(pckod_df)
do { \
pwx->DF[2*i] = L##DF(pwt, i); \
pwx->DF[2*i+1] = L##DF(pws, i); \
- } while (0);
+ } while (0)
MSA_FN_DF(ilvl_df)
#undef MSA_DO
@@ -1192,7 +1194,7 @@ MSA_FN_DF(ilvl_df)
do { \
pwx->DF[2*i] = R##DF(pwt, i); \
pwx->DF[2*i+1] = R##DF(pws, i); \
- } while (0);
+ } while (0)
MSA_FN_DF(ilvr_df)
#undef MSA_DO
@@ -1200,7 +1202,7 @@ MSA_FN_DF(ilvr_df)
do { \
pwx->DF[2*i] = pwt->DF[2*i]; \
pwx->DF[2*i+1] = pws->DF[2*i]; \
- } while (0);
+ } while (0)
MSA_FN_DF(ilvev_df)
#undef MSA_DO
@@ -1208,7 +1210,7 @@ MSA_FN_DF(ilvev_df)
do { \
pwx->DF[2*i] = pwt->DF[2*i+1]; \
pwx->DF[2*i+1] = pws->DF[2*i+1]; \
- } while (0);
+ } while (0)
MSA_FN_DF(ilvod_df)
#undef MSA_DO
#undef MSA_LOOP_COND
@@ -1222,7 +1224,7 @@ MSA_FN_DF(ilvod_df)
uint32_t k = (pwd->DF[i] & 0x3f) % (2 * n); \
pwx->DF[i] = \
(pwd->DF[i] & 0xc0) ? 0 : k < n ? pwt->DF[k] : pws->DF[k - n]; \
- } while (0);
+ } while (0)
MSA_FN_DF(vshf_df)
#undef MSA_DO
#undef MSA_LOOP_COND
--
1.8.3.1
- [Qemu-devel] [PULL 31/51] target/i386: hax: Move x86_update_hflags., (continued)
- [Qemu-devel] [PULL 31/51] target/i386: hax: Move x86_update_hflags., Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 35/51] icount: fixed saving/restoring of icount warp timers, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 30/51] target/i386: hax: change to use x86_update_hflags, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 34/51] scripts/qemu-gdb/timers.py: new helper to dump timer state, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 32/51] target-i386: update hflags on Hypervisor.framework, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 37/51] irq: fix memory leak, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 33/51] scripts/qemu-gdb: add simple tcg lock status helper, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 36/51] cpus: unify qemu_*_wait_io_event, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 41/51] chardev: Clean up previous patch indentation, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 38/51] net: Drop unusual use of do { } while (0);, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 39/51] mips: Tweak location of ';' in macros,
Paolo Bonzini <=
- [Qemu-devel] [PULL 40/51] chardev: Use goto/label instead of do/break/while(0), Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 42/51] tests: Avoid 'do/while(false); ' in vhost-user-bridge, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 43/51] maint: Fix macros with broken 'do/while(0); ' usage, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 45/51] cpu_physical_memory_sync_dirty_bitmap: Another alignment fix, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 44/51] checkpatch: Enforce proper do/while (0) style, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 47/51] find_ram_offset: Align ram_addr_t allocation on long boundaries, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 51/51] scripts/analyse-locks-simpletrace.py: script to analyse lock times, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 49/51] cpu: flush TB cache when loading VMState, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 46/51] find_ram_offset: Add comments and tracing, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 50/51] util/qemu-thread-*: add qemu_lock, locked and unlock trace events, Paolo Bonzini, 2018/01/16