On 5/31/23 23:48, Wu, Fei wrote:
On 6/1/2023 9:08 AM, Richard Henderson wrote:
On 5/30/23 01:35, Fei Wu wrote:
+ qatomic_add(&tcg_ctx->prof.cpu_exec_time, profile_getclock() - ti);
You can't qatomic_add a 64-bit value on a 32-bit host.
Right, I only changed the counters to size_t, didn't fix time part. Is
it possible to support it with some kind of locks on 32-bit as a generic
fallback solution? After all, 32-bit host seems not popular, it might be
sacrifice performance a little bit.
We have
int64_t qatomic_read_i64(const int64_t *ptr);
uint64_t qatomic_read_u64(const uint64_t *ptr);
void qatomic_set_i64(int64_t *ptr, int64_t val);
void qatomic_set_u64(uint64_t *ptr, uint64_t val);
to support 32-bit hosts. You must also use
typedef int64_t aligned_int64_t __attribute__((aligned(8)));
typedef uint64_t aligned_uint64_t __attribute__((aligned(8)));
r~