tm-hp9k320.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. /* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version.
  2. Copyright (C) 1987, 1988 Free Software Foundation, Inc.
  3. This file is part of GNU CC.
  4. GNU CC is distributed in the hope that it will be useful,
  5. but WITHOUT ANY WARRANTY. No author or distributor
  6. accepts responsibility to anyone for the consequences of using it
  7. or for whether it serves any particular purpose or works at all,
  8. unless he says so in writing. Refer to the GNU CC General Public
  9. License for full details.
  10. Everyone is granted permission to copy, modify and redistribute
  11. GNU CC, but only under the conditions described in the
  12. GNU CC General Public License. A copy of this license is
  13. supposed to have been given to you along with GNU CC so you
  14. can know your rights and responsibilities. It should be in a
  15. file named COPYING. Among other things, the copyright notice
  16. and this notice must be preserved on all copies. */
  17. /* Define USE_GAS if GCC is supposed to work with the GNU assembler,
  18. GNU linker and GNU debugger using DBX debugging information.
  19. (In other words, much of HPUX has been cast aside.)
  20. Undefine USE_GAS if you want GCC to feed the HP assembler. */
  21. /* #define USE_GAS */ /* Use tm-hpgnu.h if you want this. */
  22. /* Control assembler-syntax conditionals in m68k.md. */
  23. #ifndef USE_GAS
  24. #define MOTOROLA
  25. #define SGS
  26. #define HPUX_ASM
  27. #endif
  28. #include "tm-m68k.h"
  29. /* See tm-m68k.h. 7 means 68020 with 68881. */
  30. #define TARGET_DEFAULT 7
  31. /* Names to predefine in the preprocessor for this target machine. */
  32. #ifdef HPUX_ASM
  33. /* This is needed because some programs, particularly GDB, need to
  34. know which assembler is being used so that the correct `asm'
  35. instructions can be used. */
  36. #define CPP_PREDEFINES "-Dhp9000s200 -Dhp9000s300 -DPWB -Dmc68k -Dmc68000 -Dhpux -Dunix -D__HPUX_ASM__"
  37. #else
  38. #define CPP_PREDEFINES "-Dhp9000s200 -Dhp9000s300 -DPWB -Dmc68k -Dmc68000 -Dhpux -Dunix"
  39. #endif
  40. /* Generate calls to memcpy, memcmp and memset. */
  41. #define TARGET_MEM_FUNCTIONS
  42. /* Function calls don't save any fp registers on hpux. */
  43. #undef CALL_USED_REGISTERS
  44. #define CALL_USED_REGISTERS \
  45. {1, 1, 0, 0, 0, 0, 0, 0, \
  46. 1, 1, 0, 0, 0, 0, 0, 1, \
  47. 1, 1, 1, 1, 1, 1, 1, 1}
  48. #ifdef HPUX_ASM
  49. /* Override parts of tm-m68k.h to fit the HPUX assembler. */
  50. #undef TARGET_VERSION
  51. #undef REGISTER_NAMES
  52. #undef FUNCTION_PROLOGUE
  53. #undef FUNCTION_EPILOGUE
  54. #undef ASM_FILE_START
  55. #undef ASM_APP_ON
  56. #undef ASM_APP_OFF
  57. #undef TEXT_SECTION_ASM_OP
  58. #undef DATA_SECTION_ASM_OP
  59. #undef ASM_OUTPUT_DOUBLE
  60. #undef ASM_OUTPUT_FLOAT
  61. #undef ASM_OUTPUT_INT
  62. #undef ASM_OUTPUT_SHORT
  63. #undef ASM_OUTPUT_CHAR
  64. #undef ASM_OUTPUT_BYTE
  65. #undef ASM_OUTPUT_ADDR_VEC_ELT
  66. #undef ASM_OUTPUT_ADDR_DIFF_ELT
  67. #undef ASM_OUTPUT_ALIGN
  68. #undef ASM_OUTPUT_SKIP
  69. #undef ASM_OUTPUT_COMMON
  70. #undef ASM_OUTPUT_LOCAL
  71. #undef ASM_FORMAT_PRIVATE_NAME
  72. #undef PRINT_OPERAND
  73. #undef PRINT_OPERAND_ADDRESS
  74. #undef FUNCTION_PROFILER
  75. #undef ASM_GLOBALIZE_LABEL
  76. #undef ASM_OUTPUT_INTERNAL_LABEL
  77. #define TARGET_VERSION printf (" (68k, SGS/hpux syntax)");
  78. #define NO_DBX_FORMAT
  79. #define ASM_SPEC "%{m68000:+X}"
  80. #define REGISTER_NAMES \
  81. {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
  82. "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp", \
  83. "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7"}
  84. #define FUNCTION_PROLOGUE(FILE, SIZE) \
  85. { register int regno; \
  86. register int mask = 0; \
  87. static char *reg_names[] = REGISTER_NAMES; \
  88. extern char call_used_regs[]; \
  89. int fsize = (SIZE); \
  90. if (frame_pointer_needed) \
  91. { if (TARGET_68020 || fsize < 0x8000) \
  92. fprintf (FILE, "\tlink.w %%a6,&%d\n", -fsize); \
  93. else \
  94. fprintf (FILE, "\tlink.w %%a6,&0\n\tsub.l &%d,%%sp\n", fsize); } \
  95. for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++) \
  96. if (regs_ever_live[regno] && ! call_used_regs[regno]) \
  97. mask |= 1 << (regno - 16); \
  98. if (mask != 0) \
  99. fprintf (FILE, "\tfmovem &0x%x,-(%%sp)\n", mask & 0xff); \
  100. mask = 0; \
  101. for (regno = 0; regno < 16; regno++) \
  102. if (regs_ever_live[regno] && ! call_used_regs[regno]) \
  103. mask |= 1 << (15 - regno); \
  104. if (frame_pointer_needed) \
  105. mask &= ~ (1 << (15-FRAME_POINTER_REGNUM)); \
  106. if (exact_log2 (mask) >= 0) \
  107. fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[15 - exact_log2 (mask)]); \
  108. else if (mask) fprintf (FILE, "\tmovm.l &0x%x,-(%%sp)\n", mask); }
  109. #define FUNCTION_PROFILER(FILE, LABEL_NO) \
  110. fprintf (FILE, "\tmov.l &LP%d,%%d0\n\tjsr mcount\n", (LABEL_NO));
  111. #define FUNCTION_EPILOGUE(FILE, SIZE) \
  112. { register int regno; \
  113. register int mask, fmask; \
  114. register int nregs; \
  115. int offset, foffset; \
  116. extern char call_used_regs[]; \
  117. static char *reg_names[] = REGISTER_NAMES; \
  118. extern int current_function_pops_args; \
  119. extern int current_function_args_size; \
  120. int fsize = (SIZE); \
  121. int big = 0; \
  122. nregs = 0; fmask = 0; \
  123. for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++) \
  124. if (regs_ever_live[regno] && ! call_used_regs[regno]) \
  125. { nregs++; fmask |= 1 << (23 - regno); } \
  126. foffset = nregs * 12; \
  127. nregs = 0; mask = 0; \
  128. if (frame_pointer_needed) regs_ever_live[FRAME_POINTER_REGNUM] = 0; \
  129. for (regno = 0; regno < 16; regno++) \
  130. if (regs_ever_live[regno] && ! call_used_regs[regno]) \
  131. { nregs++; mask |= 1 << regno; } \
  132. offset = foffset + nregs * 4; \
  133. if (offset + fsize >= 0x8000 && frame_pointer_needed) \
  134. { fprintf (FILE, "\tmov.l &%d,%%a0\n", -fsize); \
  135. fsize = 0, big = 1; } \
  136. if (exact_log2 (mask) >= 0) { \
  137. if (big) \
  138. fprintf (FILE, "\tmov.l -%d(%%a6,%%a0.l),%s\n", \
  139. offset + fsize, reg_names[exact_log2 (mask)]); \
  140. else if (! frame_pointer_needed) \
  141. fprintf (FILE, "\tmov.l (%%sp)+,%s\n", \
  142. reg_names[exact_log2 (mask)]); \
  143. else \
  144. fprintf (FILE, "\tmov.l -%d(%%a6),%s\n", \
  145. offset + fsize, reg_names[exact_log2 (mask)]); } \
  146. else if (mask) { \
  147. if (big) \
  148. fprintf (FILE, "\tmovm.l -%d(%%a6,%%a0.l),&0x%x\n", \
  149. offset + fsize, mask); \
  150. else if (! frame_pointer_needed) \
  151. fprintf (FILE, "\tmovm.l (%%sp)+,&0x%x\n", mask); \
  152. else \
  153. fprintf (FILE, "\tmovm.l -%d(%%a6),&0x%x\n", \
  154. offset + fsize, mask); } \
  155. if (fmask) { \
  156. if (big) \
  157. fprintf (FILE, "\tfmovem -%d(%%a6,%%a0.l),&0x%x\n", \
  158. foffset + fsize, fmask); \
  159. else if (! frame_pointer_needed) \
  160. fprintf (FILE, "\tfmovem (%%sp)+,&0x%x\n", fmask); \
  161. else \
  162. fprintf (FILE, "\tfmovem -%d(%%a6),&0x%x\n", \
  163. foffset + fsize, fmask); } \
  164. if (frame_pointer_needed) \
  165. fprintf (FILE, "\tunlk %%a6\n"); \
  166. if (current_function_pops_args && current_function_args_size) \
  167. fprintf (FILE, "\trtd &%d\n", current_function_args_size); \
  168. else fprintf (FILE, "\trts\n"); }
  169. #define ASM_FILE_START ""
  170. #define ASM_APP_ON ""
  171. #define ASM_APP_OFF ""
  172. #define TEXT_SECTION_ASM_OP "\ttext"
  173. #define DATA_SECTION_ASM_OP "\tdata"
  174. #define ASCII_DATA_ASM_OP "\tbyte"
  175. /* This says how to output an assembler line
  176. to define a global common symbol. */
  177. #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE) \
  178. ( fputs ("\tcomm ", (FILE)), \
  179. assemble_name ((FILE), (NAME)), \
  180. fprintf ((FILE), ",%d\n", (SIZE)))
  181. /* This says how to output an assembler line
  182. to define a local common symbol. */
  183. #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE) \
  184. ( fputs ("\tlcomm ", (FILE)), \
  185. assemble_name ((FILE), (NAME)), \
  186. fprintf ((FILE), ",%d,2\n", (SIZE)))
  187. /* Store in OUTPUT a string (made with alloca) containing
  188. an assembler-name for a local static variable named NAME.
  189. LABELNO is an integer which is different for each call. */
  190. #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
  191. ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
  192. sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
  193. /* This is how to output a command to make the user-level label named NAME
  194. defined for reference from other files. */
  195. #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
  196. do { fputs ("\tglobal ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
  197. #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
  198. do{ if (PREFIX[0] == 'L' && PREFIX[1] == 'I') \
  199. fprintf(FILE, "\tset %s%d,.+2\n", PREFIX, NUM); \
  200. else \
  201. fprintf (FILE, "%s%d:\n", PREFIX, NUM); \
  202. } while(0)
  203. #if 0
  204. /* Are these definitions necessary? */
  205. #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
  206. do { union { double d; long l[2]; } tem; \
  207. tem.d = (VALUE); \
  208. fprintf(FILE, "\tlong 0x%x,0x%x\n", tem.l[0], tem.l[1]); \
  209. } while (0)
  210. #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
  211. do { union { float f; long l;} tem; \
  212. tem.f = (VALUE); \
  213. fprintf (FILE, "\tlong 0x%x\n", tem.l); \
  214. } while (0)
  215. #endif
  216. #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
  217. fprintf (FILE, "\tdouble 0f%.20g\n", (VALUE))
  218. #define ASM_OUTPUT_FLOAT(FILE, VALUE) \
  219. fprintf (FILE, "\tfloat 0f%.9g\n", (VALUE))
  220. /* This is how to output an assembler line defining an `int' constant. */
  221. #define ASM_OUTPUT_INT(FILE,VALUE) \
  222. ( fprintf (FILE, "\tlong "), \
  223. output_addr_const (FILE, (VALUE)), \
  224. fprintf (FILE, "\n"))
  225. /* Likewise for `char' and `short' constants. */
  226. #define ASM_OUTPUT_SHORT(FILE,VALUE) \
  227. ( fprintf (FILE, "\tshort "), \
  228. output_addr_const (FILE, (VALUE)), \
  229. fprintf (FILE, "\n"))
  230. #define ASM_OUTPUT_CHAR(FILE,VALUE) \
  231. ( fprintf (FILE, "\tbyte "), \
  232. output_addr_const (FILE, (VALUE)), \
  233. fprintf (FILE, "\n"))
  234. /* This is how to output an assembler line for a numeric constant byte. */
  235. #define ASM_OUTPUT_BYTE(FILE,VALUE) \
  236. fprintf (FILE, "\tbyte 0x%x\n", (VALUE))
  237. #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
  238. fprintf (FILE, "\tlong L%d\n", VALUE)
  239. #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
  240. fprintf (FILE, "\tshort L%d-L%d\n", VALUE, REL)
  241. #define ASM_OUTPUT_ALIGN(FILE,LOG) \
  242. if ((LOG) == 1) \
  243. fprintf (FILE, "\tlalign 2\n"); \
  244. else if ((LOG) != 0) \
  245. abort ();
  246. #define ASM_OUTPUT_SKIP(FILE,SIZE) \
  247. fprintf (FILE, "\tspace %d\n", (SIZE))
  248. #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME)
  249. #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO)
  250. #define PRINT_OPERAND(FILE, X, CODE) \
  251. { if (CODE == '.') fprintf (FILE, "."); \
  252. else if (CODE == '#') fprintf (FILE, "&"); \
  253. else if (CODE == '-') fprintf (FILE, "-(%%sp)"); \
  254. else if (CODE == '+') fprintf (FILE, "(%%sp)+"); \
  255. else if (CODE == 's') fprintf (FILE, "(%%sp)"); \
  256. else if (CODE == '!') fprintf (FILE, "%%cc"); \
  257. else if (GET_CODE (X) == REG) \
  258. fprintf (FILE, "%s", reg_name [REGNO (X)]); \
  259. else if (GET_CODE (X) == MEM) \
  260. output_address (XEXP (X, 0)); \
  261. else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode) \
  262. { union { double d; int i[2]; } u; \
  263. union { float f; int i; } u1; \
  264. u.i[0] = XINT (X, 0); u.i[1] = XINT (X, 1); \
  265. u1.f = u.d; \
  266. if (CODE == 'f') \
  267. fprintf (FILE, "&0f%.9g", u1.f); \
  268. else \
  269. fprintf (FILE, "&0x%x", u1.i); } \
  270. else if (GET_CODE (X) == CONST_DOUBLE) \
  271. { union { double d; int i[2]; } u; \
  272. u.i[0] = XINT (X, 0); u.i[1] = XINT (X, 1); \
  273. fprintf (FILE, "&0f%.20g", u.d); } \
  274. else { putc ('&', FILE); output_addr_const (FILE, X); }}
  275. #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
  276. { register rtx reg1, reg2, breg, ireg; \
  277. register rtx addr = ADDR; \
  278. rtx offset; \
  279. switch (GET_CODE (addr)) \
  280. { \
  281. case REG: \
  282. fprintf (FILE, "(%s)", reg_name [REGNO (addr)]); \
  283. break; \
  284. case PRE_DEC: \
  285. fprintf (FILE, "-(%s)", reg_name [REGNO (XEXP (addr, 0))]); \
  286. break; \
  287. case POST_INC: \
  288. fprintf (FILE, "(%s)+", reg_name [REGNO (XEXP (addr, 0))]); \
  289. break; \
  290. case PLUS: \
  291. reg1 = 0; reg2 = 0; \
  292. ireg = 0; breg = 0; \
  293. offset = 0; \
  294. if (CONSTANT_ADDRESS_P (XEXP (addr, 0))) \
  295. { \
  296. offset = XEXP (addr, 0); \
  297. addr = XEXP (addr, 1); \
  298. } \
  299. else if (CONSTANT_ADDRESS_P (XEXP (addr, 1))) \
  300. { \
  301. offset = XEXP (addr, 1); \
  302. addr = XEXP (addr, 0); \
  303. } \
  304. if (GET_CODE (addr) != PLUS) ; \
  305. else if (GET_CODE (XEXP (addr, 0)) == SIGN_EXTEND) \
  306. { \
  307. reg1 = XEXP (addr, 0); \
  308. addr = XEXP (addr, 1); \
  309. } \
  310. else if (GET_CODE (XEXP (addr, 1)) == SIGN_EXTEND) \
  311. { \
  312. reg1 = XEXP (addr, 1); \
  313. addr = XEXP (addr, 0); \
  314. } \
  315. else if (GET_CODE (XEXP (addr, 0)) == MULT) \
  316. { \
  317. reg1 = XEXP (addr, 0); \
  318. addr = XEXP (addr, 1); \
  319. } \
  320. else if (GET_CODE (XEXP (addr, 1)) == MULT) \
  321. { \
  322. reg1 = XEXP (addr, 1); \
  323. addr = XEXP (addr, 0); \
  324. } \
  325. else if (GET_CODE (XEXP (addr, 0)) == REG) \
  326. { \
  327. reg1 = XEXP (addr, 0); \
  328. addr = XEXP (addr, 1); \
  329. } \
  330. else if (GET_CODE (XEXP (addr, 1)) == REG) \
  331. { \
  332. reg1 = XEXP (addr, 1); \
  333. addr = XEXP (addr, 0); \
  334. } \
  335. if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT \
  336. || GET_CODE (addr) == SIGN_EXTEND) \
  337. { if (reg1 == 0) reg1 = addr; else reg2 = addr; addr = 0; } \
  338. /* for OLD_INDEXING \
  339. else if (GET_CODE (addr) == PLUS) \
  340. { \
  341. if (GET_CODE (XEXP (addr, 0)) == REG) \
  342. { \
  343. reg2 = XEXP (addr, 0); \
  344. addr = XEXP (addr, 1); \
  345. } \
  346. else if (GET_CODE (XEXP (addr, 1)) == REG) \
  347. { \
  348. reg2 = XEXP (addr, 1); \
  349. addr = XEXP (addr, 0); \
  350. } \
  351. } \
  352. */ \
  353. if (offset != 0) { if (addr != 0) abort (); addr = offset; } \
  354. if ((reg1 && (GET_CODE (reg1) == SIGN_EXTEND \
  355. || GET_CODE (reg1) == MULT)) \
  356. || (reg2 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg2)))) \
  357. { breg = reg2; ireg = reg1; } \
  358. else if (reg1 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg1))) \
  359. { breg = reg1; ireg = reg2; } \
  360. if (ireg != 0 && breg == 0 && GET_CODE (addr) == LABEL_REF) \
  361. { int scale = 1; \
  362. if (GET_CODE (ireg) == MULT) \
  363. { scale = INTVAL (XEXP (ireg, 1)); \
  364. ireg = XEXP (ireg, 0); } \
  365. if (GET_CODE (ireg) == SIGN_EXTEND) \
  366. fprintf (FILE, "L%d-LI%d(%%pc,%s.w", \
  367. CODE_LABEL_NUMBER (XEXP (addr, 0)), \
  368. CODE_LABEL_NUMBER (XEXP (addr, 0)), \
  369. reg_name[REGNO (XEXP (ireg, 0))]); \
  370. else \
  371. fprintf (FILE, "L%d-LI%d(%%pc,%s.l", \
  372. CODE_LABEL_NUMBER (XEXP (addr, 0)), \
  373. CODE_LABEL_NUMBER (XEXP (addr, 0)), \
  374. reg_name[REGNO (ireg)]); \
  375. if (scale != 1) fprintf (FILE, "*%d", scale); \
  376. putc (')', FILE); \
  377. break; } \
  378. if (ireg != 0 || breg != 0) \
  379. { int scale = 1; \
  380. if (breg == 0) \
  381. abort (); \
  382. if (addr != 0) \
  383. output_addr_const (FILE, addr); \
  384. fprintf (FILE, "(%s", reg_name[REGNO (breg)]); \
  385. if (ireg != 0) \
  386. putc (',', FILE); \
  387. if (ireg != 0 && GET_CODE (ireg) == MULT) \
  388. { scale = INTVAL (XEXP (ireg, 1)); \
  389. ireg = XEXP (ireg, 0); } \
  390. if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND) \
  391. fprintf (FILE, "%s.w", reg_name[REGNO (XEXP (ireg, 0))]); \
  392. else if (ireg != 0) \
  393. fprintf (FILE, "%s.l", reg_name[REGNO (ireg)]); \
  394. if (scale != 1) fprintf (FILE, "*%d", scale); \
  395. putc (')', FILE); \
  396. break; \
  397. } \
  398. else if (reg1 != 0 && GET_CODE (addr) == LABEL_REF) \
  399. { fprintf (FILE, "L%d-LI%d(%%pc,%s.w)", \
  400. CODE_LABEL_NUMBER (XEXP (addr, 0)), \
  401. CODE_LABEL_NUMBER (XEXP (addr, 0)), \
  402. reg_name[REGNO (reg1)]); \
  403. break; } \
  404. default: \
  405. if (GET_CODE (addr) == CONST_INT \
  406. && INTVAL (addr) < 0x8000 \
  407. && INTVAL (addr) >= -0x8000) \
  408. fprintf (FILE, "%d.w", INTVAL (addr)); \
  409. else \
  410. output_addr_const (FILE, addr); \
  411. }}
  412. #define ASM_OUTPUT_ASCII(f, p, size) \
  413. { register int i; \
  414. int inside; \
  415. inside = FALSE; \
  416. for (i = 0; i < size; i++) { \
  417. if (i % 8 == 0) { \
  418. if (i != 0) { \
  419. if (inside) \
  420. putc('"', f); \
  421. putc('\n', f); \
  422. inside = FALSE; \
  423. } \
  424. fprintf(f, "%s ", ASCII_DATA_ASM_OP); \
  425. } \
  426. if (p[i] < 32 || p[i] == '\\' || p[i] == '"' || p[i] == 127) { \
  427. if (inside) { \
  428. putc('"', f); \
  429. inside = FALSE; \
  430. } \
  431. if (i % 8 != 0) \
  432. putc(',', f); \
  433. fprintf(f, "%d", p[i]); \
  434. } else { \
  435. if (!inside) { \
  436. if (i % 8 != 0) \
  437. putc(',', f); \
  438. putc('"', f); \
  439. inside = TRUE; \
  440. } \
  441. putc(p[i], f); \
  442. } \
  443. } \
  444. if (inside) \
  445. putc('"', f); \
  446. putc('\n', f); \
  447. }
  448. /* Translate Motorola opcodes such as `jbeq'
  449. into SGS opcodes such as `beq.w'.
  450. Delete the `e' in `move...' and `fmove'.
  451. Change `ftst' to `ftest'. */
  452. #define ASM_OUTPUT_OPCODE(FILE, PTR) \
  453. { if ((PTR)[0] == 'j' && (PTR)[1] == 'b') \
  454. { ++(PTR); \
  455. while (*(PTR) != ' ') \
  456. { putc (*(PTR), (FILE)); ++(PTR); } \
  457. fprintf ((FILE), ".w"); } \
  458. else if ((PTR)[0] == 'f') \
  459. { \
  460. if (!strncmp ((PTR), "fmove", 5)) \
  461. { fprintf ((FILE), "fmov"); (PTR) += 5; } \
  462. else if (!strncmp ((PTR), "ftst", 4)) \
  463. { fprintf ((FILE), "ftest"); (PTR) += 4; } \
  464. } \
  465. else if ((PTR)[0] == 'm' && (PTR)[1] == 'o' \
  466. && (PTR)[2] == 'v' && (PTR)[3] == 'e') \
  467. { fprintf ((FILE), "mov"); (PTR) += 4; } \
  468. }
  469. #else /* not HPUX_ASM */
  470. #undef FUNCTION_PROFILER
  471. #define FUNCTION_PROFILER(FILE, LABELNO) \
  472. fprintf (FILE, "\tmovl #LP%d,d0\n\tjsr mcount\n", (LABELNO));
  473. #endif /* not HPUX_ASM */