/* ======================================== Some modifications are copyrighted under: Amlal El Mahrouss Original author: Apple Inc ======================================== */ #ifndef NECTAR_COMPILERKIT_DETAIL_POWER64_H #define NECTAR_COMPILERKIT_DETAIL_POWER64_H #include /// @note Based of: /// https://opensource.apple.com/source/cctools/cctools-750/as/ppc-opcode.h.auto.html #define kOpcodePPCCount (1073U) /* * These defines are use in the cpus field of the instructions. If the field * is zero it can execute on all cpus. The defines are or'ed together. This * information is used to set the cpusubtype in the resulting object file. */ #define CPU601 0x1 #define IMPL64 0x2 #define OPTIONAL 0x4 #define VMX 0x8 #define CPU970 0x10 /* added to OPTIONAL insts that the 970 has */ #define CPUMAHROUSS 0x12 /* optional mahrouss insts. */ enum OpcodeType { NONE, /* no operand */ JBSR, /* jbsr pseudo op */ PCREL, /* PC relative (branch offset) */ BADDR, /* Branch address (sign extended absolute address) */ D, /* 16 bit displacement */ DS, /* 14 bit displacement (double word) */ SI, /* signed 16 bit immediate */ UI, /* unsigned 16 bit immediate */ HI, /* high 16 bit immediate (with truncation) */ GREG, /* general register */ G0REG, /* general register r1-r31 or 0 */ FREG, /* float register */ VREG, /* vector register */ SGREG, /* segment register */ SPREG, /* special register (or 10 bit number, 5 bit halves reversed) */ BCND, /* branch condition opcode */ CRF, /* condition register field */ CRFONLY, /* condition register field only no expression allowed */ sh, /* 6 bit number (0 - 63) (sh field, split and reversed) */ mb, /* 6 bit number (0 - 63) (mb field, mb5 || mb0:4 reversed) */ NUM, /* number */ SNUM, /* signed number */ NUM0, /* number (where 1<