Liste des Groupes | Revenir à c arch |
BGB-Alt wrote:Yeah, there is likely no way to make this worthwhile...
>
FWIW:
This doesn't seem too far off from what would be involved with dynamic typing at the ISA level, but with many of same sorts of drawbacks...Say, for example, top 2 bits of a register:So, you either have 66-bit registers, or you have 62-bit FP numbers ?!?
00: Object Reference
Next 2 bits:
00: Pointer (with type-tag)
01: ?
1z: Bounded Array
01: Fixnum (route to ALU)
10: Flonum (route to FPU)
11: Other types
00: Smaller value types
Say: int/uint, short/ushort, ...
...
This solves nobody's problems; not even LISP.
It is likely that the pipeline would need to stall until results are available.One issue:Not good. But what if you don't know the tag until the register is delivered from a latent FU, do you stall DECODE, or do you launch and make the instruction
Decoding based on register tags would mean needing to know the register tag bits at the same time the instruction is being decoded. In this case, one is likely to need two clock-cycles to fully decode the opcode.
queue element have to deal with all outcomes.
These issues could be a deal-breaker for such a CPU.ID1: Unpack instruction to figure out register fields, etc.
ID2: Fetch registers, specialize variable instructions based on tag bits.For timing though, one ideally doesn't want to do anything with the register values until the EX stages (since ID2 might already be tied up with the comparably expensive register-forwarding logic), but asking for 3 cycles for decode is a bit much.Otherwise, if one does not know which FU should handle the operation until EX1, this has its own issues.Real-friggen-ely
Then you have a mess...Or, possible, the FU's decide whether to accept the operation:What if IMUL is performed in FMAC, IDIV in FDIV,... Int<->FP routing is
ALU: Accepts operation if both are fixnum, FPU if both are Flonum.
based on calculation capability {Even CDC 6600 performed int × in the FP × unit (not in Thornton's book, but via conversation with 6600 logic
designer at Asilomar some time ago. All they had to do to get FP × to
perform int × was disable 1 gate.......)
If you have dynamic types in hardware in this way, then effectively the typesystem mechanics switch from being a language issue to a hardware issue.But, a proper dynamic language allows mixing fixnum and flonum with the result being implicitly converted to flonum, but from the FPU's POV, this would effectively require two chained FADD operations (one for the Fixnum to Flonum conversion, one for the FADD itself).That is a LANGUAGE problem not an ISA problem. SNOBOL allowed one to add
a string to an integer and the string would be converted to int before.....
One either goes all in, or abandons the idea entirely.Many other cases could get hairy, but to have any real benefit, the CPU would need to be able to deal with them. In cases where the compiler deals with everything, the type-tags become mostly moot (or potentially detrimental).You are arguing that the added complexity would somehow pay for itself.
I can't see it paying for itself.
I am dealing with some code that has a bad habit of breaking if integer overflows don't happen in the expected ways (say, the ROTT engine is pretty bad about this one...).But, then, there is another issue:maybe
C code expects C type semantics to be respected, say:
Signed int overflow wraps at 32 bits (sign extending);Unsigned int overflow wraps at 32 bits (zero extending);maybe
C only requires at-least 64 bits.Variables may not hold values out-of-range for that type;LLVM does this GCC does not.The 'long long' and 'unsigned long long' types are exactly 64-bit;At least 64-bit not exactly.
Both options suck, granted....
...If one has tagged 64-bit registers, then fixnum might not hold the entire range of 'long long'. If one has 66 or 68 bit registers, then memory storage is a problem.Ya think ?
I was not trying to claim that this idea wouldn't suck.If one has untagged registers for cases where they are needed, one has not saved any encoding space.I give up--not worth trying to teach cosmologist why the color of the lipstick going on the pig is not the problem.....
Les messages affichés proviennent d'usenet.