[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 07/35] Hexagon (target/hexagon) scalar core helpers
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v7 07/35] Hexagon (target/hexagon) scalar core helpers |
Date: |
Fri, 22 Jan 2021 22:44:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
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 <tsimpson@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);
---
- [PATCH v7 04/35] Hexagon (target/hexagon) scalar core definition, (continued)
- [PATCH v7 04/35] Hexagon (target/hexagon) scalar core definition, Taylor Simpson, 2021/01/19
- [PATCH v7 13/35] Hexagon (target/hexagon) instruction/packet decode, Taylor Simpson, 2021/01/19
- [PATCH v7 02/35] Hexagon (target/hexagon) README, Taylor Simpson, 2021/01/19
- [PATCH v7 03/35] Hexagon (include/elf.h) ELF machine definition, Taylor Simpson, 2021/01/19
- [PATCH v7 25/35] Hexagon (target/hexagon) instruction classes, Taylor Simpson, 2021/01/19
- [PATCH v7 06/35] Hexagon (target/hexagon) register names, Taylor Simpson, 2021/01/19
- [PATCH v7 21/35] Hexagon (target/hexagon) generator phase 3 - C preprocessor for decode tree, Taylor Simpson, 2021/01/19
- [PATCH v7 07/35] Hexagon (target/hexagon) scalar core helpers, Taylor Simpson, 2021/01/19
- [PATCH v7 10/35] Hexagon (target/hexagon) instruction and packet types, Taylor Simpson, 2021/01/19
- [PATCH v7 24/35] Hexagon (target/hexagon) macros, Taylor Simpson, 2021/01/19
- [PATCH v7 09/35] Hexagon (target/hexagon) architecture types, Taylor Simpson, 2021/01/19
- [PATCH v7 12/35] Hexagon (target/hexagon) instruction attributes, Taylor Simpson, 2021/01/19