Message ID | 543D98F3.2030009@gmail.com |
---|---|
State | New |
Headers | show |
> On 10/15/2014 05:29 AM, Andreas Schwab wrote: > > Chen Gang <gang.chen.5i5j@gmail.com> writes: > > > >> && (((inst >> 6) & 0xf) == 0x8 > >> - || (inst >> 6) & 0xf) == 0x9)) > >> + || ((inst >> 6) & 0xf) == 0x9))) > > > > ((inst >> 6) & 0xe) == 8 > > > > Andreas. > > > > I guess, your fixing may like below, which will be a different logical > working flow. I think Andreas is telling you that... ((inst >> 6) & 0xf) == 0x8 || ((inst >> 6) & 0xf) == 0x9 ... is logically equivalent to ... ((inst >> 6) & 0xe) == 8 In other word, if it does not matter if bit 7 is set or not (the difference between 0x8 and 0x9) all you have to do is mask it. That way, you test both conditions with one comparison instead of 2.
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 627f31a..3112732 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -1402,8 +1402,8 @@ inst_saves_gr (unsigned long inst) too. */ if ((inst >> 26) == 0x19 || (inst >> 26) == 0x18 || ((inst >> 26) == 0x3 - && (((inst >> 6) & 0xf) == 0x8 - || (inst >> 6) & 0xf) == 0x9)) + && ((inst >> 6) & 0xf) == 0x8 + || ((inst >> 6) & 0xf) == 0x9)) return hppa_extract_5R_store (inst); return 0;