[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: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] optimize: track nonzero bits of registers |
Date: |
Wed, 16 Jan 2013 11:47:14 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
Il 16/01/2013 10:09, Jay Foad ha scritto:
>> @@ -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"?
It is filled in by patch 3/3.
Paolo