jonathan@comp.vuw.ac.nz (Jonathan) (11/22/88)
Pyramid's machine architecture includes a variety of integer compare instructions for signed and unsigned compares: +-----------------------------------------------------------+ | Pyramid Compare insns | | | +-------------------+-------------------+-------------------+ | Operand | Signed | Unsigned | | size | mnemonic opcode | mnemonic opcode | +-------------------+----------+--------+----------+--------+ | word (32 bit) | CMPW | 60 | UCMPW | 65 | +-------------------+----------+--------+----------+--------+ | halfword (16 bit) | CMPH | 62 | ??? | +-------------------+----------+--------+----------+--------+ | byte (8 bit) | CMPB | 61 | UCMPB | 66 | +-------------------+----------+--------+----------+--------+ UCMPH (opcode 67) is conspicuous by its absence. Why isn't it there? Is it elsewhere? [[we don't actually have an up-to-date assembler manual; I do know the assembler barfs on the mnemonic ``ucmph'' on our 90x running OSx 4.0. ]] Any chance of getting it added before Pyramid implement their architecture in hardware rather than microcode :-) ? Not having a UCMPH causes the novice compiler writer (like me) much grief, especially when using a smart table-driven compiler like GNU CC. I know it's possible to kludge around this, but at the cost of less-than-optimal signed-halfword compares. Wasn't it Wirth who said that RISC should stand for Regular Instruction Set Computer :-) ? -- ----------------------------------------------------------------------------- sane mailers: jonathan@comp.vuw.ac.nz | Industrial democracy: UUCP path: ...!uunet!vuwcomp!jonathan | One factory, one vote!
csg@pyramid.pyramid.com (Carl S. Gutekunst) (11/27/88)
In article <14394@comp.vuw.ac.nz> jonathan@comp.vuw.ac.nz (Jonathan) writes: >Pyramid's machine architecture includes a variety of integer >compare instructions for signed and unsigned compares: > > [table deleted] > >UCMPH (opcode 67) is conspicuous by its absence. Speaking as a datacommie who knows zilch about architecture or compilers.... I'd say the other non-integer compares are conspicuous by their presense. Everything besides the int compare is unnecessary, to wit: - For variables in registers, you (the compiler writer) can make sure that the value is *always* an int. This costs you nothing. So all compares to non- floating values in registers always use cmpw and ucmpw. - If it's not in a register, you very likely have to move it into a register before you can compare to it. So you use the apropriate movzbw, cvtbw, or whatever. And now you're comparing ints again. >Is it elsewhere? [[we don't actually have an up-to-date assembler manual.... It's not in my assembler manual either. >Wasn't it Wirth who said that RISC should stand for Regular Instruction Set >Computer :-) ? Since the Pyramid 90x and 9000 CPUs are microcoded, they accumulated quite a lot of garbage that someone thought was a "pretty neat idea" at the time. :-) Seriously, I believe there was some turmoil on the part of the designers as to what to add and what to leave out; having microcode allowed the machine to be designed more quickly, but created the illusion that choices weren't critical. This is what makes architectures crufty and difficult to scale; backwards com- patability dictates that you drag along instructions that you don't use any more. I'd like to see some of these squeezed out in the new machines, but like I said, I do X.25, not CPUs.... <csg>