target/i386: generate simpler code for ROL/ROR with immediate count
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 May 2024 12:39:14 +0000 (14:39 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 May 2024 13:53:30 +0000 (15:53 +0200)
commitd0414d71f612651699de019b911a772b07d0ac4a
tree2e7e675e580ed7683d5cfc6f829da0d20bf1a294
parent01782d6b294f95bcde334386f0aaac593cd28c0d
target/i386: generate simpler code for ROL/ROR with immediate count

gen_rot_carry and gen_rot_overflow are meant to be called with count == NULL
if the count cannot be zero.  However this is not done in gen_ROL and gen_ROR,
and writing everywhere "can_be_zero ? count : NULL" is burdensome and less
readable.  Just pass can_be_zero as a separate argument.

gen_RCL and gen_RCR use a conditional branch to skip the computation
if count is zero, so they can pass false unconditionally to gen_rot_overflow.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240522123914.608516-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/emit.c.inc