qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/3] optimize: track nonzero bits of registers


From: Jay Foad
Subject: Re: [Qemu-devel] [PATCH 2/3] optimize: track nonzero bits of registers
Date: Wed, 16 Jan 2013 09:09:03 +0000

> @@ -621,6 +627,87 @@ static TCGArg *tcg_constant_folding(TCGContext *s,
> uint16_t *tcg_opc_ptr,
>              break;
>          }
>
> +        /* Simplify using known-zero bits */
> +        mask = -1;
> +        switch (op) {
> +        CASE_OP_32_64(ext8s):
> +            if ((temps[args[1]].mask & 0x80) != 0) {
> +                break;
> +            }
> +        CASE_OP_32_64(ext8u):
> +            mask = 0xff;
> +            goto and_const;
> +        CASE_OP_32_64(ext16s):
> +            if ((temps[args[1]].mask & 0x8000) != 0) {
> +                break;
> +            }
> +        CASE_OP_32_64(ext16u):
> +            mask = 0xffff;
> +            goto and_const;
> +        case INDEX_op_ext32s_i64:
> +            if ((temps[args[1]].mask & 0x80000000) != 0) {
> +                break;
> +            }
> +        case INDEX_op_ext32u_i64:
> +            mask = 0xffffffffU;
> +            goto and_const;
> +
> +        CASE_OP_32_64(and):
> +            mask = temps[args[2]].mask;
> +            if (temps[args[2]].state == TCG_TEMP_CONST) {
> +        and_const:
> +                ;
> +            }

What's the purpose of this "if"?

Jay.



reply via email to

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