opcode.h 598 B

1234567891011121314151617181920212223
  1. typedef struct
  2. {
  3. } opcode_info;
  4. //R I S B U J
  5. #define OP(inst) ((inst >> 0) & 0x00007F)
  6. //R I U J
  7. #define RD(inst) ((inst >> 7) & 0x00001F)
  8. // R I S B
  9. #define RS1(inst) ((inst >> 15) & 0x00001F)
  10. // R S B
  11. #define RS2(inst) ((inst >> 20) & 0x00001F)
  12. // R I S B
  13. #define FN3(inst) ((inst >> 12) & 0x000007)
  14. // R
  15. #define FN7(inst) ((inst >> 25) & 0x00007F)
  16. // I
  17. #define IIM(inst) ((inst >> 20) & 0x000FFF)
  18. // S
  19. #define SI(inst) (((inst >> 7) & 0x00001F)|((inst >> 20) & 0x00000000))
  20. // B
  21. #define SI2(inst) ((inst >> 25) & 0x00001F)
  22. #define UIM(inst) ((inst >> 12) & 0x0FFFFF)