PPC64: Add support for the new prefixed instructions
v2 cover PPC64: Add support for the new prefixed instructions
This series aims to add support for the new prefixed instructions introduced with POWER10 CPUs (ISA v3.1).
v2:
- Fixes accordingly to Alex Bennée's review:
Removed fixes for BUILD_DIR and quiet-command since they are already upstream.
Reverted all the tests to ppc64le-linux-user as they are not softmmu tests. To run it:
$ ../configure --target-list=ppc64le-linux-user $ make -j $(nproc) check-tcg
- Fixes accordingly to David's review:
Clarifications for the opcode lookup table and its namespaces (normal insn, prefixed type 0/1, and prefixed 2/3). Clarification about R macro.
Fixed missing switch 'break' in parse_prefix_subtype and c1_idx break. Fixed duplicated comments.
- Fixed build when target != TARGET_PPC64.
Michael Roth (7):
target/ppc: Add infrastructure for prefixed instructions target/ppc: Add support for prefixed load/store instructions tests/tcg: Add tests for prefixed load/store instructions target/ppc: Add support for paired vector load/store instructions tests/tcg: Add tests for paired vector load/store instructions target/ppc: Add support for prefixed load/store FP instructions tests/tcg: Add tests for prefixed load/store FP instructions
target/ppc/cpu.h | 30 +- target/ppc/helper.h | 3 + target/ppc/internal.h | 27 + target/ppc/mem_helper.c | 61 ++ target/ppc/translate.c | 442 +++++++- target/ppc/translate/fp-impl.c.inc | 48 + target/ppc/translate/fp-ops.c.inc | 6 + target/ppc/translate/vsx-impl.c.inc | 66 ++ target/ppc/translate_init.c.inc | 11 +- tests/tcg/ppc64 | 1 + tests/tcg/ppc64le/Makefile.target | 29 + .../test-paired-load-store-vsx.c | 567 +++++++++++ .../test-prefixed-load-store-fp.c | 270 +++++ .../test-prefixed-load-store.c | 945 ++++++++++++++++++ 14 files changed, 2499 insertions(+), 7 deletions(-) create mode 120000 tests/tcg/ppc64 create mode 100644 tests/tcg/ppc64le/Makefile.target create mode 100644 tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c create mode 100644 tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c create mode 100644 tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c
Signature · 1 line
2.17.1
PATCH v2 1/7 target/ppc: Add infrastructure for prefixed instructions
From: Michael Roth <[email protected]>
Some prefixed instructions (Type 0 and 1, e.g. 8-byte Load/Store or 8LS), have a completely seperate namespace for their primary opcodes.
Other prefixed instructions (Type 2 and 3, e.g. Modified Load/Store or MLS) actually re-use existing opcodes to provide a modified variant. We could handle these by extending the existing opcode handlers to check for the prefix and handle accordingly, but in some cases it is cleaner to define seperate handlers for these in their own table entry, and avoids the need to add error-handling to existing handlers for cases where they are called for a prefixed Type 2/3 instruction but don't implement the handling for them. In the future we can re-work things to support both approaches if cases arise where that seems warranted.
Then we have the normal non-prefixed instructions.
To handle all 3 of these cases we extend the table size 3x, with normal instructions indexed directly by their primary opcodes, Type 0/1 indexed by primary opcode + PPC_CPU_PREFIXED_OPCODE_OFFSET, and Type 2/3 indexed by primary opcode + PPC_CPU_PREFIXED_MODIFIED_OPCODE_OFFSET.
Various exception/SRR handling changes related to prefixed instructions are yet to be implemented. For instance, no alignment interrupt is generated if a prefixed instruction crosses the 64-byte boundary; no SRR bit related to prefixed instructions is set on any interrupt, like for FP unavailable interrupt, data storage interrupt, etc.
For details, please see PowerISA v3.1, particularly the following sections:
1.6 Instruction Formats, p. 11
1.6.3 Instruction Prefix Formats, p. 22 3.3.2 Fixed-Point Load Instructions, p. 51 4.6.2 Floating-Point Load Instructions, p. 149
Chapter 7 Interrupts, p. 1247
[ gromero: - comments clean up and updates
- additional comments in the commit log ]
--- target/ppc/cpu.h | 30 +++++- target/ppc/internal.h | 14 +++ target/ppc/translate.c | 170 +++++++++++++++++++++++++++++++- target/ppc/translate_init.c.inc | 11 ++- 4 files changed, 218 insertions(+), 7 deletions(-)
target/ppc/cpu.h +28 -2
@@ -979,8 +979,34 @@ struct ppc_radix_page_info {#define PPC_TLB_EPID_LOAD 8#define PPC_TLB_EPID_STORE 9 -#define PPC_CPU_OPCODES_LEN 0x40 -#define PPC_CPU_INDIRECT_OPCODES_LEN 0x20 +/* +* The primary op-code field extracted from the instruction (PO) is used as the +* index in the top-level QEMU opcode table. That table is then further used to +* find the proper handler, or a pointer to another table (OPC1, OPC2 etc). For +* the normal opcodes (PO field of normal insns) the 64 first entries are used. +* +* Prefixed instructions can be divided into two major groups of instructions: +* the first group is formed by type 0 and 1, and the second group is by type 2 +* and 3. Opcodes (PO) related to prefixed type 0/1 can have the same opcodes +* as the normal instructions but don't have any semantics related to them. But +* since it's an primary opcode anyway it was decided to simply extend the +* top-level table that handles the primary opcodes for the normal instructions. +* On the other handle, prefixed instructions type 2/3 work like modifiers for +* existing normal instructions. In that case it would be possible to reuse the +* handlers for the normal instructions, but that would require changing the +* normal instruction handler in a way it would have to check, for instance, on +* which ISA it has to take care of prefixes insns, and that is already done by +* GEN_HANDLER_* helpers when registering a new instruction, where there is a +* a field to inform on which ISA the instruction exists. Hence, it was decided +* to add another 64 entries for specific handler for the prefixed instructions +* of type 2/3. Thus the size of top-level PO lookup table is 3*64 = 192, hence +* representing three namespaces for decoding PO: for normal insns, for type 0/1 +* and for type 2/3. +*/ +#define PPC_CPU_OPCODES_LEN 0xc0/* 64 + 64 + 64 = 192 */ +#define PPC_CPU_INDIRECT_OPCODES_LEN 0x20 +#define PPC_CPU_PREFIXED_OPCODE_OFFSET 0x40/* Prefixed type 0/1 */ +#define PPC_CPU_PREFIXED_MODIFIED_OPCODE_OFFSET 0x80/* Prefixed type 2/3 */ struct CPUPPCState {/* Most commonly used resources during translated code execution first */
target/ppc/internal.h +14 -0
@@ -129,6 +129,7 @@ EXTRACT_SHELPER(SIMM5, 16, 5);EXTRACT_HELPER (UIMM5 ,16 ,5 );/* 4 bits unsigned immediate value */ EXTRACT_HELPER (UIMM4 ,16 ,4 ); +/* Bit count */ EXTRACT_HELPER (NB ,11 ,5 );/* Shift count */
@@ -146,6 +147,19 @@ EXTRACT_HELPER(TO, 21, 5);EXTRACT_HELPER (CRM ,12 ,8 ); +/* +* Instruction prefix fields +* +* as per PowerISA 3.1 1.6.3 +*/ + +/* prefixed instruction type */ +EXTRACT_HELPER (PREFIX_TYPE ,24 ,2 ); +/* 1-bit sub-type */ +EXTRACT_HELPER (PREFIX_ST1 ,23 ,1 ); +/* 4-bit sub-type */ +EXTRACT_HELPER (PREFIX_ST4 ,20 ,4 ); +#ifndef CONFIG_USER_ONLY EXTRACT_HELPER (SR ,16 ,4 );#endif
target/ppc/translate.c +167 -3
217 lines not on this page · raw message
target/ppc/translate_init.c.inc +9 -2
@@ -9563,8 +9563,13 @@ static int insert_in_table(opc_handler_t **table, unsigned char idx, } static int register_direct_insn(opc_handler_t **ppc_opcodes, - unsigned char idx, opc_handler_t *handler) + unsigned char idx, opc_handler_t *handler, + bool prefixed, bool modified) { + if (prefixed) { + idx = modified ? idx + PPC_CPU_PREFIXED_MODIFIED_OPCODE_OFFSET + : idx + PPC_CPU_PREFIXED_OPCODE_OFFSET; + } if (insert_in_table(ppc_opcodes, idx, handler) < 0) { printf("*** ERROR: opcode %02x already assigned in main " "opcode table\n", idx);
@@ -9688,7 +9693,8 @@ static int register_insn(opc_handler_t **ppc_opcodes, opcode_t *insn) } } } else { - if (register_direct_insn(ppc_opcodes, insn->opc1, &insn->handler) < 0) { + if (register_direct_insn(ppc_opcodes, insn->opc1, &insn->handler, + insn->prefixed, insn->modified) < 0) { return -1; } }
@@ -9766,6 +9772,7 @@ static void dump_ppc_insns(CPUPPCState *env) for (opc1 = 0x00; opc1 < PPC_CPU_OPCODES_LEN; opc1++) { table = env->opcodes; handler = table[opc1]; + /* TODO: need to update opcode dump to account for prefixed space */ if (is_indirect_opcode(handler)) { /* opc2 is 5 bits long */ for (opc2 = 0; opc2 < PPC_CPU_INDIRECT_OPCODES_LEN; opc2++) {
Signature · 1 line
2.17.1
Re: [PATCH v2 1/7] target/ppc: Add infrastructure for prefixed instructions
Quoted 34 lines · Gustavo Romero
From: Michael Roth <[email protected]>
Some prefixed instructions (Type 0 and 1, e.g. 8-byte Load/Store or 8LS), have a completely seperate namespace for their primary opcodes.
Other prefixed instructions (Type 2 and 3, e.g. Modified Load/Store or MLS) actually re-use existing opcodes to provide a modified variant. We could handle these by extending the existing opcode handlers to check for the prefix and handle accordingly, but in some cases it is cleaner to define seperate handlers for these in their own table entry, and avoids the need to add error-handling to existing handlers for cases where they are called for a prefixed Type 2/3 instruction but don't implement the handling for them. In the future we can re-work things to support both approaches if cases arise where that seems warranted.
Then we have the normal non-prefixed instructions.
To handle all 3 of these cases we extend the table size 3x, with normal instructions indexed directly by their primary opcodes, Type 0/1 indexed by primary opcode +
PPC_CPU_PREFIXED_OPCODE_OFFSET, and Type 2/3 indexed by primary opcode +PPC_CPU_PREFIXED_MODIFIED_OPCODE_OFFSET.Various exception/SRR handling changes related to prefixed instructions are yet to be implemented. For instance, no alignment interrupt is generated if a prefixed instruction crosses the 64-byte boundary; no SRR bit related to prefixed instructions is set on any interrupt, like for FP unavailable interrupt, data storage interrupt, etc.
For details, please see PowerISA v3.1, particularly the following sections:
1.6 Instruction Formats, p. 11
1.6.3 Instruction Prefix Formats, p. 22 3.3.2 Fixed-Point Load Instructions, p. 51 4.6.2 Floating-Point Load Instructions, p. 149
Quoted 6 lines
Chapter 7 Interrupts, p. 1247
Signed-off-by Michael Roth <[email protected]>[ gromero: - comments clean up and updates
- additional comments in the commit log ]Signed-off-by Gustavo Romero <[email protected]>
I'm still not seeing any advantage to putting both the plain and prefixed opcodes into a single table. Essentially you're taking the prefix and base opcode and encoding them into a single index. Which isn't inherently wrong, except that the only thing you do with that single index is effectively decode it back into the original two parts.
More specifically
[snip]
Quoted 12 lines
target/ppc/translate.c +12
-0+static uint32_t opc1_idx (DisasContext *ctx) +{ +uint32_t table_offset =0 ; + +switch (ctx->prefix_subtype) { +case PREFIX_ST_8LS : +case PREFIX_ST_8MLS : +case PREFIX_ST_8RR : +case PREFIX_ST_8MRR : + table_offset =PPC_CPU_PREFIXED_OPCODE_OFFSET ; +break ; +case PREFIX_ST_MLS :
target/ppc/translate.c static bool ppc_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cs, · line 8130
Quoted 10 lines
target/ppc/translate.c +10
-0+case PREFIX_ST_MMLS : +case PREFIX_ST_MRR : +case PREFIX_ST_MMRR : +case PREFIX_ST_MMIRR : + table_offset =PPC_CPU_PREFIXED_MODIFIED_OPCODE_OFFSET ; +break ; + } + +return table_offset +opc1 (ctx->opcode); +}
Here, you translate the prefix type into a table offset, but...
Quoted 35 lines
target/ppc/translate.c +27
-0+static void ppc_tr_translate_insn (DisasContextBase *dcbase,CPUState *cs) {DisasContext *ctx =container_of (dcbase, DisasContext, base);@@ -8004,14 +8142,40 @@ static void ppc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) ctx->opcode =translator_ldl_swap (env, ctx->base.pc_next,need_byteswap (ctx)); +/* check for prefix */ + ctx->prefix_subtype =parse_prefix_subtype (ctx->opcode); +if (ctx->prefix_subtype ==PREFIX_ST_INVALID ) { +qemu_log_mask (LOG_GUEST_ERROR ,"invalid/unsupported prefix: " +"%08x " TARGET_FMT_lx"\n" , + ctx->prefix, ctx->base.pc_next); + }else if (ctx->prefix_subtype !=PREFIX_ST_NONE ) { +/* +* this is the 4-byte prefix of an instruction, read the +* next 4 and advance the PC +* +* TODO: we can optimize this to do a single load since we +* read in target_long anyways already +* +* double-check endianess cases. +* +* engineering note about endianess changing based on rfid +* or interrupt. does this need to be accounted for here? +*/ + ctx->prefix = ctx->opcode; + ctx->base.pc_next +=4 ; + ctx->opcode =translator_ldl_swap (env, ctx->base.pc_next, +need_byteswap (ctx)); + }else { + ctx->prefix =0 ; + }
target/ppc/translate.c static void ppc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) · line 8178
Quoted 10 lines
target/ppc/translate.c +3
-3-LOG_DISAS ("translate opcode %08x (%02x %02x %02x %02x) (%s)\n" , +LOG_DISAS ("translate opcode %08x (%02x %02x %02x %02x) prefix %08x (%s)\n" , ctx->opcode,opc1 (ctx->opcode),opc2 (ctx->opcode), -opc3 (ctx->opcode),opc4 (ctx->opcode), +opc3 (ctx->opcode),opc4 (ctx->opcode), ctx->prefix, ctx->le_mode ?"little" :"big" ); ctx->base.pc_next +=4 ; table = cpu->opcodes; - handler = table[opc1 (ctx->opcode)]; + handler = table[opc1_idx (ctx)];
Here, at the only caller, you already have some conditionals on prefix type, so you could equally well just use a different table.
Quoted 40 lines
target/ppc/translate.c +0
-0if (is_indirect_opcode (handler)) { table =ind_table (handler); handler = table[opc2 (ctx->opcode)];target/ppc/translate_init.c.inc +9
-2@@ -9563,8 +9563,13 @@ static int insert_in_table(opc_handler_t **table, unsigned char idx, } static int register_direct_insn(opc_handler_t **ppc_opcodes, - unsigned char idx, opc_handler_t *handler) + unsigned char idx, opc_handler_t *handler, + bool prefixed, bool modified) { + if (prefixed) { + idx = modified ? idx + PPC_CPU_PREFIXED_MODIFIED_OPCODE_OFFSET + : idx + PPC_CPU_PREFIXED_OPCODE_OFFSET; + } if (insert_in_table(ppc_opcodes, idx, handler) < 0) { printf("*** ERROR: opcode %02x already assigned in main " "opcode table\n", idx);@@ -9688,7 +9693,8 @@ static int register_insn(opc_handler_t **ppc_opcodes, opcode_t *insn) } } } else { - if (register_direct_insn(ppc_opcodes, insn->opc1, &insn->handler) < 0) { + if (register_direct_insn(ppc_opcodes, insn->opc1, &insn->handler, + insn->prefixed, insn->modified) < 0) { return -1; } }@@ -9766,6 +9772,7 @@ static void dump_ppc_insns(CPUPPCState *env) for (opc1 = 0x00; opc1 < PPC_CPU_OPCODES_LEN; opc1++) { table = env->opcodes; handler = table[opc1]; + /* TODO: need to update opcode dump to account for prefixed space */ if (is_indirect_opcode(handler)) { /* opc2 is 5 bits long */ for (opc2 = 0; opc2 < PPC_CPU_INDIRECT_OPCODES_LEN; opc2++) {
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
PATCH v2 2/7 target/ppc: Add support for prefixed load/store instructions
In reply to Gustavo RomeroFrom: Michael Roth <[email protected]>
This commit adds support for the following prefixed load and store instructions for GPRs:
plbz, plh{a,z}, plw{a,z}, pld, plq
pstb, psth, pstw, pstd, pstq
paddi
[ gromero: - fix for gen_addr_imm34_index()
- fix build when target != TARGET_PPC64
- removed redundant PREFIX_R bit helper
- changes in commit log ]
--- target/ppc/internal.h | 6 + target/ppc/translate.c | 264 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 270 insertions(+)
target/ppc/internal.h +6 -0
@@ -159,6 +159,12 @@ EXTRACT_HELPER(PREFIX_TYPE, 24, 2);EXTRACT_HELPER (PREFIX_ST1 ,23 ,1 );/* 4-bit sub-type */ EXTRACT_HELPER (PREFIX_ST4 ,20 ,4 ); +/* 18 bits signed immediate value */ +EXTRACT_SHELPER (SIMM18 ,0 ,18 ); +/* 18 bits unsigned immediate value */ +EXTRACT_HELPER (UIMM18 ,0 ,18 ); +/* R bit controls if CIA should be added when computing the EA */ +EXTRACT_HELPER (R ,20 ,1 );#ifndef CONFIG_USER_ONLY EXTRACT_HELPER (SR ,16 ,4 );
target/ppc/translate.c +264 -0
294 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 3/7 tests/tcg: Add tests for prefixed load/store instructions
In reply to Gustavo RomeroFrom: Michael Roth <[email protected]>
This commit adds various tests to exercise the implementation of prefixed load/store instructions on POWER10.
[ gromero - fix to avoid alignment interrupt, don't cross 64-byte boundary
- fix displacement for pl{bz,hz,ha,wz,wa,d} to skip branch insn.
- tweaks in debug output
- commit log ]
--- tests/tcg/ppc64 | 1 + tests/tcg/ppc64le/Makefile.target | 16 + .../test-prefixed-load-store.c | 945 ++++++++++++++++++ 3 files changed, 962 insertions(+) create mode 120000 tests/tcg/ppc64 create mode 100644 tests/tcg/ppc64le/Makefile.target create mode 100644 tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c
tests/tcg/ppc64 new file +1 -0
@@ -0,0 +1 @@ +ppc64le/
tests/tcg/ppc64le/Makefile.target new file +16 -0
@@ -0,0 +1,16 @@ +# -*- Mode: makefile -*- +# +# PPC - included from tests/tcg/Makefile +# + +EXTRA_RUNS+=run-test-mmap + +VPATH += $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/instruction-tests +QEMU_OPTS += -cpu power10 + +PPC_TESTS = test-prefixed-load-store + +TESTS += $(PPC_TESTS) + +test-prefixed-load-store: test-prefixed-load-store.c + gcc $< -o test-prefixed-load-store
tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c new file +945 -0
945 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 4/7 target/ppc: Add support for paired vector load/store instructions
In reply to Gustavo RomeroFrom: Michael Roth <[email protected]>
This adds support for the following load/store instructions for paired vector registers:
lxvp, plxvp, lxvpx
stxvp, pstxvp, stxvpx
[ gromero: - fix in helper_load_paired_vec(), for LE
- fix in helper_store_paired_vec(), for LE
- fix build when target != PPC64 ]
--- target/ppc/helper.h | 3 ++ target/ppc/internal.h | 7 +++ target/ppc/mem_helper.c | 61 ++++++++++++++++++++++++++ target/ppc/translate.c | 8 ++++ target/ppc/translate/vsx-impl.c.inc | 66 +++++++++++++++++++++++++++++ 5 files changed, 145 insertions(+)
target/ppc/helper.h +3 -0
@@ -279,6 +279,9 @@ DEF_HELPER_4(lxvl, void, env, tl, vsr, tl) DEF_HELPER_4(lxvll, void, env, tl, vsr, tl) DEF_HELPER_4(stxvl, void, env, tl, vsr, tl)DEF_HELPER_4 (stxvll, void, env, tl, vsr, tl) +/* lxvp/stxvp, plxvp/pstxvp, lxvpx/stxvpx */ +DEF_HELPER_4(store_paired_vec, void, env, tl, vsr, vsr) +DEF_HELPER_4(load_paired_vec, void, env, tl, vsr, vsr)#endif DEF_HELPER_4(vsumsws, void, env, avr, avr, avr)DEF_HELPER_4 (vsum2sws, void, env, avr, avr, avr)
target/ppc/internal.h +7 -0
@@ -80,6 +80,12 @@ static inline int16_t name(uint32_t opcode) \ (((opcode >> (shift_op_d2)) & ((1 << (d2_bits)) -1 )) << (shift_d2)); \ } +#define EXTRACT_HELPER_SPLIT_SHIFTED (name, shift1, nb1, shift2, nb2, shift3) \ +static inline uint32_t name(uint32_t opcode) \ +{ \ + return extract32(opcode, shift1, nb1) << (nb2 + shift3) | \ + extract32(opcode, shift2, nb2) << shift3; \ +}/* Opcode part 1 */ EXTRACT_HELPER (opc1,26 ,6 );
@@ -226,6 +232,7 @@ EXTRACT_HELPER(SP, 19, 2);EXTRACT_HELPER (IMM8 ,11 ,8 );EXTRACT_HELPER (DCMX ,16 ,7 );EXTRACT_HELPER_SPLIT_3 (DCMX_XV ,5 ,16 ,0 ,1 ,2 ,5 ,1 ,6 ,6 ); +EXTRACT_HELPER_SPLIT_SHIFTED (xTp,21 ,1 ,22 ,4 ,1 );void helper_compute_fprf_float16 (CPUPPCState *env,float16 arg);void helper_compute_fprf_float32 (CPUPPCState *env,float32 arg);
target/ppc/mem_helper.c +61 -0
67 lines not on this page · raw message
target/ppc/translate.c +8 -0
@@ -7397,6 +7397,14 @@ GEN_HANDLER_E_PREFIXED(pstq, 0x3c, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310) GEN_HANDLER_E(dform39, 0x39, 0xFF, 0xFF, 0x00000000, PPC_NONE, PPC2_ISA205),/* handles stfdp, lxv, stxsd, stxssp, stxv */ GEN_HANDLER_E(dform3D, 0x3D, 0xFF, 0xFF, 0x00000000, PPC_NONE, PPC2_ISA205), +#if defined(TARGET_PPC64 ) +GEN_HANDLER_E_PREFIXED (plxvp,0x3A ,0xFF ,0xFF ,0x00000000 ,PPC_NONE ,PPC2_ISA310 ), +GEN_HANDLER_E_PREFIXED (pstxvp,0x3E ,0xFF ,0xFF ,0x00000000 ,PPC_NONE ,PPC2_ISA310 ), +/* handles lxvp, stxvp */ +GEN_HANDLER_E (dqform6,0x6 ,0x0 ,0xFF ,0x00000000 ,PPC_NONE ,PPC2_ISA310 ), +GEN_HANDLER_E (lxvpx,0x1F ,0xD ,0xA ,0x00000000 ,PPC_NONE ,PPC2_ISA310 ), +GEN_HANDLER_E (stxvpx,0x1F ,0xD ,0xE ,0x00000000 ,PPC_NONE ,PPC2_ISA310 ), +#endifGEN_HANDLER (lmw,0x2E ,0xFF ,0xFF ,0x00000000 ,PPC_INTEGER ),GEN_HANDLER (stmw,0x2F ,0xFF ,0xFF ,0x00000000 ,PPC_INTEGER ), GEN_HANDLER(lswi, 0x1F, 0x15, 0x12, 0x00000001, PPC_STRING),
target/ppc/translate/vsx-impl.c.inc +66 -0
72 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 5/7 tests/tcg: Add tests for paired vector load/store instructions
In reply to Gustavo RomeroFrom: Michael Roth <[email protected]>
[ gromero: - aligned prefixed insns., avoiding cross 64-byte boundary
- fix to skip branch insn. just after PLXVP
- fix various buffer offsets used in comparisons, for LE only
- tweaks in debug output ]
--- tests/tcg/ppc64le/Makefile.target | 9 + .../test-paired-load-store-vsx.c | 567 ++++++++++++++++++ 2 files changed, 576 insertions(+) create mode 100644 tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c
tests/tcg/ppc64le/Makefile.target +9 -0
@@ -11,6 +11,15 @@ QEMU_OPTS += -cpu power10 PPC_TESTS = test-prefixed-load-store TESTS += $(PPC_TESTS) +PPC_VSX_TESTS = test-paired-load-store-vsx + +VSX_CFLAGS = -maltivec -mvsx +$(PPC_VSX_TESTS): CFLAGS+=$(VSX_CFLAGS) + +PPC_TESTS += $(PPC_VSX_TESTS) test-prefixed-load-store: test-prefixed-load-store.c gcc $< -o test-prefixed-load-store + +test-paired-load-store-vsx: test-paired-load-store-vsx.c + gcc $< -o test-paired-load-store-vsx
tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c new file +567 -0
567 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 6/7 target/ppc: Add support for prefixed load/store FP instructions
In reply to Gustavo RomeroFrom: Michael Roth <[email protected]>
This commit adds support for the following load/store instructions for FP registers:
plf, plfd
pstfs, pstfd
--- target/ppc/translate/fp-impl.c.inc | 48 ++++++++++++++++++++++++++++++ target/ppc/translate/fp-ops.c.inc | 6 ++++ 2 files changed, 54 insertions(+)
target/ppc/translate/fp-impl.c.inc +48 -0
@@ -874,6 +874,28 @@ static void glue(gen_, name)(DisasContext *ctx) \ tcg_temp_free_i64(t0); \ } +#define GEN_PLDF(name, ldop, opc, type) \ +static void glue(gen_, p##name)(DisasContext *ctx) \ +{ \ + TCGv EA; \ + TCGv_i64 t0; \ + if (unlikely(!ctx->fpu_enabled)) { \ + gen_exception(ctx, POWERPC_EXCP_FPU); \ + return; \ + } \ + gen_set_access_type(ctx, ACCESS_FLOAT); \ + EA = tcg_temp_new(); \ + t0 = tcg_temp_new_i64(); \ + if (gen_addr_imm34_index(ctx, EA)) { \ + goto out; \ + } \ + gen_qemu_##ldop(ctx, t0, EA); \ + set_fpr(rD(ctx->opcode), t0); \ +out: \ + tcg_temp_free(EA); \ + tcg_temp_free_i64(t0); \ +} + #define GEN_LDUF(name, ldop, opc, type) \ static void glue(gen_, name##u)(DisasContext *ctx) \ { \
@@ -943,6 +965,7 @@ static void glue(gen_, name##x)(DisasContext *ctx) \ #define GEN_LDFS(name, ldop, op, type) \ GEN_LDF(name, ldop, op | 0x20, type); \ +GEN_PLDF(name, ldop, op | 0x20, type); \ GEN_LDUF(name, ldop, op | 0x21, type); \ GEN_LDUXF(name, ldop, op | 0x01, type); \ GEN_LDXF(name, ldop, 0x17, op | 0x00, type)
@@ -1109,6 +1132,28 @@ static void glue(gen_, name)(DisasContext *ctx) \ tcg_temp_free_i64(t0); \ } +#define GEN_PSTF(name, stop, opc, type) \ +static void glue(gen_, p##name)(DisasContext *ctx) \ +{ \ + TCGv EA; \ + TCGv_i64 t0; \ + if (unlikely(!ctx->fpu_enabled)) { \ + gen_exception(ctx, POWERPC_EXCP_FPU); \ + return; \ + } \ + gen_set_access_type(ctx, ACCESS_FLOAT); \ + EA = tcg_temp_new(); \ + t0 = tcg_temp_new_i64(); \ + if (gen_addr_imm34_index(ctx, EA)) { \ + goto out; \ + } \ + get_fpr(t0, rS(ctx->opcode)); \ + gen_qemu_##stop(ctx, t0, EA); \ +out: \ + tcg_temp_free(EA); \ + tcg_temp_free_i64(t0); \ +} + #define GEN_STUF(name, stop, opc, type) \ static void glue(gen_, name##u)(DisasContext *ctx) \ { \
@@ -1178,6 +1223,7 @@ static void glue(gen_, name##x)(DisasContext *ctx) \ #define GEN_STFS(name, stop, op, type) \ GEN_STF(name, stop, op | 0x20, type); \ +GEN_PSTF(name, stop, op | 0x20, type); \ GEN_STUF(name, stop, op | 0x21, type); \ GEN_STUXF(name, stop, op | 0x01, type); \ GEN_STXF(name, stop, 0x17, op | 0x00, type)
@@ -1483,12 +1529,14 @@ static void gen_stfqx(DisasContext *ctx) #undef GEN_FLOAT_BS #undef GEN_LDF +#undef GEN_PLDF #undef GEN_LDUF #undef GEN_LDUXF #undef GEN_LDXF #undef GEN_LDFS #undef GEN_STF +#undef GEN_PSTF #undef GEN_STUF #undef GEN_STUXF #undef GEN_STXF
target/ppc/translate/fp-ops.c.inc +6 -0
@@ -52,6 +52,8 @@ GEN_FLOAT_B(rim, 0x08, 0x0F, 1, PPC_FLOAT_EXT), #define GEN_LDF(name, ldop, opc, type) \ GEN_HANDLER(name, opc, 0xFF, 0xFF, 0x00000000, type), +#define GEN_PLDF(name, ldop, opc, type) \ +GEN_HANDLER_E_PREFIXED_M(p##name, opc, 0xFF, 0xFF, 0x0, PPC_64B, PPC2_ISA310), #define GEN_LDUF(name, ldop, opc, type) \ GEN_HANDLER(name##u, opc, 0xFF, 0xFF, 0x00000000, type), #define GEN_LDUXF(name, ldop, opc, type) \
@@ -60,6 +62,7 @@ GEN_HANDLER(name##ux, 0x1F, 0x17, opc, 0x00000001, type), GEN_HANDLER(name##x, 0x1F, opc2, opc3, 0x00000001, type), #define GEN_LDFS(name, ldop, op, type) \ GEN_LDF(name, ldop, op | 0x20, type) \ +GEN_PLDF(name, ldop, op | 0x20, type) \ GEN_LDUF(name, ldop, op | 0x21, type) \ GEN_LDUXF(name, ldop, op | 0x01, type) \ GEN_LDXF(name, ldop, 0x17, op | 0x00, type)
@@ -73,6 +76,8 @@ GEN_HANDLER_E(lfdpx, 0x1F, 0x17, 0x18, 0x00200001, PPC_NONE, PPC2_ISA205), #define GEN_STF(name, stop, opc, type) \ GEN_HANDLER(name, opc, 0xFF, 0xFF, 0x00000000, type), +#define GEN_PSTF(name, ldop, opc, type) \ +GEN_HANDLER_E_PREFIXED_M(p##name, opc, 0xFF, 0xFF, 0x0, PPC_64B, PPC2_ISA310), #define GEN_STUF(name, stop, opc, type) \ GEN_HANDLER(name##u, opc, 0xFF, 0xFF, 0x00000000, type), #define GEN_STUXF(name, stop, opc, type) \
@@ -81,6 +86,7 @@ GEN_HANDLER(name##ux, 0x1F, 0x17, opc, 0x00000001, type), GEN_HANDLER(name##x, 0x1F, opc2, opc3, 0x00000001, type), #define GEN_STFS(name, stop, op, type) \ GEN_STF(name, stop, op | 0x20, type) \ +GEN_PSTF(name, stop, op | 0x20, type) \ GEN_STUF(name, stop, op | 0x21, type) \ GEN_STUXF(name, stop, op | 0x01, type) \ GEN_STXF(name, stop, 0x17, op | 0x00, type)
Signature · 1 line
2.17.1
PATCH v2 7/7 tests/tcg: Add tests for prefixed load/store FP instructions
In reply to Gustavo RomeroFrom: Michael Roth <[email protected]>
--- tests/tcg/ppc64le/Makefile.target | 4 + .../test-prefixed-load-store-fp.c | 270 ++++++++++++++++++ 2 files changed, 274 insertions(+) create mode 100644 tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c
tests/tcg/ppc64le/Makefile.target +4 -0
@@ -9,6 +9,7 @@ VPATH += $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/instruction-tests QEMU_OPTS += -cpu power10 PPC_TESTS = test-prefixed-load-store +PPC_TESTS += test-prefixed-load-store-fp TESTS += $(PPC_TESTS) PPC_VSX_TESTS = test-paired-load-store-vsx
@@ -23,3 +24,6 @@ test-prefixed-load-store: test-prefixed-load-store.c test-paired-load-store-vsx: test-paired-load-store-vsx.c gcc $< -o test-paired-load-store-vsx + +test-prefixed-load-store-fp: test-prefixed-load-store-fp.c + gcc $< -o test-prefixed-load-store-fp
tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c new file +270 -0
270 lines not on this page · raw message
Signature · 1 line
2.17.1
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [PATCH v2 0/7] PPC64: Add support for the new prefixed instructions
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
- [tag update] patchew/[email protected] -> patchew/[email protected] - [tag update] patchew/[email protected] -> patchew/[email protected] * [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
4afd921 tests/tcg: Add tests for prefixed load/store FP instructions 2f4db24 target/ppc: Add support for prefixed load/store FP instructions 09b1856 tests/tcg: Add tests for paired vector load/store instructions 84275cf target/ppc: Add support for paired vector load/store instructions 4ef6a3a tests/tcg: Add tests for prefixed load/store instructions 660dbc6 target/ppc: Add support for prefixed load/store instructions 2f816dd target/ppc: Add infrastructure for prefixed instructions
=== OUTPUT BEGIN ===
1/7 Checking commit 2f816dd856fd (target/ppc: Add infrastructure for prefixed instructions) 2/7 Checking commit 660dbc6b7475 (target/ppc: Add support for prefixed load/store instructions)
ERROR: open brace '{' following function declarations go on the next line
#262: FILE: target/ppc/translate.c:2980:
+static void gen_pstd(DisasContext *ctx) {
ERROR: open brace '{' following function declarations go on the next line #274: FILE: target/ppc/translate.c:2992:
+static void gen_pstq(DisasContext *ctx) {
WARNING: line over 80 characters
#318: FILE: target/ppc/translate.c:7320:
+GEN_HANDLER_E_PREFIXED_M(paddi, 0x0E, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310),
WARNING: line over 80 characters
#327: FILE: target/ppc/translate.c:7383:
+GEN_HANDLER_E_PREFIXED_M(plbz, 0x22, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310),
WARNING: line over 80 characters
#328: FILE: target/ppc/translate.c:7384:
+GEN_HANDLER_E_PREFIXED_M(plhz, 0x28, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310),
WARNING: line over 80 characters
#329: FILE: target/ppc/translate.c:7385:
+GEN_HANDLER_E_PREFIXED_M(plha, 0x2a, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310),
WARNING: line over 80 characters
#330: FILE: target/ppc/translate.c:7386:
+GEN_HANDLER_E_PREFIXED_M(plwz, 0x20, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310),
WARNING: line over 80 characters
#331: FILE: target/ppc/translate.c:7387:
+GEN_HANDLER_E_PREFIXED(plwa, 0x29, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310),
WARNING: line over 80 characters
#334: FILE: target/ppc/translate.c:7390:
+GEN_HANDLER_E_PREFIXED_M(pstb, 0x26, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310),
WARNING: line over 80 characters
#335: FILE: target/ppc/translate.c:7391:
+GEN_HANDLER_E_PREFIXED_M(psth, 0x2c, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310),
WARNING: line over 80 characters
#336: FILE: target/ppc/translate.c:7392:
+GEN_HANDLER_E_PREFIXED_M(pstw, 0x24, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310),
WARNING: line over 80 characters
#337: FILE: target/ppc/translate.c:7393:
+GEN_HANDLER_E_PREFIXED(pstd, 0x3d, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310),
WARNING: line over 80 characters
#338: FILE: target/ppc/translate.c:7394:
+GEN_HANDLER_E_PREFIXED(pstq, 0x3c, 0xFF, 0xFF, 0x00000000, PPC_64B, PPC2_ISA310),
total: 2 errors, 11 warnings, 306 lines checked
Patch 2/7 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
3/7 Checking commit 4ef6a3a5b704 (tests/tcg: Add tests for prefixed load/store instructions)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #19:
new file mode 120000
ERROR: do not initialise globals to 0 or NULL
#62: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:9:
+bool debug = false;
ERROR: suspicious ; after while (0)
#70: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:17:
+ } while (0);
ERROR: spaces required around that '%' (ctx:BxV)
#94: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:41:
+ op(%1, %0, offset_upper18, offset_lower16, r) \
^ERROR: spaces required around that '%' (ctx:WxV)
#94: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:41:
+ op(%1, %0, offset_upper18, offset_lower16, r) \
^ERROR: suspicious ; after while (0)
#97: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:44:
+ } while (0);
ERROR: open brace '{' following function declarations go on the next line #99: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:46:
+void check_pst(uint64_t src, uint64_t dest, uint64_t dest_orig, int width) {
ERROR: spaces required around that '*' (ctx:VxV)
#101: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:48:
+ uint64_t src_mask = (width == 8) ? -1UL : (1UL << (8*width)) - 1;
^ERROR: spaces required around that '*' (ctx:VxV)
#104: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:51:
+ dest_orig_mask = -1UL << (8*width);
^ERROR: spaces required around that '*' (ctx:VxV)
#107: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:54:
+ dest_orig_mask = (-1UL << (8*width)) >> (8*width);
^ERROR: spaces required around that '*' (ctx:VxV)
#107: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:54:
+ dest_orig_mask = (-1UL << (8*width)) >> (8*width);
^ERROR: line over 90 characters
#108: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:55:
+ assert(dest == ((dest_orig & dest_orig_mask) | ((src & src_mask) << (8*(8-width)))));
ERROR: spaces required around that '*' (ctx:VxV)
#108: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:55:
+ assert(dest == ((dest_orig & dest_orig_mask) | ((src & src_mask) << (8*(8-width)))));
^ERROR: spaces required around that '-' (ctx:VxV)
#108: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:55:
+ assert(dest == ((dest_orig & dest_orig_mask) | ((src & src_mask) << (8*(8-width)))));
^ERROR: open brace '{' following function declarations go on the next line #112: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:59:
+void test_pst_offset(int width) {
ERROR: open brace '{' following function declarations go on the next line #182: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:129:
+void test_pst(int width) {
ERROR: open brace '{' following function declarations go on the next line #242: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:189:
+void test_pstb(void) {
ERROR: open brace '{' following function declarations go on the next line #247: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:194:
+void test_psth(void) {
ERROR: open brace '{' following function declarations go on the next line #252: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:199:
+void test_pstw(void) {
ERROR: open brace '{' following function declarations go on the next line #257: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:204:
+void test_pstd(void) {
ERROR: spaces required around that '%' (ctx:BxV)
#290: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:237:
+ op(%0, %2, offset_upper18, offset_lower16, r) \
^ERROR: spaces required around that '%' (ctx:WxV)
#290: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:237:
+ op(%0, %2, offset_upper18, offset_lower16, r) \
^ERROR: suspicious ; after while (0)
#293: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:240:
+ } while (0);
ERROR: open brace '{' following function declarations go on the next line #295: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:242:
+void check_pl_z(uint64_t src, uint64_t dest, int width) {
ERROR: spaces required around that '*' (ctx:VxV)
#299: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:246:
+ src_mask = (width == 8) ? -1UL : (1UL << (8*width)) - 1;
^ERROR: spaces required around that '*' (ctx:VxV)
#302: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:249:
+ src_mask = (width == 8) ? -1UL : -1UL << (8*(8-width));
^ERROR: spaces required around that '-' (ctx:VxV)
#302: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:249:
+ src_mask = (width == 8) ? -1UL : -1UL << (8*(8-width));
^ERROR: spaces required around that '*' (ctx:VxV)
#303: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:250:
+ assert(dest == (src & src_mask) >> (8*(8-width)));
^ERROR: spaces required around that '-' (ctx:VxV)
#303: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:250:
+ assert(dest == (src & src_mask) >> (8*(8-width)));
^ERROR: open brace '{' following function declarations go on the next line #307: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:254:
+void check_pl_a(uint64_t src, uint64_t dest, int width) {
WARNING: Block comments use a leading /* on a separate line
#310: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:257:
+ /* TODO: docs suggest testing high-order bit of src byte/halfword/etc, but
ERROR: spaces required around that '*' (ctx:VxV)
#316: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:263:
+ sign_mask = (src & (1UL << (width*8-1))) ? -1UL << (8*width) : 0;
^ERROR: spaces required around that '-' (ctx:VxV)
#316: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:263:
+ sign_mask = (src & (1UL << (width*8-1))) ? -1UL << (8*width) : 0;
^ERROR: spaces required around that '*' (ctx:VxV)
#316: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:263:
+ sign_mask = (src & (1UL << (width*8-1))) ? -1UL << (8*width) : 0;
^ERROR: spaces required around that '*' (ctx:VxV)
#318: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:265:
+ sign_mask = (src & (1UL << 63)) ? -1UL << (8*width) : 0;
^ERROR: spaces required around that '*' (ctx:VxV)
#322: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:269:
+ src_mask = (width == 8) ? -1UL : (1UL << (8*width)) - 1;
^ERROR: spaces required around that '*' (ctx:VxV)
#325: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:272:
+ src_mask = (width == 8) ? -1UL : -1UL << (8*(8-width));
^ERROR: spaces required around that '-' (ctx:VxV)
#325: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:272:
+ src_mask = (width == 8) ? -1UL : -1UL << (8*(8-width));
^ERROR: spaces required around that '*' (ctx:VxV)
#326: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:273:
+ assert(dest == (((src & src_mask) >> (8*(8-width))) | sign_mask));
^ERROR: spaces required around that '-' (ctx:VxV)
#326: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:273:
+ assert(dest == (((src & src_mask) >> (8*(8-width))) | sign_mask));
^ERROR: open brace '{' following function declarations go on the next line #330: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:277:
+void test_pl_a(int width, uint64_t src, uint64_t dest_orig) {
ERROR: open brace '{' following function declarations go on the next line #435: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:382:
+void test_pl_z(int width, uint64_t src, uint64_t dest_orig) {
ERROR: open brace '{' following function declarations go on the next line #569: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:516:
+void test_plbz(void) {
ERROR: open brace '{' following function declarations go on the next line #575: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:522:
+void test_plhz(void) {
ERROR: open brace '{' following function declarations go on the next line #581: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:528:
+void test_plha(void) {
ERROR: open brace '{' following function declarations go on the next line #587: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:534:
+void test_plwz(void) {
ERROR: open brace '{' following function declarations go on the next line #593: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:540:
+void test_plwa(void) {
ERROR: open brace '{' following function declarations go on the next line #599: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:546:
+void test_pld(void) {
ERROR: open brace '{' following function declarations go on the next line #611: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:558:
+void test_pstq(void) {
ERROR: spaces required around that '%' (ctx:WxV)
#634: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:581:
+ PSTQ(22, %0, 0, 0, 0)
^
ERROR: open brace '{' following function declarations go on the next line #665: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:612:
+void test_plq(void) {
ERROR: spaces required around that '%' (ctx:WxV)
#720: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:667:
+ PLQ(20, %2, 0, 0, 0)
^
ERROR: "(foo*)" should be "(foo *)"
#737: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:684:
+ assert(dest0a == ((uint64_t*)src)[0]);
ERROR: "(foo*)" should be "(foo *)"
#738: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:685:
+ assert(dest1a == ((uint64_t*)src)[1]);
ERROR: "(foo*)" should be "(foo *)"
#742: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:689:
+ assert(dest0a == ((uint64_t*)src)[0]);
ERROR: "(foo*)" should be "(foo *)"
#743: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:690:
+ assert(dest1a == ((uint64_t*)src)[1]);
ERROR: open brace '{' following function declarations go on the next line #751: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:698:
+void test_plq2(void) {
ERROR: spaces required around that '%' (ctx:WxV)
#807: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:754:
+ PLQ(20, %2, 0, 0, 0)
^
ERROR: open brace '{' following function declarations go on the next line #834: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:781:
+void test_plbz_cia(void) {
WARNING: Block comments use a leading /* on a separate line
#838: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:785:
+ PLBZ(%0, 0, 0, 8 /* skip plbz */ + 4 /* skip b */, 1)
ERROR: spaces required around that '%' (ctx:BxV)
#838: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:785:
+ PLBZ(%0, 0, 0, 8 /* skip plbz */ + 4 /* skip b */, 1)
^
ERROR: open brace '{' following function declarations go on the next line #850: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:797:
+void test_plhz_cia(void) {
WARNING: Block comments use a leading /* on a separate line
#854: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:801:
+ PLHZ(%0, 0, 0, 8 /* skip plhz */ + 4 /* skip b */, 1)
ERROR: spaces required around that '%' (ctx:BxV)
#854: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:801:
+ PLHZ(%0, 0, 0, 8 /* skip plhz */ + 4 /* skip b */, 1)
^
ERROR: open brace '{' following function declarations go on the next line #870: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:817:
+void test_plha_cia(void) {
WARNING: Block comments use a leading /* on a separate line
#874: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:821:
+ PLHA(%0, 0, 0, 8 /* skip plha */ + 4 /* skip b */, 1)
ERROR: spaces required around that '%' (ctx:BxV)
#874: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:821:
+ PLHA(%0, 0, 0, 8 /* skip plha */ + 4 /* skip b */, 1)
^
ERROR: open brace '{' following function declarations go on the next line #894: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:841:
+void test_plwz_cia(void) {
WARNING: Block comments use a leading /* on a separate line
#898: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:845:
+ PLWZ(%0, 0, 0, 8 /* skip plwz */ + 4 /* skip b */, 1)
ERROR: spaces required around that '%' (ctx:BxV)
#898: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:845:
+ PLWZ(%0, 0, 0, 8 /* skip plwz */ + 4 /* skip b */, 1)
^
ERROR: open brace '{' following function declarations go on the next line #914: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:861:
+void test_plwa_cia(void) {
WARNING: Block comments use a leading /* on a separate line
#918: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:865:
+ PLWA(%0, 0, 0, 8 /* skip plwa */ + 4 /* skip b */, 1)
ERROR: spaces required around that '%' (ctx:BxV)
#918: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:865:
+ PLWA(%0, 0, 0, 8 /* skip plwa */ + 4 /* skip b */, 1)
^
ERROR: open brace '{' following function declarations go on the next line #938: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:885:
+void test_pld_cia(void) {
WARNING: Block comments use a leading /* on a separate line
#942: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:889:
+ PLD(%0, 0, 0, 8 /* skip pld */ + 4 /* skip b */, 1)
ERROR: spaces required around that '%' (ctx:BxV)
#942: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:889:
+ PLD(%0, 0, 0, 8 /* skip pld */ + 4 /* skip b */, 1)
^
ERROR: Macros with multiple statements should be enclosed in a do - while loop #962: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c:909:
+#define do_test(testname) \
+ if (debug) \
+ fprintf(stderr, "-> running test: " #testname "\n"); \
+ test_##testname(); \
+
total: 69 errors, 8 warnings, 962 lines checked
Patch 3/7 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/7 Checking commit 84275cf80953 (target/ppc: Add support for paired vector load/store instructions)
ERROR: do not use C99 // comments
#85: FILE: target/ppc/mem_helper.c:554:
+ } else { // TODO: check if it's correct for BE.
ERROR: do not use C99 // comments
#114: FILE: target/ppc/mem_helper.c:583:
+ } else { // TODO: check if it's correct for BE.
WARNING: line over 80 characters
#140: FILE: target/ppc/translate.c:7401:
+GEN_HANDLER_E_PREFIXED(plxvp, 0x3A, 0xFF, 0xFF, 0x00000000, PPC_NONE, PPC2_ISA310),
WARNING: line over 80 characters
#141: FILE: target/ppc/translate.c:7402:
+GEN_HANDLER_E_PREFIXED(pstxvp, 0x3E, 0xFF, 0xFF, 0x00000000, PPC_NONE, PPC2_ISA310),
total: 2 errors, 2 warnings, 181 lines checked
Patch 4/7 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
5/7 Checking commit 09b18567aad4 (tests/tcg: Add tests for paired vector load/store instructions)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#36:
new file mode 100644
ERROR: do not initialise globals to 0 or NULL
#50: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:10:
+bool debug = false;
ERROR: suspicious ; after while (0)
#58: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:18:
+ } while (0);
ERROR: line over 90 characters
#65: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:25:
+ ".long 58 << 26 | (" #_Tp ") << 22 | (" #_TX ") << 21 | (" #_RA ") << 16 | (" #_d1 ");"
ERROR: open brace '{' following function declarations go on the next line #67: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:27:
+void test_plxvp_cia(void) {
WARNING: Block comments use a leading /* on a separate line
#74: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:34:
+ PLXVP(4, 0, 0, 8 /* skip plxvp */ + 4 /* skip b */, 1, 0)
ERROR: braces {} are necessary for all arms of this statement
#112: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:72:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#115: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:75:
+ assert(v0[i] == (31 - i)); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#119: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:79:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#122: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:82:
+ assert(v1[i] == 15 - i); // FIXME
ERROR: open brace '{' following function declarations go on the next line #126: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:86:
+void test_plxvp(void) {
ERROR: spaces required around that '%' (ctx:WxV)
#138: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:98:
+ asm(PLXVP(3, %2, 0, 0, 0, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#143: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:103:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#146: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:106:
+ assert(v0[i] == buf[i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#150: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:110:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#153: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:113:
+ assert(v1[i] == buf[16 + i]); // FIXME
ERROR: spaces required around that '%' (ctx:WxV)
#158: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:118:
+ asm(PLXVP(3, %2, 0, 0x1000, 0, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#163: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:123:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#166: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:126:
+ assert(v0[i] == buf[32 + i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#170: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:130:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#173: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:133:
+ assert(v1[i] == buf[48 + i]); // FIXME
ERROR: spaces required around that '%' (ctx:WxV)
#179: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:139:
+ asm(PLXVP(3, %2, 0x1000, 0x1000, 0, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#184: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:144:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#187: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:147:
+ assert(v0[i] == buf[i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#191: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:151:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#194: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:154:
+ assert(v1[i] == buf[16 + i]); // FIXME
ERROR: spaces required around that '%' (ctx:WxV)
#202: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:162:
+ asm(PLXVP(3, %2, 0x3ffff, 0xf000, 0, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#207: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:167:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#210: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:170:
+ assert(v0[i] == buf[32 + i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#214: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:174:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#217: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:177:
+ assert(v1[i] == buf[48 + i]); // FIXME
ERROR: line over 90 characters
#224: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:184:
+ ".long 62 << 26 | (" #_Sp ") << 22 | (" #_SX ") << 21 | (" #_RA ") << 16 | (" #_d1 ");"
ERROR: open brace '{' following function declarations go on the next line #226: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:186:
+void test_pstxvp(void) {
ERROR: do not use C99 // comments
#228: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:188:
+// FIXME: reorder values for readability
ERROR: do not use C99 // comments
#235: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:195:
+// FIXME: reorder values for readability
ERROR: spaces required around that '%' (ctx:WxV)
#250: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:210:
+ asm(PSTXVP(3, %0, 0, 0, 0, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#255: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:215:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#258: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:218:
+ assert(v0[i] == buf[i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#262: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:222:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#265: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:225:
+ assert(v1[i] == buf[16 + i]); // FIXME
ERROR: spaces required around that '%' (ctx:WxV)
#270: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:230:
+ asm(PSTXVP(3, %0, 0, 0x1000, 0, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#275: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:235:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#278: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:238:
+ assert(v0[i] == buf[32 + i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#282: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:242:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#285: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:245:
+ assert(v1[i] == buf[48 + i]); // FIXME
ERROR: spaces required around that '%' (ctx:WxV)
#291: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:251:
+ asm(PSTXVP(3, %0, 0x1000, 0x1000, 0, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#296: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:256:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#299: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:259:
+ assert(v0[i] == buf[i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#303: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:263:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#306: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:266:
+ assert(v1[i] == buf[16 + i]); // FIXME
WARNING: Block comments use a leading /* on a separate line
#313: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:273:
+/* TODO: we force 2 instead of 1 in opc2 currently to hack around
ERROR: line over 90 characters
#318: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:278:
+ ".long 6 << 26 | (" #_Sp ") << 22 | (" #_SX ") << 21 | (" #_RA ") << 16 | (" #_DQ ") << 4 | 1;"
ERROR: open brace '{' following function declarations go on the next line #320: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:280:
+void test_stxvp(void) {
ERROR: spaces required around that '%' (ctx:WxV)
#342: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:302:
+ asm(STXVP(2, %0, 0, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#348: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:308:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#351: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:311:
+ assert(buf[i] == v0[i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#355: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:315:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#358: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:318:
+ assert(buf[16 + i] == v1[i]); // FIXME
ERROR: spaces required around that '%' (ctx:WxV)
#363: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:323:
+ asm(STXVP(2, %0, 4, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#369: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:329:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#372: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:332:
+ assert(buf[32 + i] == v0[i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#376: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:336:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#379: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:339:
+ assert(buf[48 + i] == v1[i]); // FIXME
ERROR: line over 90 characters
#387: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:347:
+ ".long 6 << 26 | (" #_Tp ") << 22 | (" #_TX ") << 21 | (" #_RA ") << 16 | (" #_DQ ") << 4;"
ERROR: open brace '{' following function declarations go on the next line #389: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:349:
+void test_lxvp(void) {
ERROR: spaces required around that '%' (ctx:WxV)
#401: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:361:
+ asm(LXVP(2, %2, 0, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#407: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:367:
+ if (le) {
[...]
+ } else
[...]
ERROR: do not use C99 // comments
#411: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:371:
+ assert(v0[i] == buf[i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#415: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:375:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#418: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:378:
+ assert(v1[i] == buf[16+i]); // FIXME
ERROR: spaces required around that '+' (ctx:VxV)
#418: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:378:
+ assert(v1[i] == buf[16+i]); // FIXME
^
ERROR: spaces required around that '%' (ctx:WxV)
#423: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:383:
+ asm(LXVP(2, %2, 4, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#429: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:389:
+ if (le)
[...]
+ else
[...]
ERROR: spaces required around that '+' (ctx:VxV)
#430: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:390:
+ assert(v0[i] == buf[32+16+i]);
^ERROR: spaces required around that '+' (ctx:VxV)
#430: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:390:
+ assert(v0[i] == buf[32+16+i]);
^ERROR: do not use C99 // comments
#432: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:392:
+ assert(v0[i] == buf[32+i]); // FIXME
ERROR: spaces required around that '+' (ctx:VxV)
#432: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:392:
+ assert(v0[i] == buf[32+i]); // FIXME
^
ERROR: braces {} are necessary for all arms of this statement
#437: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:397:
+ if (le)
[...]
+ else
[...]
ERROR: spaces required around that '+' (ctx:VxV)
#438: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:398:
+ assert(v1[i] == buf[32+i]);
^ERROR: do not use C99 // comments
#440: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:400:
+ assert(v1[i] == buf[48+i]); // FIXME
ERROR: spaces required around that '+' (ctx:VxV)
#440: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:400:
+ assert(v1[i] == buf[48+i]); // FIXME
^
ERROR: line over 90 characters
#448: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:408:
+ ".long 31 << 26 | (" #_Tp ") << 22 | (" #_TX ") << 21 | (" #_RA ") << 16 | (" #_RB ") << 11 | 333 << 1;"
ERROR: open brace '{' following function declarations go on the next line #450: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:410:
+void test_lxvpx(void) {
ERROR: spaces required around that '%' (ctx:WxV)
#464: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:424:
+ asm(LXVPX(4, %2, %3, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#464: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:424:
+ asm(LXVPX(4, %2, %3, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#470: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:430:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#473: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:433:
+ assert(v0[i] == buf[i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#478: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:438:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#481: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:441:
+ assert(v1[i] == buf[16+i]); // FIXME
ERROR: spaces required around that '+' (ctx:VxV)
#481: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:441:
+ assert(v1[i] == buf[16+i]); // FIXME
^
ERROR: spaces required around that '%' (ctx:WxV)
#487: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:447:
+ asm(LXVPX(4, %2, %3, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#487: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:447:
+ asm(LXVPX(4, %2, %3, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#493: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:453:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#496: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:456:
+ assert(v0[i] == buf[32+i]); // FIXME
ERROR: spaces required around that '+' (ctx:VxV)
#496: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:456:
+ assert(v0[i] == buf[32+i]); // FIXME
^
ERROR: braces {} are necessary for all arms of this statement
#500: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:460:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#503: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:463:
+ assert(v1[i] == buf[48+i]); // FIXME
ERROR: spaces required around that '+' (ctx:VxV)
#503: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:463:
+ assert(v1[i] == buf[48+i]); // FIXME
^
ERROR: line over 90 characters
#511: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:471:
+ ".long 31 << 26 | (" #_Sp ") << 22 | (" #_SX ") << 21 | (" #_RA ") << 16 | (" #_RB ") << 11 | 461 << 1;"
ERROR: open brace '{' following function declarations go on the next line #513: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:473:
+void test_stxvpx(void) {
ERROR: do not use C99 // comments
#515: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:475:
+// FIXME: reorder for readability
ERROR: do not use C99 // comments
#522: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:482:
+// FIXME: ditto
ERROR: spaces required around that '%' (ctx:WxV)
#539: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:499:
+ asm(STXVPX(5, %0, %1, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#539: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:499:
+ asm(STXVPX(5, %0, %1, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#545: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:505:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#548: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:508:
+ assert(buf[i] == v0[i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#552: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:512:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#555: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:515:
+ assert(buf[16 + i] == v1[i]); // FIXME
ERROR: spaces required around that '%' (ctx:WxV)
#561: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:521:
+ asm(STXVPX(5, %0, %1, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#561: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:521:
+ asm(STXVPX(5, %0, %1, 0)
^
ERROR: braces {} are necessary for all arms of this statement
#567: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:527:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#570: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:530:
+ assert(buf[48 + i] == v1[i]); // FIXME
ERROR: braces {} are necessary for all arms of this statement
#574: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:534:
+ if (le)
[...]
+ else
[...]
ERROR: do not use C99 // comments
#577: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:537:
+ assert(buf[32 + i] == v0[i]); // FIXME
ERROR: Macros with multiple statements should be enclosed in a do - while loop #584: FILE: tests/tcg/ppc64le/instruction-tests/test-paired-load-store-vsx.c:544:
+#define do_test(testname) \
+ if (debug) \
+ fprintf(stderr, "-> running test: " #testname "\n"); \
+ test_##testname(); \
+
total: 112 errors, 3 warnings, 582 lines checked
Patch 5/7 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
6/7 Checking commit 2f4db24b2a05 (target/ppc: Add support for prefixed load/store FP instructions) 7/7 Checking commit 4afd9214dccd (tests/tcg: Add tests for prefixed load/store FP instructions)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#32:
new file mode 100644
ERROR: do not initialise globals to 0 or NULL
#46: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:10:
+bool debug = false;
ERROR: suspicious ; after while (0)
#54: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:18:
+ } while (0);
ERROR: open brace '{' following function declarations go on the next line #71: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:35:
+void test_plfs(void) {
ERROR: spaces required around that '%' (ctx:BxV)
#84: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:48:
+ PLFS(%0, %2, 0, 0, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#84: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:48:
+ PLFS(%0, %2, 0, 0, 0)
^
ERROR: open brace '{' following function declarations go on the next line #92: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:56:
+void test_pstfs(void) {
ERROR: spaces required around that '%' (ctx:BxV)
#106: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:70:
+ PSTFS(%1, %0, 0, 0, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#106: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:70:
+ PSTFS(%1, %0, 0, 0, 0)
^
ERROR: open brace '{' following function declarations go on the next line #114: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:78:
+void test_plfd(void) {
ERROR: spaces required around that '%' (ctx:BxV)
#127: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:91:
+ PLFD(%0, %2, 0, 0, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#127: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:91:
+ PLFD(%0, %2, 0, 0, 0)
^
ERROR: open brace '{' following function declarations go on the next line #135: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:99:
+void test_pstfd(void) {
ERROR: spaces required around that '%' (ctx:BxV)
#149: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:113:
+ PSTFD(%1, %0, 0, 0, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#149: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:113:
+ PSTFD(%1, %0, 0, 0, 0)
^
ERROR: open brace '{' following function declarations go on the next line #157: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:121:
+void test_plfs_offset(void) {
ERROR: spaces required around that '%' (ctx:BxV)
#166: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:130:
+ PLFS(%0, %2, 0, 0x1, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#166: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:130:
+ PLFS(%0, %2, 0, 0x1, 0)
^
ERROR: spaces required around that '%' (ctx:BxV)
#174: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:138:
+ PLFS(%0, %2, 0x1FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#174: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:138:
+ PLFS(%0, %2, 0x1FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:BxV)
#182: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:146:
+ PLFS(%0, %2, 0x3FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#182: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:146:
+ PLFS(%0, %2, 0x3FFFF, 0xFFFF, 0)
^
ERROR: open brace '{' following function declarations go on the next line #188: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:152:
+void test_pstfs_offset(void) {
ERROR: spaces required around that '%' (ctx:BxV)
#197: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:161:
+ PSTFS(%1, %0, 0x0, 0x1, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#197: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:161:
+ PSTFS(%1, %0, 0x0, 0x1, 0)
^
ERROR: spaces required around that '%' (ctx:BxV)
#205: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:169:
+ PSTFS(%1, %0, 0x1FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#205: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:169:
+ PSTFS(%1, %0, 0x1FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:BxV)
#213: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:177:
+ PSTFS(%1, %0, 0x3FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#213: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:177:
+ PSTFS(%1, %0, 0x3FFFF, 0xFFFF, 0)
^
ERROR: open brace '{' following function declarations go on the next line #219: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:183:
+void test_plfd_offset(void) {
ERROR: spaces required around that '%' (ctx:BxV)
#228: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:192:
+ PLFD(%0, %2, 0, 0x1, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#228: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:192:
+ PLFD(%0, %2, 0, 0x1, 0)
^
ERROR: spaces required around that '%' (ctx:BxV)
#236: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:200:
+ PLFD(%0, %2, 0x1FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#236: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:200:
+ PLFD(%0, %2, 0x1FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:BxV)
#244: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:208:
+ PLFD(%0, %2, 0x3FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#244: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:208:
+ PLFD(%0, %2, 0x3FFFF, 0xFFFF, 0)
^
ERROR: open brace '{' following function declarations go on the next line #250: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:214:
+void test_pstfd_offset(void) {
ERROR: spaces required around that '%' (ctx:BxV)
#259: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:223:
+ PSTFD(%1, %0, 0x0, 0x1, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#259: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:223:
+ PSTFD(%1, %0, 0x0, 0x1, 0)
^
ERROR: spaces required around that '%' (ctx:BxV)
#267: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:231:
+ PSTFD(%1, %0, 0x1FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#267: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:231:
+ PSTFD(%1, %0, 0x1FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:BxV)
#275: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:239:
+ PSTFD(%1, %0, 0x3FFFF, 0xFFFF, 0)
^
ERROR: spaces required around that '%' (ctx:WxV)
#275: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:239:
+ PSTFD(%1, %0, 0x3FFFF, 0xFFFF, 0)
^
ERROR: Macros with multiple statements should be enclosed in a do - while loop #281: FILE: tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store-fp.c:245:
+#define do_test(testname) \
+ if (debug) \
+ fprintf(stderr, "-> running test: " #testname "\n"); \
+ test_##testname(); \
+
total: 43 errors, 1 warnings, 283 lines checked
Patch 7/7 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]