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
14:27:30
froggey
I think I've found a minor bug in SICL: sicl-source-tracking:source-tracking-stream needs to inherit from fundamental-character-input-stream. without that Mezzano's read-char complains that it isn't a stream object
14:36:16
beach
There are tons of unresolved problems after all. I am sort of aware of some, but I need to focus on code generation now.
14:36:31
froggey
s-t-s currently doesn't inherit from stream or fundamental-stream at all, so I'm rejecting it on the basis that it isn't a stream at all. is that strange?
14:37:26
froggey
I'm just trying to run it under mezzano for my own amusement, nothing important. it has exposed a MOP bug already
14:39:53
Bike
i don't see any reason it shouldn't inherit from f undamental-character-input-stream, seeing as that's what it is
14:57:35
beach
Anyway, I already had a long and productive day of work, so I am planning to chill out a bit from now on.
14:57:40
beach
During bootstrapping, functions are now instances of SIMPLE-FUNCTION, and the static environment has a code object in it. The code object contains a vector of (unsigned-byte 8) for the x86 code.
14:57:53
beach
Next, I'll try to figure out how to handle the entry point. Recall that the entry point is an absolute address and its value depends on where the vector of code is placed on the heap, so I don't know its exact value until I create an isomorphic graph in the simulated heap in the host.
14:57:54
beach
Somehow, I then need to update the existing, already enclosed, functions, and I need to update the constants representing entry points (as inputs to ENCLOSE) in the code.