00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 extern const char *low_reg_names[];
00024 extern const char *text_seg_name;
00025 extern const char *rsect_text;
00026 extern const char *data_seg_name;
00027 extern const char *rsect_data;
00028 extern const char *bss_seg_name;
00029 extern const char *rsect_bss;
00030 extern const char *const_seg_name;
00031 extern const char *rsect_const;
00032 extern const char *chip_name;
00033 extern const char *save_chip_name;
00034 extern struct rtx_def *dsp16xx_compare_op0, *dsp16xx_compare_op1;
00035 extern struct rtx_def *dsp16xx_addhf3_libcall;
00036 extern struct rtx_def *dsp16xx_subhf3_libcall;
00037 extern struct rtx_def *dsp16xx_mulhf3_libcall;
00038 extern struct rtx_def *dsp16xx_divhf3_libcall;
00039 extern struct rtx_def *dsp16xx_cmphf3_libcall;
00040 extern struct rtx_def *dsp16xx_fixhfhi2_libcall;
00041 extern struct rtx_def *dsp16xx_floathihf2_libcall;
00042 extern struct rtx_def *dsp16xx_neghf2_libcall;
00043 extern struct rtx_def *dsp16xx_umulhi3_libcall;
00044 extern struct rtx_def *dsp16xx_mulhi3_libcall;
00045 extern struct rtx_def *dsp16xx_udivqi3_libcall;
00046 extern struct rtx_def *dsp16xx_udivhi3_libcall;
00047 extern struct rtx_def *dsp16xx_divqi3_libcall;
00048 extern struct rtx_def *dsp16xx_divhi3_libcall;
00049 extern struct rtx_def *dsp16xx_modqi3_libcall;
00050 extern struct rtx_def *dsp16xx_modhi3_libcall;
00051 extern struct rtx_def *dsp16xx_umodqi3_libcall;
00052 extern struct rtx_def *dsp16xx_umodhi3_libcall;
00053
00054 extern struct rtx_def *dsp16xx_ashrhi3_libcall;
00055 extern struct rtx_def *dsp16xx_ashlhi3_libcall;
00056 extern struct rtx_def *dsp16xx_lshrhi3_libcall;
00057
00058
00059 #define DSP16XX 1
00060
00061
00062
00063 #define ASM_PROG "as1600"
00064
00065
00066
00067 #define LD_PROG "ld1600"
00068
00069
00070 #define WORD_SWITCH_TAKES_ARG(STR) \
00071 (!strcmp (STR, "ifile") ? 1 : \
00072 0)
00073
00074 #ifdef CC1_SPEC
00075 #undef CC1_SPEC
00076 #endif
00077 #define CC1_SPEC "%{!O*:-O}"
00078
00079 #define CPP_SPEC "%{!O*:-D__OPTIMIZE__}"
00080
00081
00082
00083 #define CROSS_ASM_SPEC "%{!S:as1600 %a %i\n }"
00084
00085
00086
00087 #define CROSS_LINK_SPEC "%{!c:%{!M:%{!MM:%{!E:%{!S:ld1600 %l %X %{o*} %{m} \
00088 %{r} %{s} %{t} %{u*} %{x}\
00089 %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:}\
00090 %{L*} %D %o %{!nostdlib:-le1600 %L -le1600}\
00091 %{!A:%{!nostdlib:%{!nostartfiles:%E}}}\n }}}}}"
00092
00093
00094
00095 #define LIB_SPEC "-lc"
00096
00097
00098 #define STARTFILE_SPEC "%{mmap1:m1_crt0.o%s} \
00099 %{mmap2:m2_crt0.o%s} \
00100 %{mmap3:m3_crt0.o%s} \
00101 %{mmap4:m4_crt0.o%s} \
00102 %{!mmap*: %{!ifile*: m4_crt0.o%s} %{ifile*: \
00103 %ea -ifile option requires a -map option}}"
00104
00105
00106
00107 #define ENDFILE_SPEC "%{mmap1:m1_crtn.o%s} \
00108 %{mmap2:m2_crtn.o%s} \
00109 %{mmap3:m3_crtn.o%s} \
00110 %{mmap4:m4_crtn.o%s} \
00111 %{!mmap*: %{!ifile*: m4_crtn.o%s} %{ifile*: \
00112 %ea -ifile option requires a -map option}}"
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 #define ASM_SPEC "%{V} %{v:%{!V:-V}} %{g*:-g}"
00123
00124
00125
00126 #define LINK_SPEC "%{V} %{v:%{!V:-V}} %{minit:-i} \
00127 %{!ifile*:%{mmap1:m1_deflt.if%s} \
00128 %{mmap2:m2_deflt.if%s} \
00129 %{mmap3:m3_deflt.if%s} \
00130 %{mmap4:m4_deflt.if%s} \
00131 %{!mmap*:m4_deflt.if%s}} \
00132 %{ifile*:%*} %{r}"
00133
00134
00135 #define INCLUDE_DEFAULTS \
00136 { \
00137 { 0, 0, 0 } \
00138 }
00139
00140
00141 #ifdef __MSDOS__
00142 #define CPP_PREDEFINES "-Ddsp1600 -DDSP1600 -DMSDOS"
00143 #else
00144 #define CPP_PREDEFINES "-Ddsp1600 -DDSP1600 -Ddsp1610 -DDSP1610"
00145 #endif
00146
00147
00148
00149 extern int target_flags;
00150
00151
00152
00153 #define MASK_REGPARM 0x00000001
00154 #define MASK_NEAR_CALL 0x00000002
00155 #define MASK_NEAR_JUMP 0x00000004
00156 #define MASK_BMU 0x00000008
00157 #define MASK_MAP1 0x00000040
00158 #define MASK_MAP2 0x00000080
00159 #define MASK_MAP3 0x00000100
00160 #define MASK_MAP4 0x00000200
00161 #define MASK_YBASE_HIGH 0x00000400
00162 #define MASK_INIT 0x00000800
00163
00164 #define MASK_RESERVE_YBASE 0x00002000
00165 #define MASK_DEBUG 0x00004000
00166 #define MASK_SAVE_TEMPS 0x00008000
00167
00168
00169
00170
00171
00172 #define TARGET_REGPARM (target_flags & MASK_REGPARM)
00173
00174
00175
00176
00177 #define TARGET_NEAR_CALL (target_flags & MASK_NEAR_CALL)
00178
00179
00180
00181
00182 #define TARGET_NEAR_JUMP (target_flags & MASK_NEAR_JUMP)
00183
00184
00185
00186 #define TARGET_BMU (target_flags & MASK_BMU)
00187
00188 #define TARGET_YBASE_HIGH (target_flags & MASK_YBASE_HIGH)
00189
00190
00191 #define TARGET_MASK_INIT (target_flags & MASK_INIT)
00192
00193 #define TARGET_INLINE_MULT (target_flags & MASK_INLINE_MULT)
00194
00195
00196 #define TARGET_RESERVE_YBASE (target_flags & MASK_RESERVE_YBASE)
00197
00198
00199 #define TARGET_DEBUG (target_flags & MASK_DEBUG)
00200
00201
00202 #define TARGET_SAVE_TEMPS (target_flags & MASK_SAVE_TEMPS)
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212 #define TARGET_SWITCHES \
00213 { \
00214 { "regparm", MASK_REGPARM, \
00215 N_("Pass parameters in registers (default)") }, \
00216 { "no-regparm", -MASK_REGPARM, \
00217 N_("Don't pass parameters in registers") }, \
00218 { "near-call", MASK_NEAR_JUMP, \
00219 N_("Generate code for near calls") }, \
00220 { "no-near-call", -MASK_NEAR_CALL, \
00221 N_("Don't generate code for near calls") }, \
00222 { "near-jump", MASK_NEAR_JUMP, \
00223 N_("Generate code for near jumps") }, \
00224 { "no-near-jump", -MASK_NEAR_JUMP, \
00225 N_("Don't generate code for near jumps") }, \
00226 { "bmu", MASK_BMU, \
00227 N_("Generate code for a bit-manipulation unit") }, \
00228 { "no-bmu", -MASK_BMU, \
00229 N_("Don't generate code for a bit-manipulation unit") }, \
00230 { "map1", MASK_MAP1, \
00231 N_("Generate code for memory map1") }, \
00232 { "map2", MASK_MAP2, \
00233 N_("Generate code for memory map2") }, \
00234 { "map3", MASK_MAP3, \
00235 N_("Generate code for memory map3") }, \
00236 { "map4", MASK_MAP4, \
00237 N_("Generate code for memory map4") }, \
00238 { "init", MASK_INIT, \
00239 N_("Ouput extra code for initialized data") }, \
00240 { "reserve-ybase", MASK_RESERVE_YBASE, \
00241 N_("Don't let reg. allocator use ybase registers") }, \
00242 { "debug", MASK_DEBUG, \
00243 N_("Output extra debug info in Luxworks environment") }, \
00244 { "save-temporaries", MASK_SAVE_TEMPS, \
00245 N_("Save temp. files in Luxworks environment") }, \
00246 { "", TARGET_DEFAULT, ""} \
00247 }
00248
00249
00250 #ifndef TARGET_DEFAULT
00251 #define TARGET_DEFAULT MASK_REGPARM|MASK_YBASE_HIGH
00252 #endif
00253
00254 #define TARGET_OPTIONS \
00255 { \
00256 { "text=", &text_seg_name, \
00257 N_("Specify alternate name for text section") }, \
00258 { "data=", &data_seg_name, \
00259 N_("Specify alternate name for data section") }, \
00260 { "bss=", &bss_seg_name, \
00261 N_("Specify alternate name for bss section") }, \
00262 { "const=", &const_seg_name, \
00263 N_("Specify alternate name for constant section") }, \
00264 { "chip=", &chip_name, \
00265 N_("Specify alternate name for dsp16xx chip") }, \
00266 }
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277 #define OVERRIDE_OPTIONS override_options ()
00278
00279 #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
00280 { \
00281 flag_gnu_linker = FALSE; \
00282 \
00283 if (LEVEL >= 2) \
00284 { \
00285
00286
00287
00288
00289
00290 \
00291 flag_schedule_insns = FALSE; \
00292 } \
00293 }
00294
00295
00296
00297
00298
00299
00300 #define REAL_ARITHMETIC
00301
00302
00303
00304
00305 #define BITS_BIG_ENDIAN 0
00306
00307
00308
00309
00310 #define BYTES_BIG_ENDIAN 1
00311
00312
00313
00314 #define WORDS_BIG_ENDIAN 1
00315
00316
00317 #define BITS_PER_UNIT 16
00318
00319
00320
00321
00322
00323 #define BITS_PER_WORD 16
00324
00325
00326 #define MAX_BITS_PER_WORD 16
00327
00328
00329 #define UNITS_PER_WORD 1
00330
00331
00332
00333 #define POINTER_SIZE 16
00334
00335
00336 #define POINTER_BOUNDARY 16
00337
00338
00339 #define PARM_BOUNDARY 16
00340
00341
00342 #define STACK_BOUNDARY 16
00343
00344
00345 #define FUNCTION_BOUNDARY 16
00346
00347
00348 #define BIGGEST_ALIGNMENT 16
00349
00350
00351 #define BIGGEST_FIELD_ALIGNMENT 16
00352
00353
00354 #define EMPTY_FIELD_BOUNDARY 16
00355
00356
00357
00358 #define STRUCTURE_SIZE_BOUNDARY 16
00359
00360
00361
00362 #define STRICT_ALIGNMENT 1
00363
00364
00365
00366
00367 #define MAX_FIXED_MODE_SIZE 32
00368
00369
00370
00371 #define CHAR_TYPE_SIZE 16
00372 #define SHORT_TYPE_SIZE 16
00373 #define INT_TYPE_SIZE 16
00374 #define LONG_TYPE_SIZE 32
00375 #define LONG_LONG_TYPE_SIZE 32
00376 #define FLOAT_TYPE_SIZE 32
00377 #define DOUBLE_TYPE_SIZE 32
00378 #define LONG_DOUBLE_TYPE_SIZE 32
00379
00380
00381
00382
00383 #define DEFAULT_SIGNED_CHAR 1
00384
00385
00386
00387
00388
00389
00390 #define DEFAULT_SHORT_ENUMS 0
00391
00392
00393
00394
00395 #define SIZE_TYPE "unsigned int"
00396
00397
00398
00399
00400 #define PTRDIFF_TYPE "int"
00401
00402
00403
00404
00405 #define ALL_16_BIT_REGISTERS 1
00406
00407
00408
00409
00410
00411 #define FIRST_PSEUDO_REGISTER (REG_YBASE31 + 1)
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428 #define REG_A0 0
00429 #define REG_A0L 1
00430 #define REG_A1 2
00431 #define REG_A1L 3
00432 #define REG_X 4
00433 #define REG_Y 5
00434 #define REG_YL 6
00435 #define REG_PROD 7
00436 #define REG_PRODL 8
00437 #define REG_R0 9
00438 #define REG_R1 10
00439 #define REG_R2 11
00440 #define REG_R3 12
00441 #define REG_J 13
00442 #define REG_K 14
00443 #define REG_YBASE 15
00444 #define REG_PT 16
00445 #define REG_AR0 17
00446 #define REG_AR1 18
00447 #define REG_AR2 19
00448 #define REG_AR3 20
00449 #define REG_C0 21
00450 #define REG_C1 22
00451 #define REG_C2 23
00452 #define REG_PR 24
00453 #define REG_RB 25
00454 #define REG_YBASE0 26
00455 #define REG_YBASE1 27
00456 #define REG_YBASE2 28
00457 #define REG_YBASE3 29
00458 #define REG_YBASE4 30
00459 #define REG_YBASE5 31
00460 #define REG_YBASE6 32
00461 #define REG_YBASE7 33
00462 #define REG_YBASE8 34
00463 #define REG_YBASE9 35
00464 #define REG_YBASE10 36
00465 #define REG_YBASE11 37
00466 #define REG_YBASE12 38
00467 #define REG_YBASE13 39
00468 #define REG_YBASE14 40
00469 #define REG_YBASE15 41
00470 #define REG_YBASE16 42
00471 #define REG_YBASE17 43
00472 #define REG_YBASE18 44
00473 #define REG_YBASE19 45
00474 #define REG_YBASE20 46
00475 #define REG_YBASE21 47
00476 #define REG_YBASE22 48
00477 #define REG_YBASE23 49
00478 #define REG_YBASE24 50
00479 #define REG_YBASE25 51
00480 #define REG_YBASE26 52
00481 #define REG_YBASE27 53
00482 #define REG_YBASE28 54
00483 #define REG_YBASE29 55
00484 #define REG_YBASE30 56
00485 #define REG_YBASE31 57
00486
00487
00488 #define IS_ACCUM_REG(REGNO) IN_RANGE ((REGNO), REG_A0, REG_A1L)
00489 #define IS_ACCUM_LOW_REG(REGNO) ((REGNO) == REG_A0L || (REGNO) == REG_A1L)
00490
00491
00492 #define IS_YBASE_REGISTER_WINDOW(REGNO) ((REGNO) >= REG_YBASE0 && (REGNO) <= REG_YBASE31)
00493
00494 #define IS_YBASE_ELIGIBLE_REG(REGNO) (IS_ACCUM_REG (REGNO) || IS_ADDRESS_REGISTER(REGNO) \
00495 || REGNO == REG_X || REGNO == REG_Y || REGNO == REG_YL \
00496 || REGNO == REG_PROD || REGNO == REG_PRODL)
00497
00498 #define IS_ADDRESS_REGISTER(REGNO) ((REGNO) >= REG_R0 && (REGNO) <= REG_R3)
00499
00500 #define FIXED_REGISTERS \
00501 {0, 0, 0, 0, 0, 0, 0, 0, 0, \
00502 0, 0, 0, 1, 0, 0, 1, \
00503 1, \
00504 0, 0, 0, 0, \
00505 1, 1, 1, \
00506 1, 0, \
00507 0, 0, 0, 0, 0, 0, 0, 0, \
00508 0, 0, 0, 0, 0, 0, 0, 0, \
00509 0, 0, 0, 0, 0, 0, 0, 0, \
00510 0, 0, 0, 0, 0, 0, 0, 0}
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524 #define CALL_USED_REGISTERS \
00525 {1, 1, 1, 1, 0, 1, 1, 1, 1, \
00526 1, 0, 0, 1, 1, 1, 1, \
00527 1, \
00528 0, 0, 1, 1, \
00529 1, 1, 1, \
00530 1, 1, \
00531 0, 0, 0, 0, 0, 0, 0, 0, \
00532 0, 0, 0, 0, 0, 0, 0, 0, \
00533 0, 0, 0, 0, 0, 0, 0, 0, \
00534 0, 0, 0, 0, 0, 0, 0, 0}
00535
00536
00537
00538
00539
00540
00541
00542 #if 0
00543 #define REG_ALLOC_ORDER \
00544 { REG_R0, REG_R1, REG_R2, REG_PROD, REG_Y, REG_X, \
00545 REG_PRODL, REG_YL, REG_AR0, REG_AR1, \
00546 REG_RB, REG_A0, REG_A1, REG_A0L, \
00547 REG_A1L, REG_AR2, REG_AR3, \
00548 REG_YBASE, REG_J, REG_K, REG_PR, REG_PT, REG_C0, \
00549 REG_C1, REG_C2, REG_R3, \
00550 REG_YBASE0, REG_YBASE1, REG_YBASE2, REG_YBASE3, \
00551 REG_YBASE4, REG_YBASE5, REG_YBASE6, REG_YBASE7, \
00552 REG_YBASE8, REG_YBASE9, REG_YBASE10, REG_YBASE11, \
00553 REG_YBASE12, REG_YBASE13, REG_YBASE14, REG_YBASE15, \
00554 REG_YBASE16, REG_YBASE17, REG_YBASE18, REG_YBASE19, \
00555 REG_YBASE20, REG_YBASE21, REG_YBASE22, REG_YBASE23, \
00556 REG_YBASE24, REG_YBASE25, REG_YBASE26, REG_YBASE27, \
00557 REG_YBASE28, REG_YBASE29, REG_YBASE30, REG_YBASE31 }
00558 #else
00559 #define REG_ALLOC_ORDER \
00560 { \
00561 REG_A0, REG_A0L, REG_A1, REG_A1L, REG_Y, REG_YL, \
00562 REG_PROD, \
00563 REG_PRODL, REG_R0, REG_J, REG_K, REG_AR2, REG_AR3, \
00564 REG_X, REG_R1, REG_R2, REG_RB, REG_AR0, REG_AR1, \
00565 REG_YBASE0, REG_YBASE1, REG_YBASE2, REG_YBASE3, \
00566 REG_YBASE4, REG_YBASE5, REG_YBASE6, REG_YBASE7, \
00567 REG_YBASE8, REG_YBASE9, REG_YBASE10, REG_YBASE11, \
00568 REG_YBASE12, REG_YBASE13, REG_YBASE14, REG_YBASE15, \
00569 REG_YBASE16, REG_YBASE17, REG_YBASE18, REG_YBASE19, \
00570 REG_YBASE20, REG_YBASE21, REG_YBASE22, REG_YBASE23, \
00571 REG_YBASE24, REG_YBASE25, REG_YBASE26, REG_YBASE27, \
00572 REG_YBASE28, REG_YBASE29, REG_YBASE30, REG_YBASE31, \
00573 REG_R3, REG_YBASE, REG_PT, REG_C0, REG_C1, REG_C2, \
00574 REG_PR }
00575 #endif
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600 #define CONDITIONAL_REGISTER_USAGE \
00601 do \
00602 { \
00603 if (!TARGET_BMU) \
00604 { \
00605 int regno; \
00606 \
00607 for (regno = REG_AR0; regno <= REG_AR3; regno++) \
00608 fixed_regs[regno] = call_used_regs[regno] = 1; \
00609 } \
00610 if (TARGET_RESERVE_YBASE) \
00611 { \
00612 int regno; \
00613 \
00614 for (regno = REG_YBASE0; regno <= REG_YBASE31; regno++) \
00615 fixed_regs[regno] = call_used_regs[regno] = 1; \
00616 } \
00617 } \
00618 while (0)
00619
00620
00621
00622
00623
00624 #define CLASS_LIKELY_SPILLED_P(CLASS) \
00625 ((CLASS) != ALL_REGS && (CLASS) != YBASE_VIRT_REGS)
00626
00627
00628
00629
00630
00631
00632 #define HARD_REGNO_NREGS(REGNO, MODE) \
00633 (GET_MODE_SIZE(MODE))
00634
00635
00636
00637 #define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok(REGNO, MODE)
00638
00639
00640
00641
00642
00643 #define MODES_TIEABLE_P(MODE1, MODE2) \
00644 (((MODE1) == (MODE2)) || \
00645 (GET_MODE_CLASS((MODE1)) == MODE_FLOAT) \
00646 == (GET_MODE_CLASS((MODE2)) == MODE_FLOAT))
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656 #define STACK_POINTER_REGNUM REG_R3
00657
00658
00659
00660 #define FRAME_POINTER_REGNUM REG_R2
00661
00662
00663 #define CAN_DEBUG_WITHOUT_FP 1
00664
00665
00666 #define RETURN_ADDRESS_REGNUM REG_PR
00667
00668
00669 #define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM
00670
00671
00672
00673 #define STATIC_CHAIN_REGNUM 4
00674
00675
00676
00677 #define STRUCT_VALUE_REGNUM REG_R0
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700 enum reg_class
00701 {
00702 NO_REGS,
00703 A0H_REG,
00704 A0L_REG,
00705 A0_REG,
00706 A1H_REG,
00707 ACCUM_HIGH_REGS,
00708 A1L_REG,
00709 ACCUM_LOW_REGS,
00710 A1_REG,
00711 ACCUM_REGS,
00712 X_REG,
00713 X_OR_ACCUM_LOW_REGS,
00714 X_OR_ACCUM_REGS,
00715 YH_REG,
00716 YH_OR_ACCUM_HIGH_REGS,
00717 X_OR_YH_REGS,
00718 YL_REG,
00719 YL_OR_ACCUM_LOW_REGS,
00720 X_OR_YL_REGS,
00721 X_OR_Y_REGS,
00722 Y_REG,
00723 ACCUM_OR_Y_REGS,
00724 PH_REG,
00725 X_OR_PH_REGS,
00726 PL_REG,
00727 PL_OR_ACCUM_LOW_REGS,
00728 X_OR_PL_REGS,
00729 YL_OR_PL_OR_ACCUM_LOW_REGS,
00730 P_REG,
00731 ACCUM_OR_P_REGS,
00732 YL_OR_P_REGS,
00733 ACCUM_LOW_OR_YL_OR_P_REGS,
00734 Y_OR_P_REGS,
00735 ACCUM_Y_OR_P_REGS,
00736 NO_FRAME_Y_ADDR_REGS,
00737 Y_ADDR_REGS,
00738 ACCUM_LOW_OR_Y_ADDR_REGS,
00739 ACCUM_OR_Y_ADDR_REGS,
00740 X_OR_Y_ADDR_REGS,
00741 Y_OR_Y_ADDR_REGS,
00742 P_OR_Y_ADDR_REGS,
00743 NON_HIGH_YBASE_ELIGIBLE_REGS,
00744 YBASE_ELIGIBLE_REGS,
00745 J_REG,
00746 J_OR_DAU_16_BIT_REGS,
00747 BMU_REGS,
00748 NOHIGH_NON_ADDR_REGS,
00749 NON_ADDR_REGS,
00750 SLOW_MEM_LOAD_REGS,
00751 NOHIGH_NON_YBASE_REGS,
00752 NO_ACCUM_NON_YBASE_REGS,
00753 NON_YBASE_REGS,
00754 YBASE_VIRT_REGS,
00755 ACCUM_LOW_OR_YBASE_REGS,
00756 ACCUM_OR_YBASE_REGS,
00757 X_OR_YBASE_REGS,
00758 Y_OR_YBASE_REGS,
00759 ACCUM_LOW_YL_PL_OR_YBASE_REGS,
00760 P_OR_YBASE_REGS,
00761 ACCUM_Y_P_OR_YBASE_REGS,
00762 Y_ADDR_OR_YBASE_REGS,
00763 YBASE_OR_NOHIGH_YBASE_ELIGIBLE_REGS,
00764 YBASE_OR_YBASE_ELIGIBLE_REGS,
00765 NO_HIGH_ALL_REGS,
00766 ALL_REGS,
00767 LIM_REG_CLASSES
00768 };
00769
00770
00771 #define GENERAL_REGS ALL_REGS
00772
00773 #define N_REG_CLASSES (int) LIM_REG_CLASSES
00774
00775
00776
00777 #define REG_CLASS_NAMES \
00778 { \
00779 "NO_REGS", \
00780 "A0H_REG", \
00781 "A0L_REG", \
00782 "A0_REG", \
00783 "A1H_REG", \
00784 "ACCUM_HIGH_REGS", \
00785 "A1L_REG", \
00786 "ACCUM_LOW_REGS", \
00787 "A1_REG", \
00788 "ACCUM_REGS", \
00789 "X_REG", \
00790 "X_OR_ACCUM_LOW_REGS", \
00791 "X_OR_ACCUM_REGS", \
00792 "YH_REG", \
00793 "YH_OR_ACCUM_HIGH_REGS", \
00794 "X_OR_YH_REGS", \
00795 "YL_REG", \
00796 "YL_OR_ACCUM_LOW_REGS", \
00797 "X_OR_YL_REGS", \
00798 "X_OR_Y_REGS", \
00799 "Y_REG", \
00800 "ACCUM_OR_Y_REGS", \
00801 "PH_REG", \
00802 "X_OR_PH_REGS", \
00803 "PL_REG", \
00804 "PL_OR_ACCUM_LOW_REGS", \
00805 "X_OR_PL_REGS", \
00806 "PL_OR_YL_OR_ACCUM_LOW_REGS", \
00807 "P_REG", \
00808 "ACCUM_OR_P_REGS", \
00809 "YL_OR_P_REGS", \
00810 "ACCUM_LOW_OR_YL_OR_P_REGS", \
00811 "Y_OR_P_REGS", \
00812 "ACCUM_Y_OR_P_REGS", \
00813 "NO_FRAME_Y_ADDR_REGS", \
00814 "Y_ADDR_REGS", \
00815 "ACCUM_LOW_OR_Y_ADDR_REGS", \
00816 "ACCUM_OR_Y_ADDR_REGS", \
00817 "X_OR_Y_ADDR_REGS", \
00818 "Y_OR_Y_ADDR_REGS", \
00819 "P_OR_Y_ADDR_REGS", \
00820 "NON_HIGH_YBASE_ELIGIBLE_REGS", \
00821 "YBASE_ELIGIBLE_REGS", \
00822 "J_REG", \
00823 "J_OR_DAU_16_BIT_REGS", \
00824 "BMU_REGS", \
00825 "NOHIGH_NON_ADDR_REGS", \
00826 "NON_ADDR_REGS", \
00827 "SLOW_MEM_LOAD_REGS", \
00828 "NOHIGH_NON_YBASE_REGS", \
00829 "NO_ACCUM_NON_YBASE_REGS", \
00830 "NON_YBASE_REGS", \
00831 "YBASE_VIRT_REGS", \
00832 "ACCUM_LOW_OR_YBASE_REGS", \
00833 "ACCUM_OR_YBASE_REGS", \
00834 "X_OR_YBASE_REGS", \
00835 "Y_OR_YBASE_REGS", \
00836 "ACCUM_LOW_YL_PL_OR_YBASE_REGS", \
00837 "P_OR_YBASE_REGS", \
00838 "ACCUM_Y_P_OR_YBASE_REGS", \
00839 "Y_ADDR_OR_YBASE_REGS", \
00840 "YBASE_OR_NOHIGH_YBASE_ELIGIBLE_REGS", \
00841 "YBASE_OR_YBASE_ELIGIBLE_REGS", \
00842 "NO_HIGH_ALL_REGS", \
00843 "ALL_REGS" \
00844 }
00845
00846
00847
00848
00849
00850 #define REG_CLASS_CONTENTS \
00851 { \
00852 {0x00000000, 0x00000000}, \
00853 {0x00000001, 0x00000000}, \
00854 {0x00000002, 0x00000000}, \
00855 {0x00000003, 0x00000000}, \
00856 {0x00000004, 0x00000000}, \
00857 {0x00000005, 0x00000000}, \
00858 {0x00000008, 0x00000000}, \
00859 {0x0000000A, 0x00000000}, \
00860 {0x0000000c, 0x00000000}, \
00861 {0x0000000f, 0x00000000}, \
00862 {0x00000010, 0x00000000}, \
00863 {0x0000001A, 0x00000000}, \
00864 {0x0000001f, 0x00000000}, \
00865 {0x00000020, 0x00000000}, \
00866 {0x00000025, 0x00000000}, \
00867 {0x00000030, 0x00000000}, \
00868 {0x00000040, 0x00000000}, \
00869 {0x0000004A, 0x00000000}, \
00870 {0x00000050, 0x00000000}, \
00871 {0x00000060, 0x00000000}, \
00872 {0x00000070, 0x00000000}, \
00873 {0x0000006F, 0x00000000}, \
00874 {0x00000080, 0x00000000}, \
00875 {0x00000090, 0x00000000}, \
00876 {0x00000100, 0x00000000}, \
00877 {0x0000010A, 0x00000000}, \
00878 {0x00000110, 0x00000000}, \
00879 {0x0000014A, 0x00000000}, \
00880 {0x00000180, 0x00000000}, \
00881 {0x0000018F, 0x00000000}, \
00882 {0x000001C0, 0x00000000}, \
00883 {0x000001CA, 0x00000000}, \
00884 {0x000001E0, 0x00000000}, \
00885 {0x000001EF, 0x00000000}, \
00886 {0x00000E00, 0x00000000}, \
00887 {0x00001E00, 0x00000000}, \
00888 {0x00001E0A, 0x00000000}, \
00889 {0x00001E0F, 0x00000000}, \
00890 {0x00001E10, 0x00000000}, \
00891 {0x00001E60, 0x00000000}, \
00892 {0x00001F80, 0x00000000}, \
00893 {0x00001FDA, 0x00000000}, \
00894 {0x00001fff, 0x00000000}, \
00895 {0x00002000, 0x00000000}, \
00896 {0x00002025, 0x00000000}, \
00897 {0x001E0000, 0x00000000}, \
00898 {0x03FFE1DA, 0x00000000}, \
00899 {0x03FFE1FF, 0x00000000}, \
00900 {0x03FFFF8F, 0x00000000}, \
00901 {0x03FFFFDA, 0x00000000}, \
00902 {0x03FFFFF0, 0x00000000}, \
00903 {0x03FFFFFF, 0x00000000}, \
00904 {0xFC000000, 0x03FFFFFF}, \
00905 {0xFC00000A, 0x03FFFFFF}, \
00906 {0xFC00000F, 0x03FFFFFF}, \
00907 {0xFC000010, 0x03FFFFFF}, \
00908 {0xFC000060, 0x03FFFFFF}, \
00909 {0xFC00014A, 0x03FFFFFF}, \
00910 {0xFC000180, 0x03FFFFFF}, \
00911 {0xFC0001EF, 0x03FFFFFF}, \
00912 {0xFC001E00, 0x03FFFFFF}, \
00913 {0xFC001FDA, 0x03FFFFFF}, \
00914 {0xFC001FFF, 0x03FFFFFF}, \
00915 {0xFCFFFFDA, 0x03FFFFFF}, \
00916 {0xFFFFFFFF, 0x03FFFFFF} \
00917 }
00918
00919
00920
00921
00922
00923
00924
00925 #define REGNO_REG_CLASS(REGNO) regno_reg_class(REGNO)
00926
00927
00928
00929 #define INDEX_REG_CLASS NO_REGS
00930 #define BASE_REG_CLASS Y_ADDR_REGS
00931
00932
00933
00934 #define REG_CLASS_FROM_LETTER(C) \
00935 dsp16xx_reg_class_from_letter(C)
00936
00937 #define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
00938 secondary_reload_class(CLASS, MODE, X)
00939
00940
00941
00942
00943
00944 #define SMALL_REGISTER_CLASSES 1
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960 #define REGNO_OK_FOR_BASE_P(REGNO) \
00961 (((REGNO) >= REG_R0 && (REGNO) < REG_R3 + 1) || ((unsigned) reg_renumber[REGNO] >= REG_R0 \
00962 && (unsigned) reg_renumber[REGNO] < REG_R3 + 1))
00963
00964 #define REGNO_OK_FOR_YBASE_P(REGNO) \
00965 (((REGNO) == REG_YBASE) || ((unsigned) reg_renumber[REGNO] == REG_YBASE))
00966
00967 #define REGNO_OK_FOR_INDEX_P(REGNO) 0
00968
00969 #ifdef ALL_16_BIT_REGISTERS
00970 #define IS_32_BIT_REG(REGNO) 0
00971 #else
00972 #define IS_32_BIT_REG(REGNO) \
00973 ((REGNO) == REG_A0 || (REGNO) == REG_A1 || (REGNO) == REG_Y || (REGNO) == REG_PROD)
00974 #endif
00975
00976
00977
00978
00979
00980
00981
00982
00983 #define PREFERRED_RELOAD_CLASS(X,CLASS) preferred_reload_class (X, CLASS)
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000 #if 0
01001 #define LIMIT_RELOAD_CLASS(MODE, CLASS) dsp16xx_limit_reload_class (MODE, CLASS)
01002 #endif
01003
01004
01005
01006 #define CLASS_MAX_NREGS(CLASS, MODE) \
01007 class_max_nregs(CLASS, MODE)
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026 #define SMALL_INT(X) (SMALL_INTVAL (INTVAL (X)))
01027 #define SMALL_INTVAL(I) ((unsigned) (I) < 0x10000)
01028 #define SHORT_IMMEDIATE(X) (SHORT_INTVAL (INTVAL(X)))
01029 #define SHORT_INTVAL(I) ((unsigned) (I) < 0x100)
01030 #define ADD_LOW_16(I) ((I) >= 0 && (I) <= 32767)
01031 #define ADD_HIGH_16(I) (((I) & 0x0000ffff) == 0)
01032 #define AND_LOW_16(I) ((I) >= 0 && (I) <= 32767)
01033 #define AND_HIGH_16(I) (((I) & 0x0000ffff) == 0)
01034
01035 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
01036 ((C) == 'I' ? (SMALL_INTVAL(VALUE)) \
01037 : (C) == 'J' ? (SHORT_INTVAL(VALUE)) \
01038 : (C) == 'K' ? ((VALUE) == 0) \
01039 : (C) == 'L' ? ((VALUE) >= 0 && (VALUE) <= 32767) \
01040 : (C) == 'M' ? (((VALUE) & 0x0000ffff) == 0) \
01041 : (C) == 'N' ? ((VALUE) == -1 || (VALUE) == 1 \
01042 || (VALUE) == -2 || (VALUE) == 2) \
01043 : (C) == 'O' ? (((VALUE) & 0xffff0000) == 0xffff0000) \
01044 : (C) == 'P' ? (((VALUE) & 0x0000ffff) == 0xffff) \
01045 : 0)
01046
01047 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1
01048
01049
01050 #define EXTRA_CONSTRAINT(OP,C) \
01051 ((C) == 'R' ? symbolic_address_p (OP) \
01052 : 0)
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062
01063
01064
01065
01066 #define ARGS_GROW_DOWNWARD
01067
01068
01069
01070
01071
01072 #define STACK_PUSH_CODE POST_INC
01073
01074
01075
01076
01077
01078 #define STARTING_FRAME_OFFSET 0
01079
01080
01081
01082 #define STACK_POINTER_OFFSET (0)
01083
01084 struct dsp16xx_frame_info
01085 {
01086 unsigned long total_size;
01087 unsigned long var_size;
01088 unsigned long args_size;
01089 unsigned long extra_size;
01090 unsigned int reg_size;
01091 long fp_save_offset;
01092 unsigned long sp_save_offset;
01093 int pr_save_offset;
01094 int initialized;
01095 int num_regs;
01096 int function_makes_calls;
01097 };
01098
01099 extern struct dsp16xx_frame_info current_frame_info;
01100
01101 #define RETURN_ADDR_OFF current_frame_info.pr_save_offset
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115 #define ACCUMULATE_OUTGOING_ARGS 1
01116
01117
01118
01119
01120 #define FIRST_PARM_OFFSET(FNDECL) (0)
01121
01122
01123
01124
01125
01126
01127
01128 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
01129
01130
01131
01132
01133
01134
01135
01136
01137 #define VALUE_REGNO(MODE) (REG_Y)
01138
01139 #define FUNCTION_VALUE(VALTYPE, FUNC) \
01140 gen_rtx_REG (TYPE_MODE (VALTYPE), VALUE_REGNO(TYPE_MODE(VALTYPE)))
01141
01142
01143
01144 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, VALUE_REGNO(MODE))
01145
01146
01147 #define FUNCTION_VALUE_REGNO_P(N) ((N) == REG_Y)
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
01166 dsp16xx_function_arg (CUM, MODE, TYPE, NAMED)
01167
01168
01169 #define FIRST_REG_FOR_FUNCTION_ARG REG_Y
01170
01171
01172
01173
01174
01175
01176 #define CALLER_SAVE_PROFITABLE(REFS,CALLS) 0
01177
01178
01179
01180
01181
01182
01183 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
01184 (MUST_PASS_IN_STACK (MODE, TYPE))
01185
01186
01187
01188
01189
01190 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) (0)
01191
01192
01193
01194
01195
01196
01197 #define CUMULATIVE_ARGS int
01198
01199
01200
01201
01202 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) ((CUM) = 0)
01203
01204
01205
01206
01207
01208 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
01209 dsp16xx_function_arg_advance (&CUM, MODE,TYPE, NAMED)
01210
01211
01212 #define FUNCTION_ARG_REGNO_P(N) \
01213 ((N) == REG_Y || (N) == REG_YL || (N) == REG_PROD || (N) == REG_PRODL)
01214
01215
01216
01217
01218 #define FUNCTION_PROFILER(FILE, LABELNO) \
01219 internal_error ("profiling not implemented yet")
01220
01221
01222
01223
01224
01225
01226 #define EXIT_IGNORE_STACK (0)
01227
01228 #define TRAMPOLINE_TEMPLATE(FILE) \
01229 internal_error ("trampolines not yet implemented");
01230
01231
01232
01233
01234 #define TRAMPOLINE_SIZE 20
01235
01236
01237
01238
01239
01240 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
01241 internal_error ("trampolines not yet implemented");
01242
01243
01244
01245
01246 #define FRAME_POINTER_REQUIRED (current_function_calls_alloca)
01247
01248
01249
01250
01251 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) \
01252 { (DEPTH) = initial_frame_pointer_offset(); \
01253 }
01254
01255
01256
01257 #define ADDHF3_LIBCALL "__Emulate_addhf3"
01258 #define SUBHF3_LIBCALL "__Emulate_subhf3"
01259 #define MULHF3_LIBCALL "__Emulate_mulhf3"
01260 #define DIVHF3_LIBCALL "__Emulate_divhf3"
01261 #define CMPHF3_LIBCALL "__Emulate_cmphf3"
01262 #define FIXHFHI2_LIBCALL "__Emulate_fixhfhi2"
01263 #define FLOATHIHF2_LIBCALL "__Emulate_floathihf2"
01264 #define NEGHF2_LIBCALL "__Emulate_neghf2"
01265
01266 #define UMULHI3_LIBCALL "__Emulate_umulhi3"
01267 #define MULHI3_LIBCALL "__Emulate_mulhi3"
01268 #define UDIVQI3_LIBCALL "__Emulate_udivqi3"
01269 #define UDIVHI3_LIBCALL "__Emulate_udivhi3"
01270 #define DIVQI3_LIBCALL "__Emulate_divqi3"
01271 #define DIVHI3_LIBCALL "__Emulate_divhi3"
01272 #define MODQI3_LIBCALL "__Emulate_modqi3"
01273 #define MODHI3_LIBCALL "__Emulate_modhi3"
01274 #define UMODQI3_LIBCALL "__Emulate_umodqi3"
01275 #define UMODHI3_LIBCALL "__Emulate_umodhi3"
01276 #define ASHRHI3_LIBCALL "__Emulate_ashrhi3"
01277 #define LSHRHI3_LIBCALL "__Emulate_lshrhi3"
01278 #define ASHLHI3_LIBCALL "__Emulate_ashlhi3"
01279 #define LSHLHI3_LIBCALL "__Emulate_lshlhi3"
01280
01281
01282
01283 #define TARGET_MEM_FUNCTIONS
01284
01285
01286
01287
01288
01289 #define HAVE_POST_INCREMENT 1
01290 #define HAVE_POST_DECREMENT 1
01291
01292
01293
01294
01295
01296 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
01297
01298
01299 #define MAX_REGS_PER_ADDRESS 1
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313
01314 #ifndef REG_OK_STRICT
01315
01316
01317
01318 #define REG_OK_FOR_INDEX_P(X) 0
01319
01320
01321
01322 #define REG_OK_FOR_BASE_P(X) \
01323 ((REGNO (X) >= REG_R0 && REGNO (X) < REG_R3 + 1 ) \
01324 || (REGNO (X) >= FIRST_PSEUDO_REGISTER))
01325
01326
01327 #define REG_OK_FOR_YBASE_P(X) \
01328 (REGNO(X) == REG_YBASE || (REGNO (X) >= FIRST_PSEUDO_REGISTER))
01329 #else
01330
01331
01332 #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
01333
01334
01335 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
01336
01337
01338 #define REG_OK_FOR_YBASE_P(X) REGNO_OK_FOR_YBASE_P (REGNO(X))
01339
01340 #endif
01341
01342
01343
01344
01345
01346
01347
01348
01349
01350 #define INT_FITS_5_BITS(I) ((unsigned long) (I) < 0x20)
01351 #define INT_FITS_16_BITS(I) ((unsigned long) (I) < 0x10000)
01352 #define YBASE_CONST_OFFSET(I) ((I) >= -31 && (I) <= 0)
01353 #define YBASE_OFFSET(X) (GET_CODE (X) == CONST_INT && YBASE_CONST_OFFSET (INTVAL(X)))
01354
01355 #define FITS_16_BITS(X) (GET_CODE (X) == CONST_INT && INT_FITS_16_BITS(INTVAL(X)))
01356 #define FITS_5_BITS(X) (GET_CODE (X) == CONST_INT && INT_FITS_5_BITS(INTVAL(X)))
01357 #define ILLEGAL_HIMODE_ADDR(MODE, CONST) ((MODE) == HImode && CONST == -31)
01358
01359 #define INDIRECTABLE_ADDRESS_P(X) \
01360 ((GET_CODE(X) == REG && REG_OK_FOR_BASE_P(X)) \
01361 || ((GET_CODE(X) == POST_DEC || GET_CODE(X) == POST_INC) \
01362 && REG_P(XEXP(X,0)) && REG_OK_FOR_BASE_P(XEXP(X,0))) \
01363 || (GET_CODE(X) == CONST_INT && (unsigned long) (X) < 0x20))
01364
01365
01366 #define INDEXABLE_ADDRESS_P(X,MODE) \
01367 ((GET_CODE(X) == PLUS && GET_CODE (XEXP (X,0)) == REG && \
01368 XEXP(X,0) == stack_pointer_rtx && YBASE_OFFSET(XEXP(X,1)) && \
01369 !ILLEGAL_HIMODE_ADDR(MODE, INTVAL(XEXP(X,1)))) || \
01370 (GET_CODE(X) == PLUS && GET_CODE (XEXP (X,1)) == REG && \
01371 XEXP(X,1) == stack_pointer_rtx && YBASE_OFFSET(XEXP(X,0)) && \
01372 !ILLEGAL_HIMODE_ADDR(MODE, INTVAL(XEXP(X,0)))))
01373
01374 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
01375 { \
01376 if (INDIRECTABLE_ADDRESS_P(X)) \
01377 goto ADDR; \
01378 }
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391
01392
01393
01394
01395
01396
01397
01398
01399
01400
01401
01402
01403 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
01404 { if (GET_CODE (X) == PLUS && XEXP (X, 1) == const0_rtx) \
01405 X = XEXP (x, 0); \
01406 if (GET_CODE (X) == MULT || GET_CODE (X) == PLUS) \
01407 X = force_operand (X, 0); \
01408 else \
01409 X = force_reg (Pmode, X); \
01410 goto WIN; \
01411 }
01412
01413
01414
01415
01416
01417
01418 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
01419 if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == POST_DEC) goto LABEL
01420
01421
01422
01423 #define LEGITIMATE_CONSTANT_P(X) (1)
01424
01425
01426
01427
01428
01429
01430
01431
01432
01433 #define NOTICE_UPDATE_CC(EXP, INSN) \
01434 notice_update_cc( (EXP) )
01435
01436
01437
01438
01439
01440
01441
01442 #define CONST_COSTS(RTX,CODE,OUTER_CODE) \
01443 case CONST_INT: \
01444 return (unsigned) INTVAL (RTX) < 65536 ? 0 : 2; \
01445 case LABEL_REF: \
01446 case SYMBOL_REF: \
01447 case CONST: \
01448 return COSTS_N_INSNS (1); \
01449 \
01450 case CONST_DOUBLE: \
01451 return COSTS_N_INSNS (2);
01452
01453
01454
01455
01456 #define RTX_COSTS(X,CODE,OUTER_CODE) \
01457 case MEM: \
01458 return GET_MODE (X) == QImode ? COSTS_N_INSNS (2) : \
01459 COSTS_N_INSNS (4); \
01460 case DIV: \
01461 case MOD: \
01462 return COSTS_N_INSNS (38); \
01463 case MULT: \
01464 if (GET_MODE (X) == QImode) \
01465 return COSTS_N_INSNS (2); \
01466 else \
01467 return COSTS_N_INSNS (38); \
01468 case PLUS: \
01469 case MINUS: \
01470 if (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT) \
01471 { \
01472 return (1 + \
01473 rtx_cost (XEXP (X, 0), CODE) + \
01474 rtx_cost (XEXP (X, 1), CODE)); \
01475 } \
01476 else \
01477 return COSTS_N_INSNS (38); \
01478 \
01479 case AND: case IOR: case XOR: \
01480 return (1 + \
01481 rtx_cost (XEXP (X, 0), CODE) + \
01482 rtx_cost (XEXP (X, 1), CODE)); \
01483 \
01484 case NEG: case NOT: \
01485 return COSTS_N_INSNS (1); \
01486 case ASHIFT: \
01487 case ASHIFTRT: \
01488 case LSHIFTRT: \
01489 if (GET_CODE (XEXP (X,1)) == CONST_INT) \
01490 { \
01491 int number = INTVAL(XEXP (X,1)); \
01492 if (number == 1 || number == 4 || number == 8 || \
01493 number == 16) \
01494 return COSTS_N_INSNS (1); \
01495 else \
01496 { \
01497 if (TARGET_BMU) \
01498 return COSTS_N_INSNS (2); \
01499 else \
01500 return COSTS_N_INSNS (num_1600_core_shifts(number)); \
01501 } \
01502 } \
01503 if (TARGET_BMU) \
01504 return COSTS_N_INSNS (1); \
01505 else \
01506 return COSTS_N_INSNS (15);
01507
01508
01509
01510 #define ADDRESS_COST(ADDR) dsp16xx_address_cost (ADDR)
01511
01512
01513
01514
01515
01516 #define REGISTER_MOVE_COST(MODE,FROM,TO) dsp16xx_register_move_cost (FROM, TO)
01517
01518
01519
01520 #define MEMORY_MOVE_COST(MODE,CLASS,IN) \
01521 (GET_MODE_CLASS(MODE) == MODE_INT && MODE == QImode ? 12 \
01522 : 16)
01523
01524
01525
01526 #define BRANCH_COST 1
01527
01528
01529
01530
01531 #define NO_FUNCTION_CSE
01532
01533
01534
01535
01536
01537
01538 #define SLOW_BYTE_ACCESS 1
01539
01540
01541
01542
01543
01544
01545
01546
01547
01548
01549
01550
01551 #define DEFAULT_TEXT_SEG_NAME ".text"
01552 #define TEXT_SECTION_ASM_OP rsect_text
01553
01554
01555 #define DEFAULT_CONST_SEG_NAME ".const"
01556 #define READONLY_SECTION_ASM_OP rsect_const
01557 #define READONLY_DATA_SECTION const_section
01558
01559
01560 #define DEFAULT_DATA_SEG_NAME ".data"
01561 #define DATA_SECTION_ASM_OP rsect_data
01562
01563 #define DEFAULT_BSS_SEG_NAME ".bss"
01564 #define BSS_SECTION_ASM_OP rsect_bss
01565
01566
01567
01568 #define DEFAULT_CHIP_NAME "1610"
01569
01570
01571
01572 #define EXTRA_SECTIONS in_const
01573
01574 #define EXTRA_SECTION_FUNCTIONS \
01575 extern void const_section PARAMS ((void)); \
01576 void \
01577 const_section () \
01578 { \
01579 if (in_section != in_const) \
01580 { \
01581 fprintf (asm_out_file, "%s\n", READONLY_SECTION_ASM_OP); \
01582 in_section = in_const; \
01583 } \
01584 }
01585
01586
01587
01588
01589 #define ASM_FILE_START(FILE) coff_dsp16xx_file_start (FILE)
01590
01591
01592
01593 #define ASM_COMMENT_START ""
01594 #define ASM_COMMENT_END ""
01595
01596
01597
01598 #define ASM_APP_ON ""
01599
01600
01601
01602 #define ASM_APP_OFF ""
01603
01604
01605
01606
01607
01608
01609 #define ASCII_LENGTH 10
01610
01611 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
01612 do { \
01613 FILE *_hide_asm_out_file = (MYFILE); \
01614 const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \
01615 int _hide_thissize = (MYLENGTH); \
01616 { \
01617 FILE *asm_out_file = _hide_asm_out_file; \
01618 const unsigned char *p = _hide_p; \
01619 int thissize = _hide_thissize; \
01620 int i; \
01621 \
01622 for (i = 0; i < thissize; i++) \
01623 { \
01624 register int c = p[i]; \
01625 \
01626 if (i % ASCII_LENGTH == 0) \
01627 fprintf (asm_out_file, "\tint "); \
01628 \
01629 if (c >= ' ' && c < 0177 && c != '\'') \
01630 { \
01631 putc ('\'', asm_out_file); \
01632 putc (c, asm_out_file); \
01633 putc ('\'', asm_out_file); \
01634 } \
01635 else \
01636 { \
01637 fprintf (asm_out_file, "%d", c); \
01638
01639
01640
01641
01642
01643
01644
01645 \
01646 } \
01647
01648
01649
01650
01651
01652 \
01653 if ((i != thissize - 1) && ((i + 1) % ASCII_LENGTH)) \
01654 fprintf(asm_out_file, ","); \
01655 if (!((i + 1) % ASCII_LENGTH)) \
01656 fprintf (asm_out_file, "\n"); \
01657 } \
01658 fprintf (asm_out_file, "\n"); \
01659 } \
01660 } \
01661 while (0)
01662
01663
01664
01665
01666
01667
01668 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
01669 do { \
01670 int len = strlen (NAME); \
01671 char *temp = (char *) alloca (len + 3); \
01672 temp[0] = 'L'; \
01673 strcpy (&temp[1], (NAME)); \
01674 temp[len + 1] = '_'; \
01675 temp[len + 2] = 0; \
01676 (OUTPUT) = (char *) alloca (strlen (NAME) + 11); \
01677 ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO); \
01678 } while (0)
01679
01680
01681
01682
01683
01684
01685 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
01686 asm_output_common (FILE, NAME, SIZE, ROUNDED);
01687
01688
01689
01690
01691 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
01692 asm_output_local (FILE, NAME, SIZE, ROUNDED);
01693
01694
01695
01696
01697
01698 #define ASM_OUTPUT_LABEL(FILE,NAME) \
01699 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
01700
01701
01702
01703
01704 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
01705 do { fputs (".global ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
01706
01707
01708
01709
01710
01711 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
01712 { \
01713 fprintf (FILE, ".extern "); \
01714 assemble_name (FILE, NAME); \
01715 fprintf (FILE, "\n"); \
01716 }
01717
01718
01719
01720 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
01721 { \
01722 fprintf (FILE, ".extern "); \
01723 assemble_name (FILE, XSTR (FUN, 0)); \
01724 fprintf (FILE, "\n"); \
01725 }
01726
01727
01728
01729 #define USER_LABEL_PREFIX "_"
01730
01731
01732
01733 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
01734 fprintf (FILE, "%s%d:\n", PREFIX, NUM)
01735
01736
01737
01738
01739
01740 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
01741 sprintf (LABEL, "*%s%d", PREFIX, NUM)
01742
01743
01744
01745
01746
01747
01748
01749 #define REGISTER_NAMES \
01750 {"a0", "a0l", "a1", "a1l", "x", "y", "yl", "p", "pl", \
01751 "r0", "r1", "r2", "r3", "j", "k", "ybase", "pt", \
01752 "ar0", "ar1", "ar2", "ar3", \
01753 "c0", "c1", "c2", "pr", "rb", \
01754 "*(0)", "*(1)", "*(2)", "*(3)", "*(4)", "*(5)", \
01755 "*(6)", "*(7)", "*(8)", "*(9)", "*(10)", "*(11)", \
01756 "*(12)", "*(13)", "*(14)", "*(15)", "*(16)", "*(17)", \
01757 "*(18)", "*(19)", "*(20)", "*(21)", "*(22)", "*(23)", \
01758 "*(24)", "*(25)", "*(26)", "*(27)", "*(28)", "*(29)", \
01759 "*(30)", "*(31)" }
01760
01761 #define HIMODE_REGISTER_NAMES \
01762 {"a0", "a0", "a1", "a1", "x", "y", "y", "p", "p", \
01763 "r0", "r1", "r2", "r3", "j", "k", "ybase", "pt", \
01764 "ar0", "ar1", "ar2", "ar3", \
01765 "c0", "c1", "c2", "pr", "rb", \
01766 "*(0)", "*(1)", "*(2)", "*(3)", "*(4)", "*(5)", \
01767 "*(6)", "*(7)", "*(8)", "*(9)", "*(10)", "*(11)", \
01768 "*(12)", "*(13)", "*(14)", "*(15)", "*(16)", "*(17)", \
01769 "*(18)", "*(19)", "*(20)", "*(21)", "*(22)", "*(23)", \
01770 "*(24)", "*(25)", "*(26)", "*(27)", "*(28)", "*(29)", \
01771 "*(30)", "*(31)" }
01772
01773 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) 0
01774
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788 #define PRINT_OPERAND(FILE, X, CODE) print_operand(FILE, X, CODE)
01789
01790
01791
01792
01793 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
01794
01795
01796
01797 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
01798 internal_error ("profiling not implemented yet");
01799
01800
01801
01802 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
01803 internal_error ("profiling not implemented yet");
01804
01805
01806
01807
01808
01809 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
01810 fprintf (FILE, "\tint L%d-L%d\n", VALUE, REL)
01811
01812
01813
01814 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
01815 fprintf (FILE, "\tint L%d\n", VALUE)
01816
01817
01818
01819
01820
01821
01822 #define ASM_OUTPUT_ALIGN(FILE,LOG)
01823
01824
01825
01826 #define ASM_NO_SKIP_IN_TEXT 1
01827
01828 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
01829 fprintf (FILE, "\t%d * int 0\n", (SIZE))
01830
01831
01832
01833 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
01834
01835 #define ASM_OUTPUT_DEF(asm_out_file, LABEL1, LABEL2) \
01836 do { \
01837 fprintf (asm_out_file, ".alias " ); \
01838 ASM_OUTPUT_LABELREF(asm_out_file, LABEL1); \
01839 fprintf (asm_out_file, "=" ); \
01840 ASM_OUTPUT_LABELREF(asm_out_file, LABEL2); \
01841 fprintf (asm_out_file, "\n" ); \
01842 } while (0)
01843
01844
01845
01846
01847
01848
01849 #define CASE_VECTOR_MODE QImode
01850
01851
01852
01853
01854
01855
01856
01857
01858
01859 #define MOVE_MAX 1
01860
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
01871
01872
01873 #define PROMOTE_PROTOTYPES 1
01874
01875
01876 #define Pmode QImode
01877
01878
01879
01880
01881 #define FUNCTION_MODE QImode
01882
01883 #if !defined(__DATE__)
01884 #define TARGET_VERSION fprintf (stderr, " (%s)", VERSION_INFO1)
01885 #else
01886 #define TARGET_VERSION fprintf (stderr, " (%s, %s)", VERSION_INFO1, __DATE__)
01887 #endif
01888
01889 #define VERSION_INFO1 "Lucent DSP16xx C Cross Compiler, version 1.3.0b"
01890
01891
01892
01893 #define DEFAULT_SIGNED_CHAR 1
01894
01895
01896
01897 #define INIT_SECTION_ASM_OP 1
01898