XMLWordPrintable

    • Icon: Freeze Acceptance Criteria Freeze Acceptance Criteria
    • Resolution: Done
    • Icon: Medium Medium
    • None
    • 0

      Enough opcode encoding to support GCC.

      Opcode encoding refers to the method by which instructions are represented in machine code. An opcode (operation code) is a unique number that corresponds to a particular operation or instruction in a CPU's instruction set architecture (ISA).

      To support a new ISA with GCC, you need to ensure the opcode encoding is well defined and comprehensive.

      This involves:

      • Defining Opcodes: You need to define unique opcodes for all the instructions that the GCC can emit. This includes basic arithmetic and logic operations, control flow operations (like jumps and branches), memory access instructions, and other more specialized instructions.
      • Operand Encoding: Instructions often need operands, which are the inputs to the operations. You need to define how these operands are encoded. For example, you may need to decide how to encode register numbers, immediate values, or memory addresses.
      • Instruction Format: You need to decide on the format of your instructions. This includes the order of opcode and operands, and whether you have fixed-length or variable-length instructions.
      • Special Instructions: GCC may require support for special instructions or conventions. For example, you may need to support function calls and returns, which involve a stack; you might need specific instructions for system calls; you might need instructions or conventions for handling exceptions or interrupts.
      • Binary Encoding: You need to decide on the binary representation of your instructions. This is how the instructions will be represented in machine code.

      Once you have defined the opcode encoding in this way, you should be able to implement a back-end for the GCC that translates GCC's intermediate representation into your machine code. This involves mapping high-level constructs and operations onto your set of instructions, and using your opcode encoding to produce the actual binary code.

            Unassigned Unassigned
            rsene Rafael Sene
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: