instructions.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* Copyright (C) 2001, 2009, 2012, 2013 Free Software Foundation, Inc.
  2. *
  3. * This library is free software; you can redistribute it and/or
  4. * modify it under the terms of the GNU Lesser General Public License
  5. * as published by the Free Software Foundation; either version 3 of
  6. * the License, or (at your option) any later version.
  7. *
  8. * This library is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public
  14. * License along with this library; if not, write to the Free Software
  15. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. * 02110-1301 USA
  17. */
  18. #ifndef _SCM_INSTRUCTIONS_H_
  19. #define _SCM_INSTRUCTIONS_H_
  20. #include <libguile.h>
  21. #include <libguile/vm-operations.h>
  22. #ifdef BUILDING_LIBGUILE
  23. enum scm_opcode
  24. {
  25. #define ENUM(opcode, tag, name, meta) scm_op_##tag = opcode,
  26. FOR_EACH_VM_OPERATION(ENUM)
  27. #undef ENUM
  28. };
  29. #define SCM_PACK_OP_24(op,arg) (scm_op_##op | (arg) << 8)
  30. #define SCM_PACK_OP_8_8_8(op,a,b,c) SCM_PACK_OP_24 (op, (a) | ((b) << 8) | ((c) << 16))
  31. #define SCM_PACK_OP_8_16(op,a,b) SCM_PACK_OP_24 (op, (a) | (b) << 8)
  32. #define SCM_PACK_OP_16_8(op,a,b) SCM_PACK_OP_24 (op, (a) | (b) << 16)
  33. #define SCM_PACK_OP_12_12(op,a,b) SCM_PACK_OP_24 (op, (a) | (b) << 12)
  34. #define SCM_PACK_OP_ARG_8_24(a,b) ((a) | ((b) << 8))
  35. #define SCM_VM_NUM_INSTRUCTIONS (1<<8)
  36. #define SCM_VM_INSTRUCTION_MASK (SCM_VM_NUM_INSTRUCTIONS-1)
  37. #endif /* BUILDING_LIBGUILE */
  38. SCM_INTERNAL SCM scm_instruction_list (void);
  39. SCM_INTERNAL void scm_bootstrap_instructions (void);
  40. SCM_INTERNAL void scm_init_instructions (void);
  41. #endif /* _SCM_INSTRUCTIONS_H_ */
  42. /*
  43. Local Variables:
  44. c-file-style: "gnu"
  45. End:
  46. */