[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 08/27] target/arm: Fix coding style issues
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v3 08/27] target/arm: Fix coding style issues |
Date: |
Mon, 1 Jul 2019 15:24:57 +0200 |
Since we'll move this code around, fix its style first.
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
v3: added vfp_helper.c
---
target/arm/translate.c | 11 ++++++-----
target/arm/vfp_helper.c | 36 ++++++++++++++++++++++++------------
2 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 4750b9fa1b..c6bdf026b4 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -9109,7 +9109,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int
insn)
loaded_base = 0;
loaded_var = NULL;
n = 0;
- for(i=0;i<16;i++) {
+ for (i = 0; i < 16; i++) {
if (insn & (1 << i))
n++;
}
@@ -9132,7 +9132,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int
insn)
}
}
j = 0;
- for(i=0;i<16;i++) {
+ for (i = 0; i < 16; i++) {
if (insn & (1 << i)) {
if (is_load) {
/* load */
@@ -12353,12 +12353,13 @@ void arm_cpu_dump_state(CPUState *cs, FILE *f, int
flags)
return;
}
- for(i=0;i<16;i++) {
+ for (i = 0; i < 16; i++) {
qemu_fprintf(f, "R%02d=%08x", i, env->regs[i]);
- if ((i % 4) == 3)
+ if ((i % 4) == 3) {
qemu_fprintf(f, "\n");
- else
+ } else {
qemu_fprintf(f, " ");
+ }
}
if (arm_feature(env, ARM_FEATURE_M)) {
diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c
index 7ece78e987..121bdbd3af 100644
--- a/target/arm/vfp_helper.c
+++ b/target/arm/vfp_helper.c
@@ -34,18 +34,24 @@ static inline int vfp_exceptbits_from_host(int host_bits)
{
int target_bits = 0;
- if (host_bits & float_flag_invalid)
+ if (host_bits & float_flag_invalid) {
target_bits |= 1;
- if (host_bits & float_flag_divbyzero)
+ }
+ if (host_bits & float_flag_divbyzero) {
target_bits |= 2;
- if (host_bits & float_flag_overflow)
+ }
+ if (host_bits & float_flag_overflow) {
target_bits |= 4;
- if (host_bits & (float_flag_underflow | float_flag_output_denormal))
+ }
+ if (host_bits & (float_flag_underflow | float_flag_output_denormal)) {
target_bits |= 8;
- if (host_bits & float_flag_inexact)
+ }
+ if (host_bits & float_flag_inexact) {
target_bits |= 0x10;
- if (host_bits & float_flag_input_denormal)
+ }
+ if (host_bits & float_flag_input_denormal) {
target_bits |= 0x80;
+ }
return target_bits;
}
@@ -80,18 +86,24 @@ static inline int vfp_exceptbits_to_host(int target_bits)
{
int host_bits = 0;
- if (target_bits & 1)
+ if (target_bits & 1) {
host_bits |= float_flag_invalid;
- if (target_bits & 2)
+ }
+ if (target_bits & 2) {
host_bits |= float_flag_divbyzero;
- if (target_bits & 4)
+ }
+ if (target_bits & 4) {
host_bits |= float_flag_overflow;
- if (target_bits & 8)
+ }
+ if (target_bits & 8) {
host_bits |= float_flag_underflow;
- if (target_bits & 0x10)
+ }
+ if (target_bits & 0x10) {
host_bits |= float_flag_inexact;
- if (target_bits & 0x80)
+ }
+ if (target_bits & 0x80) {
host_bits |= float_flag_input_denormal;
+ }
return host_bits;
}
--
2.20.1
- [Qemu-devel] [PATCH v3 00/27] Support disabling TCG on ARM, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 01/27] target/arm: Makefile cleanup (Aarch64), Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 02/27] target/arm: Makefile cleanup (ARM), Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 03/27] target/arm: Makefile cleanup (KVM), Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 04/27] target/arm: Makefile cleanup (softmmu), Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 05/27] target/arm: Add copyright boilerplate, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 06/27] target/arm/helper: Remove unused include, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 08/27] target/arm: Fix coding style issues,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v3 07/27] target/arm: Fix multiline comment syntax, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 11/27] target/arm: Declare get_phys_addr() function publicly, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 10/27] target/arm: Move CPU state dumping routines to cpu.c, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 09/27] target/arm: Move the DC ZVA helper into op_helper, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 14/27] target/arm/vfp_helper: Move code around, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 13/27] target/arm: Move debug routines to debug_helper.c, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 12/27] target/arm: Move TLB related routines to tlb_helper.c, Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 15/27] target/arm/vfp_helper: Extract vfp_set_fpscr_to_host(), Philippe Mathieu-Daudé, 2019/07/01
- [Qemu-devel] [PATCH v3 16/27] target/arm/vfp_helper: Extract vfp_set_fpscr_from_host(), Philippe Mathieu-Daudé, 2019/07/01