On 13.04.19 01:14, Richard Henderson wrote:
> On 4/11/19 12:08 AM, David Hildenbrand wrote:
>> +                         es | logical ? 0 : MO_SIGN);
> 
> Incorrect operator precedence.  You need:
> 
>   es | (logical ? 0 : MO_SIGN)
> 
> or
> 
>   logical ? es : es | MO_SIGN
> 
> And perhaps cse this expression into a temporary
> and not replicate it between the two reads.
> 
> Otherwise,
> Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
> 
> 
> r~
> 

Thanks, good catch! I'll do it like this

+static DisasJumpType op_vec(DisasContext *s, DisasOps *o)
+{
+    uint8_t es = get_field(s->fields, m3);
+    const uint8_t enr = NUM_VEC_ELEMENTS(es) / 2 - 1;
+
+    if (es > ES_64) {
+        gen_program_exception(s, PGM_SPECIFICATION);
+        return DISAS_NORETURN;
+    }
+    if (s->fields->op2 == 0xdb) {
+        es |= MO_SIGN;
+    }
+
+    o->in1 = tcg_temp_new_i64();
+    o->in2 = tcg_temp_new_i64();
+    read_vec_element_i64(o->in1, get_field(s->fields, v1), enr, es);
+    read_vec_element_i64(o->in2, get_field(s->fields, v2), enr, es);
+    return DISAS_NEXT;
+}


-- 

Thanks,

David / dhildenb

Reply via email to