freenode/#sicl - IRC Chatlog
Search
7:37:30
beach
I think at some point I need to implement some arbitrary code into instruction descriptors of Cluster. The x86 has some legacy restrictions. For instance, the one I ran into this morning is that PUSH with encoding 50+rd in 64-bit mode, can only handle the first 8 registers.
7:38:50
beach
I think the only way to handle situations like this is to introduce a test function that will check the operands that are requested, and return a Boolean indicating whether the descriptor applies or not.
11:49:28
froggey
push (and pretty much all other instructions) support using a rex prefix to extend the register field. PUSH R10 => 41 (rex.b) 52 (50+rd)
11:49:44
froggey
but I think there are still a few odd cases you'll need to reject. iirc high byte registers (ah, ch, dh, bh) don't mix well with the extended registers, and I'm sure there are other examples
11:54:26
froggey
"REX.B either modifies the base in the ModR/M r/m field or SIB base field; or it modifies the opcode reg field used for accessing GPRs." from section 2.2.1.2 "More on REX Prefix Fields" in volume 2 (my copy is a little old, so section numbers might not match up exactly)
11:55:41
froggey
the +rd would be the opcode reg field in this case, it's scattered throughout chapter 2 and the first part of chapter 3 of volume 2
11:56:59
froggey
table 3-1 "Register Codes Associated with +rb, +rw, +rd, +ro" covers each encoding too
11:58:08
beach
I should still introduce that predicate, so that it can test for the GPR code and see whether the rex fag is required.
12:03:57
froggey
JB, JNAE, JC are all the same instruction, and their opposites are JNB, JAE, JNC, with all 3 of them having the same encoding
12:22:12
beach
With my dyslexia that seems to increase over time, I was just bitten by the lack of warning when a DEFMETHOD is given without a corresponding DEFGENERIC.
13:21:21
Bike
if i was really sophisticated i'd set something up to randomly generate lambda lists, but i'm not
13:22:59
Bike
it gets confusing with all those different functions that are the same except for pluralization