tests: fp_sharing: fix code style
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
1a93489935
commit
b778ec3604
5 changed files with 40 additions and 40 deletions
|
@ -52,8 +52,8 @@ struct xmm_register {
|
|||
};
|
||||
|
||||
struct fp_volatile_register_set {
|
||||
struct xmm_register xmm[8]; /* XMM[0] -> XMM[7] */
|
||||
struct fp_register st[8]; /* ST[0] -> ST[7] */
|
||||
struct xmm_register xmm[8]; /* XMM[0] -> XMM[7] */
|
||||
struct fp_register st[8]; /* ST[0] -> ST[7] */
|
||||
};
|
||||
|
||||
struct fp_non_volatile_register_set {
|
||||
|
@ -83,24 +83,24 @@ struct fp_non_volatile_register_set {
|
|||
float s[16];
|
||||
};
|
||||
|
||||
#define SIZEOF_FP_VOLATILE_REGISTER_SET \
|
||||
sizeof(struct fp_volatile_register_set)
|
||||
#define SIZEOF_FP_NON_VOLATILE_REGISTER_SET \
|
||||
sizeof(struct fp_non_volatile_register_set)
|
||||
#define SIZEOF_FP_VOLATILE_REGISTER_SET \
|
||||
sizeof(struct fp_volatile_register_set)
|
||||
#define SIZEOF_FP_NON_VOLATILE_REGISTER_SET \
|
||||
sizeof(struct fp_non_volatile_register_set)
|
||||
|
||||
#else
|
||||
|
||||
#error "Architecture must provide the following definitions:\n"
|
||||
"\t'struct fp_volatile_registers'\n"
|
||||
"\t'struct fp_non_volatile_registers'\n"
|
||||
"\t'SIZEOF_FP_VOLATILE_REGISTER_SET'\n"
|
||||
"\t'SIZEOF_FP_NON_VOLATILE_REGISTER_SET'\n"
|
||||
#error "Architecture must provide the following definitions:\n"
|
||||
"\t'struct fp_volatile_registers'\n"
|
||||
"\t'struct fp_non_volatile_registers'\n"
|
||||
"\t'SIZEOF_FP_VOLATILE_REGISTER_SET'\n"
|
||||
"\t'SIZEOF_FP_NON_VOLATILE_REGISTER_SET'\n"
|
||||
#endif /* CONFIG_ISA_IA32 */
|
||||
|
||||
/* the set of ALL floating point registers */
|
||||
|
||||
struct fp_register_set {
|
||||
struct fp_volatile_register_set fp_volatile;
|
||||
struct fp_volatile_register_set fp_volatile;
|
||||
struct fp_non_volatile_register_set fp_non_volatile;
|
||||
};
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ static inline void _load_all_float_registers(struct fp_register_set *regs)
|
|||
__asm__ volatile (
|
||||
"vldmia %0, {s0-s15};\n\t"
|
||||
"vldmia %1, {s16-s31};\n\t"
|
||||
:: "r" (®s->fp_volatile), "r" (®s->fp_non_volatile)
|
||||
: : "r" (®s->fp_volatile), "r" (®s->fp_non_volatile)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ static inline void _store_all_float_registers(struct fp_register_set *regs)
|
|||
__asm__ volatile (
|
||||
"vstmia %0, {s0-s15};\n\t"
|
||||
"vstmia %1, {s16-s31};\n\t"
|
||||
:: "r" (®s->fp_volatile), "r" (®s->fp_non_volatile)
|
||||
: : "r" (®s->fp_volatile), "r" (®s->fp_non_volatile)
|
||||
: "memory"
|
||||
);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ static inline void _store_all_float_registers(struct fp_register_set *regs)
|
|||
*/
|
||||
|
||||
static inline void _load_then_store_all_float_registers(struct fp_register_set
|
||||
*regs)
|
||||
*regs)
|
||||
{
|
||||
_load_all_float_registers(regs);
|
||||
_store_all_float_registers(regs);
|
||||
|
|
|
@ -58,7 +58,7 @@ static inline void _load_all_float_registers(struct fp_register_set *regs)
|
|||
"fldt 188(%0)\n\t;"
|
||||
"fldt 198(%0)\n\t;"
|
||||
|
||||
:: "r" (regs)
|
||||
: : "r" (regs)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ static inline void _load_all_float_registers(struct fp_register_set *regs)
|
|||
*/
|
||||
|
||||
static inline void
|
||||
_load_then_store_all_float_registers(struct fp_register_set *regs)
|
||||
_load_then_store_all_float_registers(struct fp_register_set *regs)
|
||||
{
|
||||
__asm__ volatile (
|
||||
"movdqu 0(%0), %%xmm0\n\t;"
|
||||
|
@ -114,7 +114,7 @@ static inline void
|
|||
"fstpt 138(%0)\n\t;"
|
||||
"fstpt 128(%0)\n\t;"
|
||||
|
||||
:: "r" (regs)
|
||||
: : "r" (regs)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ static inline void _store_all_float_registers(struct fp_register_set *regs)
|
|||
"fstpt 138(%0)\n\t;"
|
||||
"fstpt 128(%0)\n\t;"
|
||||
|
||||
:: "r" (regs) : "memory"
|
||||
: : "r" (regs) : "memory"
|
||||
);
|
||||
}
|
||||
#endif /* _FLOAT_REGS_X86_GCC_H */
|
||||
|
|
|
@ -68,8 +68,8 @@
|
|||
|
||||
#define MAX_TESTS 500
|
||||
#define STACKSIZE 2048
|
||||
#define HI_PRI 5
|
||||
#define LO_PRI 10
|
||||
#define HI_PRI 5
|
||||
#define LO_PRI 10
|
||||
|
||||
/* space for float register load/store area used by low priority task */
|
||||
|
||||
|
@ -141,7 +141,7 @@ void load_store_low(void)
|
|||
|
||||
/* Keep cranking forever, or until an error is detected. */
|
||||
|
||||
for (load_store_low_count = 0; ; load_store_low_count++) {
|
||||
for (load_store_low_count = 0;; load_store_low_count++) {
|
||||
|
||||
/*
|
||||
* Clear store buffer to erase all traces of any previous
|
||||
|
@ -195,12 +195,12 @@ void load_store_low(void)
|
|||
for (i = 0; i < SIZEOF_FP_REGISTER_SET; i++) {
|
||||
if (store_ptr[i] != init_byte) {
|
||||
TC_ERROR("load_store_low found 0x%x instead "
|
||||
"of 0x%x @ offset 0x%x\n",
|
||||
store_ptr[i],
|
||||
init_byte, i);
|
||||
"of 0x%x @ offset 0x%x\n",
|
||||
store_ptr[i],
|
||||
init_byte, i);
|
||||
TC_ERROR("Discrepancy found during "
|
||||
"iteration %d\n",
|
||||
load_store_low_count);
|
||||
"iteration %d\n",
|
||||
load_store_low_count);
|
||||
fpu_sharing_error = 1;
|
||||
}
|
||||
init_byte++;
|
||||
|
@ -319,9 +319,9 @@ void load_store_high(void)
|
|||
|
||||
if ((++load_store_high_count % 100) == 0) {
|
||||
PRINT_DATA("Load and store OK after %u (high) "
|
||||
"+ %u (low) tests\n",
|
||||
load_store_high_count,
|
||||
load_store_low_count);
|
||||
"+ %u (low) tests\n",
|
||||
load_store_high_count,
|
||||
load_store_low_count);
|
||||
}
|
||||
|
||||
/* terminate testing if specified limit has been reached */
|
||||
|
@ -335,19 +335,19 @@ void load_store_high(void)
|
|||
}
|
||||
|
||||
#if defined(CONFIG_ISA_IA32)
|
||||
#define THREAD_FP_FLAGS (K_FP_REGS | K_SSE_REGS)
|
||||
#define THREAD_FP_FLAGS (K_FP_REGS | K_SSE_REGS)
|
||||
#else
|
||||
#define THREAD_FP_FLAGS (K_FP_REGS)
|
||||
#define THREAD_FP_FLAGS (K_FP_REGS)
|
||||
#endif
|
||||
|
||||
K_THREAD_DEFINE(load_low, STACKSIZE, load_store_low, NULL, NULL, NULL,
|
||||
LO_PRI, THREAD_FP_FLAGS, K_NO_WAIT);
|
||||
LO_PRI, THREAD_FP_FLAGS, K_NO_WAIT);
|
||||
|
||||
K_THREAD_DEFINE(load_high, STACKSIZE, load_store_high, NULL, NULL, NULL,
|
||||
HI_PRI, THREAD_FP_FLAGS, K_NO_WAIT);
|
||||
HI_PRI, THREAD_FP_FLAGS, K_NO_WAIT);
|
||||
|
||||
K_THREAD_DEFINE(pi_low, STACKSIZE, calculate_pi_low, NULL, NULL, NULL,
|
||||
LO_PRI, THREAD_FP_FLAGS, K_NO_WAIT);
|
||||
LO_PRI, THREAD_FP_FLAGS, K_NO_WAIT);
|
||||
|
||||
K_THREAD_DEFINE(pi_high, STACKSIZE, calculate_pi_high, NULL, NULL, NULL,
|
||||
HI_PRI, THREAD_FP_FLAGS, K_NO_WAIT);
|
||||
HI_PRI, THREAD_FP_FLAGS, K_NO_WAIT);
|
||||
|
|
|
@ -86,7 +86,7 @@ void calculate_pi_low(void)
|
|||
reference_pi = pi;
|
||||
} else if (reference_pi != pi) {
|
||||
TC_ERROR("Computed pi %1.6f, reference pi %1.6f\n",
|
||||
pi, reference_pi);
|
||||
pi, reference_pi);
|
||||
fpu_sharing_error = 1;
|
||||
return;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ void calculate_pi_high(void)
|
|||
reference_pi = pi;
|
||||
} else if (reference_pi != pi) {
|
||||
TC_ERROR("Computed pi %1.6f, reference pi %1.6f\n",
|
||||
pi, reference_pi);
|
||||
pi, reference_pi);
|
||||
fpu_sharing_error = 1;
|
||||
return;
|
||||
}
|
||||
|
@ -151,8 +151,8 @@ void calculate_pi_high(void)
|
|||
|
||||
if ((++calc_pi_high_count % 100) == 50) {
|
||||
PRINT_DATA("Pi calculation OK after %u (high) +"
|
||||
" %u (low) tests (computed %1.6f)\n",
|
||||
calc_pi_high_count, calc_pi_low_count, pi);
|
||||
" %u (low) tests (computed %1.6f)\n",
|
||||
calc_pi_high_count, calc_pi_low_count, pi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue