Why bgez and bltz have the same function code in MIPS -


bgez , bltz have same function code in mips:000001, classified rt filed.however,bgtz , blez have different function code.why designer that?

there many opcodes can encode 6 bits. in cases more 1 instruction use same opcode, , additional bits in instruction word used determine instruction. or mips32™ architecture programmers volume i: introduction mips32™ architecture puts it:

opcode values not specify instruction instead specify instruction class. instructions within class further specified values in other fields.

they list instruction classes , other relevant fields in section a.2 instruction bit encoding tables.
you'll see e.g. opcode 000001 instruction class regimm, , instruction within class determined bits 20..16 according table (bits 20..19 on left, bits 18..16 on top):

       000      001     010      011    100   101  110  111 0  00  bltz    bgez    bltzl    bgezl    *     *    *    * 1  01  tgei    tgeiu   tlti     tltiu   teqi   *   tnei  * 2  10  bltzal  bgezal  bltzall  bgezall  *     *    *    * 3  11    *      *        *        *      *     *    *    * 

perhaps seems arbitrary bltz part of regimm group while bgtz isn't. can't why is. in end doesn't matter though. matters there clear rules how instructions should encoded.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -