[GOLD] PowerPC64 toc code optimization
Doug Kwan (關振德)
dougkwan@google.com
Thu Dec 6 18:35:00 GMT 2012
More information about the Binutils mailing list
Thu Dec 6 18:35:00 GMT 2012
- Previous message (by thread): [GOLD] PowerPC64 toc code optimization
- Next message (by thread): [GOLD] PowerPC64 toc code optimization
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Dec 6, 2012 at 5:20 AM, Alan Modra <amodra@gmail.com> wrote: > +static bool > +ok_lo_toc_insn(uint32_t insn) > +{ > + return ((insn & (0x3f << 26)) == 14u << 26 /* addi */ > + || (insn & (0x3f << 26)) == 32u << 26 /* lwz */ > + || (insn & (0x3f << 26)) == 34u << 26 /* lbz */ > + || (insn & (0x3f << 26)) == 36u << 26 /* stw */ > + || (insn & (0x3f << 26)) == 38u << 26 /* stb */ > + || (insn & (0x3f << 26)) == 40u << 26 /* lhz */ > + || (insn & (0x3f << 26)) == 42u << 26 /* lha */ > + || (insn & (0x3f << 26)) == 44u << 26 /* sth */ > + || (insn & (0x3f << 26)) == 46u << 26 /* lmw */ > + || (insn & (0x3f << 26)) == 47u << 26 /* stmw */ > + || (insn & (0x3f << 26)) == 48u << 26 /* lfs */ > + || (insn & (0x3f << 26)) == 50u << 26 /* lfd */ > + || (insn & (0x3f << 26)) == 52u << 26 /* stfs */ > + || (insn & (0x3f << 26)) == 54u << 26 /* stfd */ > + || ((insn & (0x3f << 26)) == 58u << 26 /* lwa,ld,lmd */ > + && (insn & 3) != 1) > + || ((insn & (0x3f << 26)) == 62u << 26 /* std, stmd */ > + && ((insn & 3) == 0 || (insn & 3) == 3)) > + || (insn & (0x3f << 26)) == 12u << 26 /* addic */); > +} > + > // Return the value to use for a branch relocation. > The pattern "(insn & (0x3f << 26)) == XXX << 26" repeats so many times. Why not define a predicate? It would be difficult to spot a typo if there was one. -Doug
- Previous message (by thread): [GOLD] PowerPC64 toc code optimization
- Next message (by thread): [GOLD] PowerPC64 toc code optimization
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list