On 1/22/21 9:30 PM, Philippe Mathieu-Daudé wrote: > Hi Taylor, > > On 1/20/21 4:28 AM, Taylor Simpson wrote: >> The majority of helpers are generated. Define the helper functions needed >> then include the generated file >> >> Signed-off-by: Taylor Simpson <tsimp...@quicinc.com> >> --- >> target/hexagon/helper.h | 85 ++++ >> target/hexagon/op_helper.c | 1066 >> ++++++++++++++++++++++++++++++++++++++++++++ >> 2 files changed, 1151 insertions(+) >> create mode 100644 target/hexagon/helper.h >> create mode 100644 target/hexagon/op_helper.c > ...
> I'm getting: > > In file included from ../target/hexagon/op_helper.c:23: > ../target/hexagon/op_helper.c: In function ‘log_reg_write_pair’: > ../target/hexagon/op_helper.c:74:19: error: format ‘%ld’ expects > argument of type ‘long int’, but argument 4 has type ‘int64_t’ {aka > ‘long long int’} [-Werror=format=] > 74 | HEX_DEBUG_LOG("log_reg_write_pair[%d:%d] = %ld\n", rnum + 1, > rnum, val); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~ > | > | > | > int64_t {aka long long int} > ../target/hexagon/internal.h:28:22: note: in definition of macro > ‘HEX_DEBUG_LOG’ > 28 | qemu_log(__VA_ARGS__); \ > | ^~~~~~~~~~~ > ../target/hexagon/op_helper.c:74:50: note: format string is defined here > 74 | HEX_DEBUG_LOG("log_reg_write_pair[%d:%d] = %ld\n", rnum + 1, > rnum, val); > | ~~^ > | | > | long int > | %lld > In file included from ../target/hexagon/op_helper.c:23: > ../target/hexagon/op_helper.c: In function ‘log_store64’: > ../target/hexagon/op_helper.c:109:19: error: format ‘%ld’ expects > argument of type ‘long int’, but argument 4 has type ‘int64_t’ {aka > ‘long long int’} [-Werror=format=] > 109 | HEX_DEBUG_LOG("log_store%d(0x" TARGET_FMT_lx ", %ld [0x%lx])\n", > | ^~~~~~~~~~~~~~~~ > 110 | width, addr, val, val); > | ~~~ > | | > | int64_t {aka long long int} > ../target/hexagon/internal.h:28:22: note: in definition of macro > ‘HEX_DEBUG_LOG’ > 28 | qemu_log(__VA_ARGS__); \ > | ^~~~~~~~~~~ > ../target/hexagon/op_helper.c:109:19: error: format ‘%lx’ expects > argument of type ‘long unsigned int’, but argument 5 has type ‘int64_t’ > {aka ‘long long int’} [-Werror=format=] > 109 | HEX_DEBUG_LOG("log_store%d(0x" TARGET_FMT_lx ", %ld [0x%lx])\n", > | ^~~~~~~~~~~~~~~~ > 110 | width, addr, val, val); > | ~~~ > | | > | int64_t {aka long long int} > ../target/hexagon/internal.h:28:22: note: in definition of macro > ‘HEX_DEBUG_LOG’ > 28 | qemu_log(__VA_ARGS__); \ > | ^~~~~~~~~~~ > ../target/hexagon/op_helper.c: In function ‘print_store’: > ../target/hexagon/op_helper.c:201:27: error: format ‘%lu’ expects > argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ > {aka ‘long long unsigned int’} [-Werror=format=] > 201 | HEX_DEBUG_LOG("\tmemd[0x" TARGET_FMT_lx "] = %lu > (0x%016lx)\n", > | ^~~~~~~~~~~ > 202 | env->mem_log_stores[slot].va, > 203 | env->mem_log_stores[slot].data64, > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > | | > | uint64_t {aka > long long unsigned int} > ../target/hexagon/internal.h:28:22: note: in definition of macro > ‘HEX_DEBUG_LOG’ > 28 | qemu_log(__VA_ARGS__); \ > | ^~~~~~~~~~~ > ../target/hexagon/op_helper.c:201:27: error: format ‘%lx’ expects > argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ > {aka ‘long long unsigned int’} [-Werror=format=] > 201 | HEX_DEBUG_LOG("\tmemd[0x" TARGET_FMT_lx "] = %lu > (0x%016lx)\n", > | ^~~~~~~~~~~ > ...... > 204 | env->mem_log_stores[slot].data64); > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > | | > | uint64_t {aka > long long unsigned int} > ../target/hexagon/internal.h:28:22: note: in definition of macro > ‘HEX_DEBUG_LOG’ > 28 | qemu_log(__VA_ARGS__); \ > | ^~~~~~~~~~~ > Fixed with: -- >8 -- diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 5186dd142d5..9153d7a28ef 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -71,7 +71,7 @@ static __attribute__((unused)) inline void log_reg_write_pair(CPUHexagonState *env, int rnum, int64_t val, uint32_t slot) { - HEX_DEBUG_LOG("log_reg_write_pair[%d:%d] = %ld\n", rnum + 1, rnum, val); + HEX_DEBUG_LOG("log_reg_write_pair[%d:%d] = %"PRId64"\n", rnum + 1, rnum, val); log_reg_write(env, rnum, val & 0xFFFFFFFF, slot); log_reg_write(env, rnum + 1, (val >> 32) & 0xFFFFFFFF, slot); } @@ -106,7 +106,7 @@ static inline void log_store32(CPUHexagonState *env, target_ulong addr, static inline void log_store64(CPUHexagonState *env, target_ulong addr, int64_t val, int width, int slot) { - HEX_DEBUG_LOG("log_store%d(0x" TARGET_FMT_lx ", %ld [0x%lx])\n", + HEX_DEBUG_LOG("log_store%d(0x" TARGET_FMT_lx ", %"PRId64" [0x%"PRIx64"])\n", width, addr, val, val); env->mem_log_stores[slot].va = addr; env->mem_log_stores[slot].width = width; @@ -198,7 +198,7 @@ static void print_store(CPUHexagonState *env, int slot) HEX_DEBUG_LOG("\tmemw[0x" TARGET_FMT_lx "] = %d (0x%08x)\n", env->mem_log_stores[slot].va, data, data); } else if (width == 8) { - HEX_DEBUG_LOG("\tmemd[0x" TARGET_FMT_lx "] = %lu (0x%016lx)\n", + HEX_DEBUG_LOG("\tmemd[0x" TARGET_FMT_lx "] = %"PRIu64" (0x%016"PRIx64")\n", env->mem_log_stores[slot].va, env->mem_log_stores[slot].data64, env->mem_log_stores[slot].data64); ---