This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] MIPS32 DSP intrinsics


  Yes, I could change instruction names in "mips-dsp.md", as you said.
Also, I removed "RejectNegative" to have "-mno-dsp".

  Here is the latest MIPS32 DSP ASE patch.  All changes are made based on
your review at 7/16/2005.  I tried to structure the DSP document
(extend.texi)
as well.  GCC regressions have 97 more passes due to new DSP tests.

/home/sweng_scratrch1/gcc-mainline/dejagnu/runtest --tool
gcc --target_board=mip
s-sim mips.exp)
Test Run By fu on Thu Jul 21 16:20:21 2005
Target is mipsisa32-unknown-elf
Host   is i686-pc-linux-gnu
                === gcc tests ===
Schedule of variations:
    mips-sim

                === gcc Summary ===

# of expected passes            35662
# of unexpected failures        17
# of unexpected successes       1
# of expected failures          70
# of untested testcases         28
# of unsupported tests          503
/home/sweng_scratrch1/gcc-mainline/builddsp/gcc/xgcc  version 4.1.0 20050721
(ex
perimental)

  Thanks a lot!

Regards,
Chao-ying

2005-07-21  Chao-ying Fu  <fu@mips.com>

    * config/mips/mips-dsp.md: New file.
    * testsuite/gcc.target/mips/mips32-dsp-type.c: New test.
    * testsuite/gcc.target/mips/mips32-dsp.c: New test.
    * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes.
    * config/mips/mips.c (mips_function_type): Add types for DSP builtin
    functions.
    (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and
    MIPS_BUILTIN_BPOSGE32.
    (mips_expand_builtin_direct): Add one parameter to indicate that
    builtin functions need to return a value.
    (mips_expand_builtin_bposge): New for expanding "bposge" builtin
    functions.
    (mips_regno_to_class): Add classes for 12 new DSP registers.
    (mips_subword): Change to check four HI registers.
    (mips_output_move): Output move to and from 6 new DSP accumulators.
    (override_options): Make sure -mdsp and -mips16 are not used together.
    Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS.  Enable DSP accumulators
    for machine modes.
    (mips_conditional_register_usage): Disable 6 new DSP accumulators
    when !TARGET_DSP.
    (print_operand): Add 'q' for printing DSP accumulators.
    (mips_cannot_change_mode_class): Check ACC_REGS.
    (mips_secondary_reload_class): Check ACC_REGS.
    (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP.
    (mips_register_move_cost): Check ACC_REGS.
    (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph
    CODE_FOR_mips_subu_qb): New define.
    (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New define for builtin
    functions.
    (dsp_bdesc): New for DSP builtin functions.
    (bdesc_arrays): Add DSP builtin function table.
    (mips_prepare_builtin_arg): Change to check predicate again after
    copy_to_mode_reg.
    (mips_expand_builtin): Add one more parameter to
    mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and
    MIPS_BUILTIN_BPOSGE32.
    (mips_init_builtins): Initialize new function types.
    (mips_expand_builtin_direct): Check if builtin functions need to
    return a value and pass operands properly.
    (mips_expand_builtin_bposge): New for expanding "bposge" builtin
    functions.
    * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp.
    (ASM_SPEC): Map -mdsp to -mdsp in GAS.
    (FIRST_PSEUDO_REGISTER): Increase to 188 because of 6 DSP accumulators
    and 6 DSP control registers.
    (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS):
    Update for 12 new DSP registers.
    (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM,
    AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM):
    New define.
    (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New define.
    (reg_class): Add DSP_ACC_REGS and ACC_REGS.
    (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS.
    (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS.
    (REG_ALLOC_ORDER): Update for 12 new DSP registers.
    (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS.
    (UIMM6_OPERAND, IMM10_OPERAND): New define.
    (YA, YB): New extra two-letter constraints.
    (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints.
    (REGISTER_NAMES): Add names for 12 new DSP registers.
    * config/mips/mips.md (UNSPEC_ADDQ .. UNSPEC_RDDSP): New unspec.
    (*movdi_32bit): Change 'x' to 'a' for ACC_REGS.
    (*movsi_internal): Change 'x' to 'a' for ACC_REGS.  Add one move pattern
    from 'A' to 'd'.
    (mips-dsp.md): New include.
    * config/mips/mips.opt (-mdsp): New option.
    * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand,
    reg_imm10_operand): New predicates.
    * doc/extend.texi (MIPS DSP Builtin Functions): New section.
    * doc/invoke.texi (-mdsp): Document new option.


----- Original Message ----- 
From: "Richard Sandiford" <richard@codesourcery.com>
To: "Chao-ying Fu" <fu@mips.com>
Cc: "Thekkath, Radhika" <radhika@mercury.mips.com>;
<gcc-patches@gcc.gnu.org>
Sent: Tuesday, July 19, 2005 9:06 PM
Subject: Re: [PATCH] MIPS32 DSP intrinsics


> "Chao-ying Fu" <fu@mips.com> writes:
> >>> + #define CODE_FOR_mips_addq_s_ph CODE_FOR_mips_addsv2hi3
> >>> + #define CODE_FOR_mips_addq_s_w CODE_FOR_mips_addssi3
> >
> >> ...stuff like this shouldn't be necessary.  Just give the .md pattern
> >> the name you want.
> >
> >   Because I use macro in "mips-dsp.md", some auto-generated instruction
> > names are not what I want.  Thus, I need to have these defines.
>
> Can you explain?  It should be possible to get any name you want
> in the .md file, even using macros.  (There's no requirement for
> the pattern name to include "<mode>", in case that's what you're
> thinking.)
>
> > But, I can remove "RejectNegative" to create "-mno-dsp", if this is
better.
>
> I think it'd be more consistent to have -mno-dsp, much like we have
> -mno-mips16 and various other -mno options.  For example, it can
> sometimes be useful to take a command line that includes "-mdsp"
> and just stick a "-mno-dsp" at the end to override it.
>
> FWIW, I see RejectNegative as being for things that aren't boolean
> switches (e.g. -mflush-func), for cases whether the negative isn't
> "-mno" (e.g. -msoft-float/-mhard-float) and for cases where the
> option is sort of an enum (-mgp32, -mgp64).
>
> Richard
>

Attachment: mipsdsp.diff
Description: Binary data

Attachment: mips-dsp.md
Description: Binary data

Attachment: mips32-dsp-type.c
Description: Binary data

Attachment: mips32-dsp.c
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]