Micro-optimize type tests using widetag on x86-64.
authorLutz Euler <lutz.euler@freenet.de>
Tue, 17 Apr 2012 13:20:05 +0000 (15:20 +0200)
committerLutz Euler <lutz.euler@freenet.de>
Tue, 17 Apr 2012 13:20:05 +0000 (15:20 +0200)
commit6e5c24e786277417fedfea9a6844092de11775df
tree235a812fe0bc021fd903af4554180ea1ee03debc
parenta8e49202d33fffbfe2de1990159d62be25794dfe
Micro-optimize type tests using widetag on x86-64.

Change %TEST-HEADERS not to load the widetag of the value to be tested
into AL if only a single comparison is needed on it, instead do the
comparison directly with the memory operand. This is smaller and needs
fewer execution ressources.

This is a port of what is done on x86 already, with two modifications:

 * Widetag ranges starting with the smallest widetag or ending with the
   largest widetag use the memory operand here but go through AL on x86.

 * x86 exploits the specially choosen widetag values of components of
   compound types (like BASE-STRING) to test for these types with only
   an additional "and" operation but still only a single comparison.
   This can't be done on x86-64 currently as under 64-bit wordsize the
   widetag values are different and don't have the necessary property
   (namely to differ in only a single bit).

Additionally, when AL needs to be loaded, use EAX instead so as not to
write a partial register (as recommended by the processors' optimization
guides). Same code size, potentially faster.

Silence a "deleting unreachable code" warning during build by removing
an IF and the corresponding unreachable expression.
src/compiler/x86-64/type-vops.lisp