summaryrefslogtreecommitdiff
path: root/gcc/config/sparc/sparc-c.c
Commit message (Collapse)AuthorAgeFilesLines
* Start adding support for VIS 3.0 instructions.David S. Miller2011-10-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc/ * config/sparc/sparc.opt (VIS3): New option. * doc/invoke.texi: Document it. * config/sparc/sparc.h: Force TARGET_VIS3 to zero if assembler is not capable of such instructions. * config/sparc/sparc-c.c (sparc_target_macros): Define __VIS__ to 0x300 when TARGET_VIS3. * config/sparc/sparc-modes.def: Create 16-byte vector modes. * config/sparc/sparc.md (UNSPEC_CMASK8, UNSPEC_CMASK16, UNSPEC_CMASK32, UNSPEC_FCHKSM16, UNSPEC_PDISTN, UNSPC_FUCMP): New unspecs. (V64N8, VASS): New mode iterators. (vis3_shift, vis3_addsub_ss): New code iterators. (vbits, vconstr): New mode attributes. (vis3_shift_insn, vis3_addsub_ss_insn): New code attributes. (cmask8<P:mode>_vis, cmask16<P:mode>_vis, cmask32<P:mode>_vis, fchksm16_vis, <vis3_shift_insn><vbits>_vis, pdistn<mode>_vis, fmean16_vis, fpadd64_vis, fpsub64_vis, <vis3_addsub_ss_insn><vbits>_vis, fucmp<code>8<P:mode>_vis): New VIS 3.0 instruction patterns. * config/sparc/sparc.c (sparc_option_override): Set MASK_VIS3 by default when targetting capable cpus. TARGET_VIS3 implies TARGET_VIS2 and TARGET_VIS, and clear them when TARGET_FPU is disabled. (sparc_vis_init_builtins): Emit new VIS 3.0 builtins. (sparc_fold_builtin): Do not eliminate cmask{8,16,32} when result is ignored. * config/sparc/visintrin.h (__vis_cmask8, __vis_cmask16, __vis_cmask32, __vis_fchksm16, __vis_fsll16, __vis_fslas16, __vis_fsrl16, __vis_fsra16, __vis_fsll32, __vis_fslas32, __vis_fsrl32, __vis_fsra32, __vis_pdistn, __vis_fmean16, __vis_fpadd64, __vis_fpsub64, __vis_fpadds16, __vis_fpadds16s, __vis_fpsubs16, __vis_fpsubs16s, __vis_fpadds32, __vis_fpadds32s, __vis_fpsubs32, __vis_fpsubs32s, __vis_fucmple8, __vis_fucmpne8, __vis_fucmpgt8, __vis_fucmpeq8): New VIS 3.0 interfaces. * doc/extend.texi: Document new VIS 3.0 builtins. gcc/testsuite/ * gcc.target/sparc/cmask.c: New test. * gcc.target/sparc/fpadds.c: New test. * gcc.target/sparc/fshift.c: New test. * gcc.target/sparc/fucmp.c: New test. * gcc.target/sparc/vis3misc.c: New test. From-SVN: r179421
* Add sparc VIS 2.0 builtins, intrinsics, and option to control them.David S. Miller2011-09-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc/ * config/sparc/sparc.opt (VIS2): New option. * doc/invoke.texi: Document it. * config/sparc/sparc.md (UNSPEC_EDGE8N, UNSPEC_EDGE8LN, UNSPEC_EDGE16N, UNSPEC_EDGE16LN, UNSPEC_EDGE32N, UNSPEC_EDGE32LN, UNSPEC_BSHUFFLE): New unspecs. (define_attr type): New insn type 'edgen'. (bmask<P:mode>_vis, bshuffle<V64I:mode>_vis, edge8n<P:mode>_vis, edge8ln<P:mode>_vis, edge16n<P:mode>_vis, edge16ln<P:mode>_vis, edge32n<P:mode>_vis, edge32ln<P:mode>_vis): New insn VIS 2.0 patterns. * niagara.md: Handle edgen. * niagara2.md: Likewise. * ultra1_2.md: Likewise. * ultra3.md: Likewise. * config/sparc/sparc-c.c (sparc_target_macros): Define __VIS__ to 0x200 when TARGET_VIS2. * config/sparc/sparc.c (sparc_option_override): Set MASK_VIS2 by default when targetting capable cpus. TARGET_VIS2 implies TARGET_VIS, clear and it when TARGET_FPU is disabled. (sparc_vis_init_builtins): Emit new VIS 2.0 builtins. (sparc_expand_builtin): Fix predicate indexing when builtin returns void. (sparc_fold_builtin): Do not eliminate bmask when result is ignored. * config/sparc/visintrin.h (__vis_bmask, __vis_bshuffledi, __vis_bshufflev2si, __vis_bshufflev4hi, __vis_bshufflev8qi, __vis_edge8n, __vis_edge8ln, __vis_edge16n, __vis_edge16ln, __vis_edge32n, __vis_edge32ln): New VIS 2.0 interfaces. * doc/extend.texi: Document new VIS 2.0 builtins. gcc/testsuite/ * gcc.target/sparc/bmaskbshuf.c: New test. * gcc.target/sparc/edgen.c: New test. From-SVN: r179376
* Move target CPP macro handling to C file and add __VIS/__VIS__.David S. Miller2011-09-261-0/+53
* config/sparc/sparc-c.c: New file implementing sparc_target_macros, which will now define __VIS and __VIS__ when -mvis is enabled. * config/sparc/t-sparc: Likewise. * config.gcc: Add sparc-c.o to c_target_objs and cxx_target_objs, and add t-sparc to tmake_file for all sparc targets. * config/sparc/sparc-protos.h (sparc_target_macros): Declare. * config/sparc/sparc.h (TARGE_CPU_CPP_BUILTINS): Call it. From-SVN: r179210