qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] target/riscv: fix the trap generation for conditional st


From: Richard Henderson
Subject: Re: [PATCH 3/3] target/riscv: fix the trap generation for conditional store
Date: Wed, 11 Dec 2024 15:43:02 -0600
User-agent: Mozilla Thunderbird

On 12/11/24 15:19, Frederic Konrad wrote:
+    /*
+     * A misaligned store trap should be triggered even if the store should
+     * fail due to the reservation.
+     */
+    tcg_gen_andi_tl(tmp, src1, ~((uint64_t)0) << memop_alignment_bits(mop));

The constant is incorrect for testing the low bits.

+    tcg_gen_brcond_tl(TCG_COND_EQ, tmp, src1, l3);

Best to make the fallthrough path be the common case, as we will optimize across the extended basic block.

Use test-style comparison:

    tcg_gen_brcondi_tl(TCG_COND_TSTNE, src1, memop_size(mop) - 1, l_misalign);



r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]