arm-asm.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*************************************************************/
  2. /*
  3. * ARM dummy assembler for TCC
  4. *
  5. */
  6. #ifdef TARGET_DEFS_ONLY
  7. #define CONFIG_TCC_ASM
  8. #define NB_ASM_REGS 16
  9. ST_FUNC void g(int c);
  10. ST_FUNC void gen_le16(int c);
  11. ST_FUNC void gen_le32(int c);
  12. /*************************************************************/
  13. #else
  14. /*************************************************************/
  15. #include "tcc.h"
  16. static void asm_error(void)
  17. {
  18. tcc_error("ARM asm not implemented.");
  19. }
  20. /* XXX: make it faster ? */
  21. ST_FUNC void g(int c)
  22. {
  23. int ind1;
  24. if (nocode_wanted)
  25. return;
  26. ind1 = ind + 1;
  27. if (ind1 > cur_text_section->data_allocated)
  28. section_realloc(cur_text_section, ind1);
  29. cur_text_section->data[ind] = c;
  30. ind = ind1;
  31. }
  32. ST_FUNC void gen_le16 (int i)
  33. {
  34. g(i);
  35. g(i>>8);
  36. }
  37. ST_FUNC void gen_le32 (int i)
  38. {
  39. gen_le16(i);
  40. gen_le16(i>>16);
  41. }
  42. ST_FUNC void gen_expr32(ExprValue *pe)
  43. {
  44. gen_le32(pe->v);
  45. }
  46. ST_FUNC void asm_opcode(TCCState *s1, int opcode)
  47. {
  48. asm_error();
  49. }
  50. ST_FUNC void subst_asm_operand(CString *add_str, SValue *sv, int modifier)
  51. {
  52. asm_error();
  53. }
  54. /* generate prolog and epilog code for asm statement */
  55. ST_FUNC void asm_gen_code(ASMOperand *operands, int nb_operands,
  56. int nb_outputs, int is_output,
  57. uint8_t *clobber_regs,
  58. int out_reg)
  59. {
  60. }
  61. ST_FUNC void asm_compute_constraints(ASMOperand *operands,
  62. int nb_operands, int nb_outputs,
  63. const uint8_t *clobber_regs,
  64. int *pout_reg)
  65. {
  66. }
  67. ST_FUNC void asm_clobber(uint8_t *clobber_regs, const char *str)
  68. {
  69. asm_error();
  70. }
  71. ST_FUNC int asm_parse_regvar (int t)
  72. {
  73. asm_error();
  74. return -1;
  75. }
  76. /*************************************************************/
  77. #endif /* ndef TARGET_DEFS_ONLY */