On 7/4/23 17:44, Peter Maydell wrote:
IIUC tcg_enabled(), this guard shouldn't be necessary; if CONFIG_TCG
is not defined, tcg_enabled() evaluates to 0, and the compiler should
elide the whole block.

IME it's a bit optimistic to assume that the compiler will always
do that, especially with no optimisation enabled.

There's plenty of other places that we do.
The compiler is usually pretty good with "if (0)".

My question is if

if (arm_feature(env, ARM_FEATURE_M) && tcg_enabled()) {

needs to be written

    if (tcg_enabled()) {
        if (arm_feature(..., M) {
           ...
        }
    }


r~

Reply via email to