Commit 118ea793 by Chao-ying Fu Committed by Richard Sandiford

mips-dsp.md: New file.

	* config/mips/mips-dsp.md: New file.
	* 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 code-aliasing macros.
	(DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros.
	(dsp_bdesc): New array.
	(bdesc_arrays): Add DSP builtin function table.
	(mips_prepare_builtin_arg): 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 function.
	* 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.
	(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):
	(DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros.
	(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 macros.
	(EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints.
	(REGISTER_NAMES): Add names for 12 new DSP registers.
	* config/mips/mips.md: Include mips-dsp.md.
	(UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC)
	(UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S)
	(UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W)
	(UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR)
	(UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA)
	(UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR)
	(UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL)
	(UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R)
	(UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH)
	(UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL)
	(UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR)
	(UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH)
	(UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL)
	(UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR)
	(UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH)
	(UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB)
	(UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH)
	(UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H)
	(UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP)
	(UNSPEC_RDDSP): New constants.
	(*movdi_32bit): Change 'x' to 'a' for ACC_REGS.
	(*movsi_internal): Change 'x' to 'a' for ACC_REGS.  Add an
	A<-d alternative.
	* 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 Built-in Functions): New section.
	* doc/invoke.texi (-mdsp): Document new option.

From-SVN: r102307
parent 5887a1bb
2005-07-23 Chao-ying Fu <fu@mips.com>
* config/mips/mips-dsp.md: New file.
* 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 code-aliasing macros.
(DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros.
(dsp_bdesc): New array.
(bdesc_arrays): Add DSP builtin function table.
(mips_prepare_builtin_arg): 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 function.
* 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.
(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):
(DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros.
(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 macros.
(EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints.
(REGISTER_NAMES): Add names for 12 new DSP registers.
* config/mips/mips.md: Include mips-dsp.md.
(UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC)
(UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S)
(UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W)
(UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR)
(UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA)
(UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR)
(UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL)
(UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R)
(UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH)
(UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL)
(UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR)
(UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH)
(UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL)
(UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR)
(UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH)
(UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB)
(UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH)
(UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H)
(UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP)
(UNSPEC_RDDSP): New constants.
(*movdi_32bit): Change 'x' to 'a' for ACC_REGS.
(*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an
A<-d alternative.
* 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 Built-in Functions): New section.
* doc/invoke.texi (-mdsp): Document new option.
2005-07-22 DJ Delorie <dj@redhat.com> 2005-07-22 DJ Delorie <dj@redhat.com>
* c-objc-common.c (c_cannot_inline_tree_fn): Add warning control * c-objc-common.c (c_cannot_inline_tree_fn): Add warning control
......
...@@ -28,6 +28,7 @@ FLOAT_MODE (TF, 16, mips_quad_format); ...@@ -28,6 +28,7 @@ FLOAT_MODE (TF, 16, mips_quad_format);
/* Vector modes. */ /* Vector modes. */
VECTOR_MODES (FLOAT, 8); /* V4HF V2SF */ VECTOR_MODES (FLOAT, 8); /* V4HF V2SF */
VECTOR_MODES (INT, 4); /* V4QI V2HI */
/* Paired single comparison instructions use 2 or 4 CC. */ /* Paired single comparison instructions use 2 or 4 CC. */
CC_MODE (CCV2); CC_MODE (CCV2);
...@@ -37,3 +38,6 @@ ADJUST_ALIGNMENT (CCV2, 8); ...@@ -37,3 +38,6 @@ ADJUST_ALIGNMENT (CCV2, 8);
CC_MODE (CCV4); CC_MODE (CCV4);
ADJUST_BYTESIZE (CCV4, 16); ADJUST_BYTESIZE (CCV4, 16);
ADJUST_ALIGNMENT (CCV4, 16); ADJUST_ALIGNMENT (CCV4, 16);
/* For MIPS DSP control registers. */
CC_MODE (CCDSP);
...@@ -316,6 +316,9 @@ extern const struct mips_rtx_cost_data *mips_cost; ...@@ -316,6 +316,9 @@ extern const struct mips_rtx_cost_data *mips_cost;
if (TARGET_MIPS3D) \ if (TARGET_MIPS3D) \
builtin_define ("__mips3d"); \ builtin_define ("__mips3d"); \
\ \
if (TARGET_DSP) \
builtin_define ("__mips_dsp"); \
\
MIPS_CPP_SET_PROCESSOR ("_MIPS_ARCH", mips_arch_info); \ MIPS_CPP_SET_PROCESSOR ("_MIPS_ARCH", mips_arch_info); \
MIPS_CPP_SET_PROCESSOR ("_MIPS_TUNE", mips_tune_info); \ MIPS_CPP_SET_PROCESSOR ("_MIPS_TUNE", mips_tune_info); \
\ \
...@@ -807,6 +810,7 @@ extern const struct mips_rtx_cost_data *mips_cost; ...@@ -807,6 +810,7 @@ extern const struct mips_rtx_cost_data *mips_cost;
%{mips32} %{mips32r2} %{mips64} \ %{mips32} %{mips32r2} %{mips64} \
%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \ %{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \
%{mips3d:-mips3d} \ %{mips3d:-mips3d} \
%{mdsp} \
%{mfix-vr4120} %{mfix-vr4130} \ %{mfix-vr4120} %{mfix-vr4130} \
%(subtarget_asm_optimizing_spec) \ %(subtarget_asm_optimizing_spec) \
%(subtarget_asm_debugging_spec) \ %(subtarget_asm_debugging_spec) \
...@@ -1149,9 +1153,11 @@ extern const struct mips_rtx_cost_data *mips_cost; ...@@ -1149,9 +1153,11 @@ extern const struct mips_rtx_cost_data *mips_cost;
- ARG_POINTER_REGNUM - ARG_POINTER_REGNUM
- FRAME_POINTER_REGNUM - FRAME_POINTER_REGNUM
- FAKE_CALL_REGNO (see the comment above load_callsi for details) - FAKE_CALL_REGNO (see the comment above load_callsi for details)
- 3 dummy entries that were used at various times in the past. */ - 3 dummy entries that were used at various times in the past.
- 6 DSP accumulator registers (3 hi-lo pairs) for MIPS DSP ASE
- 6 DSP control registers */
#define FIRST_PSEUDO_REGISTER 176 #define FIRST_PSEUDO_REGISTER 188
/* By default, fix the kernel registers ($26 and $27), the global /* By default, fix the kernel registers ($26 and $27), the global
pointer ($28) and the stack pointer ($29). This can change pointer ($28) and the stack pointer ($29). This can change
...@@ -1178,7 +1184,9 @@ extern const struct mips_rtx_cost_data *mips_cost; ...@@ -1178,7 +1184,9 @@ extern const struct mips_rtx_cost_data *mips_cost;
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
/* COP3 registers */ \ /* COP3 registers */ \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
/* 6 DSP accumulator registers & 6 control registers */ \
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 \
} }
...@@ -1208,7 +1216,9 @@ extern const struct mips_rtx_cost_data *mips_cost; ...@@ -1208,7 +1216,9 @@ extern const struct mips_rtx_cost_data *mips_cost;
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
/* COP3 registers */ \ /* COP3 registers */ \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
/* 6 DSP accumulator registers & 6 control registers */ \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \
} }
...@@ -1231,7 +1241,9 @@ extern const struct mips_rtx_cost_data *mips_cost; ...@@ -1231,7 +1241,9 @@ extern const struct mips_rtx_cost_data *mips_cost;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* COP3 registers */ \ /* COP3 registers */ \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 6 DSP accumulator registers & 6 control registers */ \
1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 \
} }
/* Internal macros to classify a register number as to whether it's a /* Internal macros to classify a register number as to whether it's a
...@@ -1273,9 +1285,19 @@ extern const struct mips_rtx_cost_data *mips_cost; ...@@ -1273,9 +1285,19 @@ extern const struct mips_rtx_cost_data *mips_cost;
/* ALL_COP_REG_NUM assumes that COP0,2,and 3 are numbered consecutively. */ /* ALL_COP_REG_NUM assumes that COP0,2,and 3 are numbered consecutively. */
#define ALL_COP_REG_NUM (COP3_REG_LAST - COP0_REG_FIRST + 1) #define ALL_COP_REG_NUM (COP3_REG_LAST - COP0_REG_FIRST + 1)
#define DSP_ACC_REG_FIRST 176
#define DSP_ACC_REG_LAST 181
#define DSP_ACC_REG_NUM (DSP_ACC_REG_LAST - DSP_ACC_REG_FIRST + 1)
#define AT_REGNUM (GP_REG_FIRST + 1) #define AT_REGNUM (GP_REG_FIRST + 1)
#define HI_REGNUM (MD_REG_FIRST + 0) #define HI_REGNUM (MD_REG_FIRST + 0)
#define LO_REGNUM (MD_REG_FIRST + 1) #define LO_REGNUM (MD_REG_FIRST + 1)
#define AC1HI_REGNUM (DSP_ACC_REG_FIRST + 0)
#define AC1LO_REGNUM (DSP_ACC_REG_FIRST + 1)
#define AC2HI_REGNUM (DSP_ACC_REG_FIRST + 2)
#define AC2LO_REGNUM (DSP_ACC_REG_FIRST + 3)
#define AC3HI_REGNUM (DSP_ACC_REG_FIRST + 4)
#define AC3LO_REGNUM (DSP_ACC_REG_FIRST + 5)
/* FPSW_REGNUM is the single condition code used if !ISA_HAS_8CC. /* FPSW_REGNUM is the single condition code used if !ISA_HAS_8CC.
If ISA_HAS_8CC, it should not be used, and an arbitrary ST_REG If ISA_HAS_8CC, it should not be used, and an arbitrary ST_REG
...@@ -1300,6 +1322,16 @@ extern const struct mips_rtx_cost_data *mips_cost; ...@@ -1300,6 +1322,16 @@ extern const struct mips_rtx_cost_data *mips_cost;
((unsigned int) ((int) (REGNO) - COP3_REG_FIRST) < COP3_REG_NUM) ((unsigned int) ((int) (REGNO) - COP3_REG_FIRST) < COP3_REG_NUM)
#define ALL_COP_REG_P(REGNO) \ #define ALL_COP_REG_P(REGNO) \
((unsigned int) ((int) (REGNO) - COP0_REG_FIRST) < ALL_COP_REG_NUM) ((unsigned int) ((int) (REGNO) - COP0_REG_FIRST) < ALL_COP_REG_NUM)
/* Test if REGNO is one of the 6 new DSP accumulators. */
#define DSP_ACC_REG_P(REGNO) \
((unsigned int) ((int) (REGNO) - DSP_ACC_REG_FIRST) < DSP_ACC_REG_NUM)
/* Test if REGNO is hi, lo, or one of the 6 new DSP accumulators. */
#define ACC_REG_P(REGNO) \
(MD_REG_P (REGNO) || DSP_ACC_REG_P (REGNO))
/* Test if REGNO is HI or the first register of 3 new DSP accumulator pairs. */
#define ACC_HI_REG_P(REGNO) \
((REGNO) == HI_REGNUM || (REGNO) == AC1HI_REGNUM || (REGNO) == AC2HI_REGNUM \
|| (REGNO) == AC3HI_REGNUM)
#define FP_REG_RTX_P(X) (REG_P (X) && FP_REG_P (REGNO (X))) #define FP_REG_RTX_P(X) (REG_P (X) && FP_REG_P (REGNO (X)))
...@@ -1442,6 +1474,8 @@ enum reg_class ...@@ -1442,6 +1474,8 @@ enum reg_class
ALL_COP_REGS, ALL_COP_REGS,
ALL_COP_AND_GR_REGS, ALL_COP_AND_GR_REGS,
ST_REGS, /* status registers (fp status) */ ST_REGS, /* status registers (fp status) */
DSP_ACC_REGS, /* DSP accumulator registers */
ACC_REGS, /* Hi/Lo and DSP accumulator registers */
ALL_REGS, /* all registers */ ALL_REGS, /* all registers */
LIM_REG_CLASSES /* max value + 1 */ LIM_REG_CLASSES /* max value + 1 */
}; };
...@@ -1482,6 +1516,8 @@ enum reg_class ...@@ -1482,6 +1516,8 @@ enum reg_class
"ALL_COP_REGS", \ "ALL_COP_REGS", \
"ALL_COP_AND_GR_REGS", \ "ALL_COP_AND_GR_REGS", \
"ST_REGS", \ "ST_REGS", \
"DSP_ACC_REGS", \
"ACC_REGS", \
"ALL_REGS" \ "ALL_REGS" \
} }
...@@ -1523,7 +1559,9 @@ enum reg_class ...@@ -1523,7 +1559,9 @@ enum reg_class
{ 0x00000000, 0x00000000, 0xffff0000, 0xffffffff, 0xffffffff, 0x0000ffff }, \ { 0x00000000, 0x00000000, 0xffff0000, 0xffffffff, 0xffffffff, 0x0000ffff }, \
{ 0xffffffff, 0x00000000, 0xffff0000, 0xffffffff, 0xffffffff, 0x0000ffff }, \ { 0xffffffff, 0x00000000, 0xffff0000, 0xffffffff, 0xffffffff, 0x0000ffff }, \
{ 0x00000000, 0x00000000, 0x000007f8, 0x00000000, 0x00000000, 0x00000000 }, /* status registers */ \ { 0x00000000, 0x00000000, 0x000007f8, 0x00000000, 0x00000000, 0x00000000 }, /* status registers */ \
{ 0xffffffff, 0xffffffff, 0xffff07ff, 0xffffffff, 0xffffffff, 0x0000ffff } /* all registers */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003f0000 }, /* dsp accumulator registers */ \
{ 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x003f0000 }, /* hi/lo and dsp accumulator registers */ \
{ 0xffffffff, 0xffffffff, 0xffff07ff, 0xffffffff, 0xffffffff, 0x0fffffff } /* all registers */ \
} }
...@@ -1584,7 +1622,8 @@ extern const enum reg_class mips_regno_to_class[]; ...@@ -1584,7 +1622,8 @@ extern const enum reg_class mips_regno_to_class[];
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, \ 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, \
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, \ 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, \
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, \ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, \
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175 \ 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, \
176,177,178,179,180,181,182,183,184,185,186,187 \
} }
/* ORDER_REGS_FOR_LOCAL_ALLOC is a macro which permits reg_alloc_order /* ORDER_REGS_FOR_LOCAL_ALLOC is a macro which permits reg_alloc_order
...@@ -1615,12 +1654,24 @@ extern const enum reg_class mips_regno_to_class[]; ...@@ -1615,12 +1654,24 @@ extern const enum reg_class mips_regno_to_class[];
'B' Cop0 register 'B' Cop0 register
'C' Cop2 register 'C' Cop2 register
'D' Cop3 register 'D' Cop3 register
'A' DSP accumulator registers
'a' MD registers and DSP accumulator registers
'b' All registers */ 'b' All registers */
extern enum reg_class mips_char_to_class[256]; extern enum reg_class mips_char_to_class[256];
#define REG_CLASS_FROM_LETTER(C) mips_char_to_class[(unsigned char)(C)] #define REG_CLASS_FROM_LETTER(C) mips_char_to_class[(unsigned char)(C)]
/* True if VALUE is a unsigned 6-bit number. */
#define UIMM6_OPERAND(VALUE) \
(((VALUE) & ~(unsigned HOST_WIDE_INT) 0x3f) == 0)
/* True if VALUE is a signed 10-bit number. */
#define IMM10_OPERAND(VALUE) \
((unsigned HOST_WIDE_INT) (VALUE) + 0x200 < 0x400)
/* True if VALUE is a signed 16-bit number. */ /* True if VALUE is a signed 16-bit number. */
#define SMALL_OPERAND(VALUE) \ #define SMALL_OPERAND(VALUE) \
...@@ -1718,11 +1769,17 @@ extern enum reg_class mips_char_to_class[256]; ...@@ -1718,11 +1769,17 @@ extern enum reg_class mips_char_to_class[256];
This is true for all non-mips16 references (although it can sometimes This is true for all non-mips16 references (although it can sometimes
be indirect if !TARGET_EXPLICIT_RELOCS). For mips16, it excludes be indirect if !TARGET_EXPLICIT_RELOCS). For mips16, it excludes
stack and constant-pool references. stack and constant-pool references.
`YG' is for 0 valued vector constants. */ `YG' is for 0 valued vector constants.
`YA' is for unsigned 6-bit constants.
`YB' is for signed 10-bit constants. */
#define EXTRA_CONSTRAINT_Y(OP,STR) \ #define EXTRA_CONSTRAINT_Y(OP,STR) \
(((STR)[1] == 'G') ? (GET_CODE (OP) == CONST_VECTOR \ (((STR)[1] == 'G') ? (GET_CODE (OP) == CONST_VECTOR \
&& (OP) == CONST0_RTX (GET_MODE (OP))) \ && (OP) == CONST0_RTX (GET_MODE (OP))) \
: ((STR)[1] == 'A') ? (GET_CODE (OP) == CONST_INT \
&& UIMM6_OPERAND (INTVAL (OP))) \
: ((STR)[1] == 'B') ? (GET_CODE (OP) == CONST_INT \
&& IMM10_OPERAND (INTVAL (OP))) \
: FALSE) : FALSE)
...@@ -2386,7 +2443,9 @@ typedef struct mips_args { ...@@ -2386,7 +2443,9 @@ typedef struct mips_args {
"$c3r0", "$c3r1", "$c3r2", "$c3r3", "$c3r4", "$c3r5", "$c3r6", "$c3r7", \ "$c3r0", "$c3r1", "$c3r2", "$c3r3", "$c3r4", "$c3r5", "$c3r6", "$c3r7", \
"$c3r8", "$c3r9", "$c3r10","$c3r11","$c3r12","$c3r13","$c3r14","$c3r15", \ "$c3r8", "$c3r9", "$c3r10","$c3r11","$c3r12","$c3r13","$c3r14","$c3r15", \
"$c3r16","$c3r17","$c3r18","$c3r19","$c3r20","$c3r21","$c3r22","$c3r23", \ "$c3r16","$c3r17","$c3r18","$c3r19","$c3r20","$c3r21","$c3r22","$c3r23", \
"$c3r24","$c3r25","$c3r26","$c3r27","$c3r28","$c3r29","$c3r30","$c3r31" } "$c3r24","$c3r25","$c3r26","$c3r27","$c3r28","$c3r29","$c3r30","$c3r31", \
"$ac1hi","$ac1lo","$ac2hi","$ac2lo","$ac3hi","$ac3lo","$dsp_po","$dsp_sc", \
"$dsp_ca","$dsp_ou","$dsp_cc","$dsp_ef" }
/* List the "software" names for each register. Also list the numerical /* List the "software" names for each register. Also list the numerical
names for $fp and $sp. */ names for $fp and $sp. */
......
...@@ -72,6 +72,76 @@ ...@@ -72,6 +72,76 @@
(UNSPEC_RSQRT2 209) (UNSPEC_RSQRT2 209)
(UNSPEC_RECIP1 210) (UNSPEC_RECIP1 210)
(UNSPEC_RECIP2 211) (UNSPEC_RECIP2 211)
;; MIPS DSP ASE Revision 0.98 3/24/2005
(UNSPEC_ADDQ 300)
(UNSPEC_ADDQ_S 301)
(UNSPEC_SUBQ 302)
(UNSPEC_SUBQ_S 303)
(UNSPEC_ADDSC 304)
(UNSPEC_ADDWC 305)
(UNSPEC_MODSUB 306)
(UNSPEC_RADDU_W_QB 307)
(UNSPEC_ABSQ_S 308)
(UNSPEC_PRECRQ_QB_PH 309)
(UNSPEC_PRECRQ_PH_W 310)
(UNSPEC_PRECRQ_RS_PH_W 311)
(UNSPEC_PRECRQU_S_QB_PH 312)
(UNSPEC_PRECEQ_W_PHL 313)
(UNSPEC_PRECEQ_W_PHR 314)
(UNSPEC_PRECEQU_PH_QBL 315)
(UNSPEC_PRECEQU_PH_QBR 316)
(UNSPEC_PRECEQU_PH_QBLA 317)
(UNSPEC_PRECEQU_PH_QBRA 318)
(UNSPEC_PRECEU_PH_QBL 319)
(UNSPEC_PRECEU_PH_QBR 320)
(UNSPEC_PRECEU_PH_QBLA 321)
(UNSPEC_PRECEU_PH_QBRA 322)
(UNSPEC_SHLL 323)
(UNSPEC_SHLL_S 324)
(UNSPEC_SHRL_QB 325)
(UNSPEC_SHRA_PH 326)
(UNSPEC_SHRA_R 327)
(UNSPEC_MULEU_S_PH_QBL 328)
(UNSPEC_MULEU_S_PH_QBR 329)
(UNSPEC_MULQ_RS_PH 330)
(UNSPEC_MULEQ_S_W_PHL 331)
(UNSPEC_MULEQ_S_W_PHR 332)
(UNSPEC_DPAU_H_QBL 333)
(UNSPEC_DPAU_H_QBR 334)
(UNSPEC_DPSU_H_QBL 335)
(UNSPEC_DPSU_H_QBR 336)
(UNSPEC_DPAQ_S_W_PH 337)
(UNSPEC_DPSQ_S_W_PH 338)
(UNSPEC_MULSAQ_S_W_PH 339)
(UNSPEC_DPAQ_SA_L_W 340)
(UNSPEC_DPSQ_SA_L_W 341)
(UNSPEC_MAQ_S_W_PHL 342)
(UNSPEC_MAQ_S_W_PHR 343)
(UNSPEC_MAQ_SA_W_PHL 344)
(UNSPEC_MAQ_SA_W_PHR 345)
(UNSPEC_BITREV 346)
(UNSPEC_INSV 347)
(UNSPEC_REPL_QB 348)
(UNSPEC_REPL_PH 349)
(UNSPEC_CMP_EQ 350)
(UNSPEC_CMP_LT 351)
(UNSPEC_CMP_LE 352)
(UNSPEC_CMPGU_EQ_QB 353)
(UNSPEC_CMPGU_LT_QB 354)
(UNSPEC_CMPGU_LE_QB 355)
(UNSPEC_PICK 356)
(UNSPEC_PACKRL_PH 357)
(UNSPEC_EXTR_W 358)
(UNSPEC_EXTR_R_W 359)
(UNSPEC_EXTR_RS_W 360)
(UNSPEC_EXTR_S_H 361)
(UNSPEC_EXTP 362)
(UNSPEC_EXTPDP 363)
(UNSPEC_SHILO 364)
(UNSPEC_MTHLIP 365)
(UNSPEC_WRDSP 366)
(UNSPEC_RDDSP 367)
] ]
) )
...@@ -3124,8 +3194,8 @@ ...@@ -3124,8 +3194,8 @@
(set_attr "mode" "<MODE>")]) (set_attr "mode" "<MODE>")])
(define_insn "*movdi_32bit" (define_insn "*movdi_32bit"
[(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,m,*x,*d,*B*C*D,*B*C*D,*d,*m") [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,m,*a,*d,*B*C*D,*B*C*D,*d,*m")
(match_operand:DI 1 "move_operand" "d,i,m,d,*J*d,*x,*d,*m,*B*C*D,*B*C*D"))] (match_operand:DI 1 "move_operand" "d,i,m,d,*J*d,*a,*d,*m,*B*C*D,*B*C*D"))]
"!TARGET_64BIT && !TARGET_MIPS16 "!TARGET_64BIT && !TARGET_MIPS16
&& (register_operand (operands[0], DImode) && (register_operand (operands[0], DImode)
|| reg_or_0_operand (operands[1], DImode))" || reg_or_0_operand (operands[1], DImode))"
...@@ -3242,15 +3312,15 @@ ...@@ -3242,15 +3312,15 @@
;; in FP registers (off by default, use -mdebugh to enable). ;; in FP registers (off by default, use -mdebugh to enable).
(define_insn "*movsi_internal" (define_insn "*movsi_internal"
[(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,e,d,m,*f,*f,*f,*d,*m,*d,*z,*x,*B*C*D,*B*C*D,*d,*m") [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,e,d,m,*f,*f,*f,*d,*m,*d,*z,*a,*d,*B*C*D,*B*C*D,*d,*m")
(match_operand:SI 1 "move_operand" "d,U,T,m,dJ,*f,*d*J,*m,*f,*f,*z,*d,*J*d,*d,*m,*B*C*D,*B*C*D"))] (match_operand:SI 1 "move_operand" "d,U,T,m,dJ,*f,*d*J,*m,*f,*f,*z,*d,*J*d,*A,*d,*m,*B*C*D,*B*C*D"))]
"!TARGET_MIPS16 "!TARGET_MIPS16
&& (register_operand (operands[0], SImode) && (register_operand (operands[0], SImode)
|| reg_or_0_operand (operands[1], SImode))" || reg_or_0_operand (operands[1], SImode))"
{ return mips_output_move (operands[0], operands[1]); } { return mips_output_move (operands[0], operands[1]); }
[(set_attr "type" "arith,const,const,load,store,fmove,xfer,fpload,xfer,fpstore,xfer,xfer,mthilo,xfer,load,xfer,store") [(set_attr "type" "arith,const,const,load,store,fmove,xfer,fpload,xfer,fpstore,xfer,xfer,mthilo,mfhilo,xfer,load,xfer,store")
(set_attr "mode" "SI") (set_attr "mode" "SI")
(set_attr "length" "4,*,*,*,*,4,4,*,4,*,4,4,4,4,*,4,*")]) (set_attr "length" "4,*,*,*,*,4,4,*,4,*,4,4,4,4,4,*,4,*")])
(define_insn "*movsi_mips16" (define_insn "*movsi_mips16"
[(set (match_operand:SI 0 "nonimmediate_operand" "=d,y,d,d,d,d,d,m") [(set (match_operand:SI 0 "nonimmediate_operand" "=d,y,d,d,d,d,d,m")
...@@ -5353,3 +5423,7 @@ ...@@ -5353,3 +5423,7 @@
; The MIPS Paired-Single Floating Point and MIPS-3D Instructions. ; The MIPS Paired-Single Floating Point and MIPS-3D Instructions.
(include "mips-ps-3d.md") (include "mips-ps-3d.md")
; The MIPS DSP Instructions.
(include "mips-dsp.md")
...@@ -55,6 +55,10 @@ mdouble-float ...@@ -55,6 +55,10 @@ mdouble-float
Target Report RejectNegative InverseMask(SINGLE_FLOAT, DOUBLE_FLOAT) Target Report RejectNegative InverseMask(SINGLE_FLOAT, DOUBLE_FLOAT)
Allow hardware floating-point instructions to cover both 32-bit and 64-bit operations Allow hardware floating-point instructions to cover both 32-bit and 64-bit operations
mdsp
Target Report Mask(DSP)
Use MIPS-DSP instructions
mdebug mdebug
Target Var(TARGET_DEBUG_MODE) Undocumented Target Var(TARGET_DEBUG_MODE) Undocumented
......
...@@ -34,6 +34,18 @@ ...@@ -34,6 +34,18 @@
(ior (match_operand 0 "const_arith_operand") (ior (match_operand 0 "const_arith_operand")
(match_operand 0 "register_operand"))) (match_operand 0 "register_operand")))
(define_predicate "const_uimm6_operand"
(and (match_code "const_int")
(match_test "UIMM6_OPERAND (INTVAL (op))")))
(define_predicate "const_imm10_operand"
(and (match_code "const_int")
(match_test "IMM10_OPERAND (INTVAL (op))")))
(define_predicate "reg_imm10_operand"
(ior (match_operand 0 "const_imm10_operand")
(match_operand 0 "register_operand")))
(define_predicate "sle_operand" (define_predicate "sle_operand"
(and (match_code "const_int") (and (match_code "const_int")
(match_test "SMALL_OPERAND (INTVAL (op) + 1)"))) (match_test "SMALL_OPERAND (INTVAL (op) + 1)")))
......
...@@ -5777,6 +5777,7 @@ instructions, but allow the compiler to schedule those calls. ...@@ -5777,6 +5777,7 @@ instructions, but allow the compiler to schedule those calls.
* Blackfin Built-in Functions:: * Blackfin Built-in Functions::
* FR-V Built-in Functions:: * FR-V Built-in Functions::
* X86 Built-in Functions:: * X86 Built-in Functions::
* MIPS DSP Built-in Functions::
* MIPS Paired-Single Support:: * MIPS Paired-Single Support::
* PowerPC AltiVec Built-in Functions:: * PowerPC AltiVec Built-in Functions::
* SPARC VIS Built-in Functions:: * SPARC VIS Built-in Functions::
...@@ -6676,6 +6677,208 @@ v2sf __builtin_ia32_pswapdsf (v2sf) ...@@ -6676,6 +6677,208 @@ v2sf __builtin_ia32_pswapdsf (v2sf)
v2si __builtin_ia32_pswapdsi (v2si) v2si __builtin_ia32_pswapdsi (v2si)
@end smallexample @end smallexample
@node MIPS DSP Built-in Functions
@subsection MIPS DSP Built-in Functions
The MIPS DSP Application-Specific Extension (ASE) includes new
instructions that are designed to improve the performance of DSP and
media applications. It provides instructions that operate on packed
8-bit integer data, Q15 fractional data and Q31 fractional data.
GCC supports MIPS DSP operations using both the generic
vector extensions (@pxref{Vector Extensions}) and a collection of
MIPS-specific built-in functions. Both kinds of support are
enabled by the @option{-mdsp} command-line option.
At present, GCC only provides support for operations on 32-bit
vectors. The vector type associated with 8-bit integer data is
usually called @code{v4i8} and the vector type associated with Q15 is
usually called @code{v2q15}. They can be defined in C as follows:
@smallexample
typedef char v4i8 __attribute__ ((vector_size(4)));
typedef short v2q15 __attribute__ ((vector_size(4)));
@end smallexample
@code{v4i8} and @code{v2q15} values are initialized in the same way as
aggregates. For example:
@smallexample
v4i8 a = @{1, 2, 3, 4@};
v4i8 b;
b = (v4i8) @{5, 6, 7, 8@};
v2q15 c = @{0x0fcb, 0x3a75@};
v2q15 d;
d = (v2q15) @{0.1234 * 0x1.0p15, 0.4567 * 0x1.0p15@};
@end smallexample
@emph{Note:} The CPU's endianness determines the order in which values
are packed. On little-endian targets, the first value is the least
significant and the last value is the most significant. The opposite
order applies to big-endian targets. For example, the code above will
set the lowest byte of @code{a} to @code{1} on little-endian targets
and @code{4} on big-endian targets.
@emph{Note:} Q15 and Q31 values must be initialized with their integer
representation. As shown in this example, the integer representation
of a Q15 value can be obtained by multiplying the fractional value by
@code{0x1.0p15}. The equivalent for Q31 values is to multiply by
@code{0x1.0p31}.
The table below lists the @code{v4i8} and @code{v2q15} operations for which
hardware support exists. @code{a} and @code{b} are @code{v4i8} values,
and @code{c} and @code{d} are @code{v2q15} values.
@multitable @columnfractions .50 .50
@item C code @tab MIPS instruction
@item @code{a + b} @tab @code{addu.qb}
@item @code{c + d} @tab @code{addq.ph}
@item @code{a - b} @tab @code{subu.qb}
@item @code{c - d} @tab @code{subq.ph}
@end multitable
It is easier to describe the DSP built-in functions if we first define
the following types:
@smallexample
typedef int q31;
typedef int i32;
typedef long long a64;
@end smallexample
@code{q31} and @code{i32} are actually the same as @code{int}, but we
use @code{q31} to indicate a Q31 fractional value and @code{i32} to
indicate a 32-bit integer value. Similarly, @code{a64} is the same as
@code{long long}, but we use @code{a64} to indicate values that will
be placed in one of the four DSP accumulators (@code{$ac0},
@code{$ac1}, @code{$ac2} or @code{$ac3}).
Also, some built-in functions prefer or require immediate numbers as
parameters, because the corresponding DSP instructions accept both immediate
numbers and register operands, or accept immediate numbers only. The
immediate parameters are listed as follows.
@smallexample
imm0_7: 0 to 7.
imm0_15: 0 to 15.
imm0_31: 0 to 31.
imm0_63: 0 to 63.
imm0_255: 0 to 255.
imm_n32_31: -32 to 31.
imm_n512_511: -512 to 511.
@end smallexample
The following built-in functions map directly to a particular MIPS DSP
instruction. Please refer to the architecture specification
for details on what each instruction does.
@smallexample
v2q15 __builtin_mips_addq_ph (v2q15, v2q15)
v2q15 __builtin_mips_addq_s_ph (v2q15, v2q15)
q31 __builtin_mips_addq_s_w (q31, q31)
v4i8 __builtin_mips_addu_qb (v4i8, v4i8)
v4i8 __builtin_mips_addu_s_qb (v4i8, v4i8)
v2q15 __builtin_mips_subq_ph (v2q15, v2q15)
v2q15 __builtin_mips_subq_s_ph (v2q15, v2q15)
q31 __builtin_mips_subq_s_w (q31, q31)
v4i8 __builtin_mips_subu_qb (v4i8, v4i8)
v4i8 __builtin_mips_subu_s_qb (v4i8, v4i8)
i32 __builtin_mips_addsc (i32, i32)
i32 __builtin_mips_addwc (i32, i32)
i32 __builtin_mips_modsub (i32, i32)
i32 __builtin_mips_raddu_w_qb (v4i8)
v2q15 __builtin_mips_absq_s_ph (v2q15)
q31 __builtin_mips_absq_s_w (q31)
v4i8 __builtin_mips_precrq_qb_ph (v2q15, v2q15)
v2q15 __builtin_mips_precrq_ph_w (q31, q31)
v2q15 __builtin_mips_precrq_rs_ph_w (q31, q31)
v4i8 __builtin_mips_precrqu_s_qb_ph (v2q15, v2q15)
q31 __builtin_mips_preceq_w_phl (v2q15)
q31 __builtin_mips_preceq_w_phr (v2q15)
v2q15 __builtin_mips_precequ_ph_qbl (v4i8)
v2q15 __builtin_mips_precequ_ph_qbr (v4i8)
v2q15 __builtin_mips_precequ_ph_qbla (v4i8)
v2q15 __builtin_mips_precequ_ph_qbra (v4i8)
v2q15 __builtin_mips_preceu_ph_qbl (v4i8)
v2q15 __builtin_mips_preceu_ph_qbr (v4i8)
v2q15 __builtin_mips_preceu_ph_qbla (v4i8)
v2q15 __builtin_mips_preceu_ph_qbra (v4i8)
v4i8 __builtin_mips_shll_qb (v4i8, imm0_7)
v4i8 __builtin_mips_shll_qb (v4i8, i32)
v2q15 __builtin_mips_shll_ph (v2q15, imm0_15)
v2q15 __builtin_mips_shll_ph (v2q15, i32)
v2q15 __builtin_mips_shll_s_ph (v2q15, imm0_15)
v2q15 __builtin_mips_shll_s_ph (v2q15, i32)
q31 __builtin_mips_shll_s_w (q31, imm0_31)
q31 __builtin_mips_shll_s_w (q31, i32)
v4i8 __builtin_mips_shrl_qb (v4i8, imm0_7)
v4i8 __builtin_mips_shrl_qb (v4i8, i32)
v2q15 __builtin_mips_shra_ph (v2q15, imm0_15)
v2q15 __builtin_mips_shra_ph (v2q15, i32)
v2q15 __builtin_mips_shra_r_ph (v2q15, imm0_15)
v2q15 __builtin_mips_shra_r_ph (v2q15, i32)
q31 __builtin_mips_shra_r_w (q31, imm0_31)
q31 __builtin_mips_shra_r_w (q31, i32)
v2q15 __builtin_mips_muleu_s_ph_qbl (v4i8, v2q15)
v2q15 __builtin_mips_muleu_s_ph_qbr (v4i8, v2q15)
v2q15 __builtin_mips_mulq_rs_ph (v2q15, v2q15)
q31 __builtin_mips_muleq_s_w_phl (v2q15, v2q15)
q31 __builtin_mips_muleq_s_w_phr (v2q15, v2q15)
a64 __builtin_mips_dpau_h_qbl (a64, v4i8, v4i8)
a64 __builtin_mips_dpau_h_qbr (a64, v4i8, v4i8)
a64 __builtin_mips_dpsu_h_qbl (a64, v4i8, v4i8)
a64 __builtin_mips_dpsu_h_qbr (a64, v4i8, v4i8)
a64 __builtin_mips_dpaq_s_w_ph (a64, v2q15, v2q15)
a64 __builtin_mips_dpaq_sa_l_w (a64, q31, q31)
a64 __builtin_mips_dpsq_s_w_ph (a64, v2q15, v2q15)
a64 __builtin_mips_dpsq_sa_l_w (a64, q31, q31)
a64 __builtin_mips_mulsaq_s_w_ph (a64, v2q15, v2q15)
a64 __builtin_mips_maq_s_w_phl (a64, v2q15, v2q15)
a64 __builtin_mips_maq_s_w_phr (a64, v2q15, v2q15)
a64 __builtin_mips_maq_sa_w_phl (a64, v2q15, v2q15)
a64 __builtin_mips_maq_sa_w_phr (a64, v2q15, v2q15)
i32 __builtin_mips_bitrev (i32)
i32 __builtin_mips_insv (i32, i32)
v4i8 __builtin_mips_repl_qb (imm0_255)
v4i8 __builtin_mips_repl_qb (i32)
v2q15 __builtin_mips_repl_ph (imm_n512_511)
v2q15 __builtin_mips_repl_ph (i32)
void __builtin_mips_cmpu_eq_qb (v4i8, v4i8)
void __builtin_mips_cmpu_lt_qb (v4i8, v4i8)
void __builtin_mips_cmpu_le_qb (v4i8, v4i8)
i32 __builtin_mips_cmpgu_eq_qb (v4i8, v4i8)
i32 __builtin_mips_cmpgu_lt_qb (v4i8, v4i8)
i32 __builtin_mips_cmpgu_le_qb (v4i8, v4i8)
void __builtin_mips_cmp_eq_ph (v2q15, v2q15)
void __builtin_mips_cmp_lt_ph (v2q15, v2q15)
void __builtin_mips_cmp_le_ph (v2q15, v2q15)
v4i8 __builtin_mips_pick_qb (v4i8, v4i8)
v2q15 __builtin_mips_pick_ph (v2q15, v2q15)
v2q15 __builtin_mips_packrl_ph (v2q15, v2q15)
i32 __builtin_mips_extr_w (a64, imm0_31)
i32 __builtin_mips_extr_w (a64, i32)
i32 __builtin_mips_extr_r_w (a64, imm0_31)
i32 __builtin_mips_extr_s_h (a64, i32)
i32 __builtin_mips_extr_rs_w (a64, imm0_31)
i32 __builtin_mips_extr_rs_w (a64, i32)
i32 __builtin_mips_extr_s_h (a64, imm0_31)
i32 __builtin_mips_extr_r_w (a64, i32)
i32 __builtin_mips_extp (a64, imm0_31)
i32 __builtin_mips_extp (a64, i32)
i32 __builtin_mips_extpdp (a64, imm0_31)
i32 __builtin_mips_extpdp (a64, i32)
a64 __builtin_mips_shilo (a64, imm_n32_31)
a64 __builtin_mips_shilo (a64, i32)
a64 __builtin_mips_mthlip (a64, i32)
void __builtin_mips_wrdsp (i32, imm0_63)
i32 __builtin_mips_rddsp (imm0_63)
i32 __builtin_mips_lbux (void *, i32)
i32 __builtin_mips_lhx (void *, i32)
i32 __builtin_mips_lwx (void *, i32)
i32 __builtin_mips_bposge32 (void)
@end smallexample
@node MIPS Paired-Single Support @node MIPS Paired-Single Support
@subsection MIPS Paired-Single Support @subsection MIPS Paired-Single Support
......
...@@ -572,7 +572,7 @@ Objective-C and Objective-C++ Dialects}. ...@@ -572,7 +572,7 @@ Objective-C and Objective-C++ Dialects}.
-mips16 -mno-mips16 -mabi=@var{abi} -mabicalls -mno-abicalls @gol -mips16 -mno-mips16 -mabi=@var{abi} -mabicalls -mno-abicalls @gol
-mxgot -mno-xgot -mgp32 -mgp64 -mfp32 -mfp64 @gol -mxgot -mno-xgot -mgp32 -mgp64 -mfp32 -mfp64 @gol
-mhard-float -msoft-float -msingle-float -mdouble-float @gol -mhard-float -msoft-float -msingle-float -mdouble-float @gol
-mpaired-single -mips3d @gol -mdsp -mpaired-single -mips3d @gol
-mlong64 -mlong32 -msym32 -mno-sym32 @gol -mlong64 -mlong32 -msym32 -mno-sym32 @gol
-G@var{num} -membedded-data -mno-embedded-data @gol -G@var{num} -membedded-data -mno-embedded-data @gol
-muninit-const-in-rodata -mno-uninit-const-in-rodata @gol -muninit-const-in-rodata -mno-uninit-const-in-rodata @gol
...@@ -10065,6 +10065,12 @@ operations. ...@@ -10065,6 +10065,12 @@ operations.
Assume that the floating-point coprocessor supports double-precision Assume that the floating-point coprocessor supports double-precision
operations. This is the default. operations. This is the default.
@itemx -mdsp
@itemx -mno-dsp
@opindex mdsp
@opindex mno-dsp
Use (do not use) the MIPS DSP ASE. @xref{MIPS DSP Built-in Functions}.
@itemx -mpaired-single @itemx -mpaired-single
@itemx -mno-paired-single @itemx -mno-paired-single
@opindex mpaired-single @opindex mpaired-single
......
2005-07-23 Chao-ying Fu <fu@mips.com>
* gcc.target/mips/mips32-dsp-type.c: New test.
* gcc.target/mips/mips32-dsp.c: New test.
2005-07-23 Oyvind Harboe <oyvind.harboe@zylin.com> 2005-07-23 Oyvind Harboe <oyvind.harboe@zylin.com>
PR testsuite/21073 PR testsuite/21073
......
/* Test MIPS32 DSP instructions */
/* { dg-do compile } */
/* { dg-mips-options "-mips32 -mdsp" } */
/* { dg-final { scan-assembler "addq.ph" } } */
/* { dg-final { scan-assembler "addu.qb" } } */
/* { dg-final { scan-assembler "subq.ph" } } */
/* { dg-final { scan-assembler "subu.qb" } } */
typedef char v4qi __attribute__ ((vector_size(4)));
typedef short v2hi __attribute__ ((vector_size(4)));
v2hi add_v2hi (v2hi a, v2hi b)
{
return a + b;
}
v4qi add_v4qi (v4qi a, v4qi b)
{
return a + b;
}
v2hi sub_v2hi (v2hi a, v2hi b)
{
return a - b;
}
v4qi sub_v4qi (v4qi a, v4qi b)
{
return a - b;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment