Commit Graph

150103 Commits

Author SHA1 Message Date
Bernd Schmidt
8cac4d8587 common.opt (flimit-function-alignment): New.
gcc/
	* common.opt (flimit-function-alignment): New.
	* doc/invoke.texi (-flimit-function-alignment): Document.
	* emit-rtl.h (struct rtl_data): Add max_insn_address field.
	* final.c (shorten_branches): Set it.
	* varasm.c (assemble_start_function): Limit alignment if
	requested.

gcc/testsuite/
	* gcc.target/i386/align-limit.c: New test.

From-SVN: r242836
2016-11-24 12:54:56 +00:00
Richard Biener
eb2afa1a80 re PR tree-optimization/71595 (ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:704)
2016-11-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71595
	* cfgloopmanip.h (remove_path): Add irred_invalidated and
	loop_closed_ssa_invalidated parameters, defaulted to NULL.
	* cfgloopmanip.c (remove_path): Likewise, pass them along to
	called functions.  Only fix irred flags if the caller didn't
	request state.
	* tree-ssa-loop-ivcanon.c (unloop_loops): Use add_bb_to_loop.
	(unloop_loops): Pass irred_invalidated and loop_closed_ssa_invalidated
	to remove_path.

	* gcc.dg/torture/pr71595.c: New testcase.

From-SVN: r242835
2016-11-24 12:25:22 +00:00
Bernd Schmidt
2d8fec87b1 re PR rtl-optimization/78120 (If conversion no longer performed)
PR rtl-optimization/78120
	* ifcvt.c (noce_conversion_profitable_p): Check original cost in all
	cases, and additionally test against max_seq_cost for speed
	optimization.
	(noce_process_if_block): Compute an estimate for the original cost when
	optimizing for speed, using the minimum of then and else block costs.

testsuite/
	PR rtl-optimization/78120
	* gcc.target/i386/pr78120.c: New test.

From-SVN: r242834
2016-11-24 12:22:16 +00:00
Bernd Schmidt
334442f282 re PR rtl-optimization/78120 (If conversion no longer performed)
PR rtl-optimization/78120
	* rtlanal.c (insn_rtx_cost): Use set_rtx_cost.

From-SVN: r242833
2016-11-24 12:17:52 +00:00
Bernd Schmidt
7998af1f4b re PR rtl-optimization/78120 (If conversion no longer performed)
PR rtl-optimization/78120
	* config/i386/i386.c (ix86_rtx_costs): Fully handle SETs.

From-SVN: r242832
2016-11-24 12:16:47 +00:00
Bin Cheng
21aaaf1e05 match.pd: Refine type conversion in result expr for below pattern: (cond (cmp (convert1?
* match.pd: Refine type conversion in result expr for below pattern:
	(cond (cmp (convert1? x) c1) (convert2? x) c2) -> (minmax (x c)).

From-SVN: r242831
2016-11-24 12:09:19 +00:00
Eric Botcazou
3b08cde8dd re PR middle-end/78429 (ICE in set_value_range, at tree-vrp.c on non-standard boolean)
PR middle-end/78429
	* tree.h (wi::fits_to_boolean_p): New predicate.
	(wi::fits_to_tree_p): Use it for boolean types.
	* tree.c (int_fits_type_p): Likewise.

From-SVN: r242829
2016-11-24 12:02:53 +00:00
Martin Liska
bf2df7a9b3 cp_parser_range_for: use safe_push instead of quick_push (PR
PR bootstrap/78493
	* parser.c (cp_parser_range_for): Use safe_push instead of quick_push.
	PR bootstrap/78493
	* g++.dg/cpp1z/decomp18.C: New test.

From-SVN: r242828
2016-11-24 11:26:12 +00:00
Naveen H.S
adf86091b1 ldp_stp_1.c: Add -mcpu=generic.
2016-11-23  Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	* gcc.target/aarch64/ldp_stp_1.c : Add -mcpu=generic.
	* gcc.target/aarch64/store-pair-1.c : Likewise.

From-SVN: r242827
2016-11-24 10:24:15 +00:00
Richard Biener
c14988fe8d re PR middle-end/71762 (~X & Y to X < Y doesn't work for uninitialized values)
2016-11-23  Richard Biener  <rguenther@suse.de>

	PR middle-end/71762
	* match.pd ((~X & Y) -> X < Y, (X & ~Y) -> Y < X,
	(~X | Y) -> X <= Y, (X | ~Y) -> Y <= X): Remove.

	* gcc.dg/torture/pr71762-1.c: New testcase.
	* gcc.dg/torture/pr71762-2.c: Likewise.
	* gcc.dg/torture/pr71762-3.c: Likewise.
	* gcc.dg/tree-ssa/forwprop-28.c: XFAIL.

From-SVN: r242822
2016-11-24 09:45:01 +00:00
Naveen H.S
3884190f00 fmaxmin.c: Add -fno-vect-cost-model.
2016-11-23  Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	* gcc.target/aarch64/fmaxmin.c : Add -fno-vect-cost-model.
	* gcc.target/aarch64/fmul_fcvt_2.c : Likewise.
	* gcc.target/aarch64/vect-abs-compile.c : Likewise.
	* gcc.target/aarch64/vect-clz.c : Likewise.
	* gcc.target/aarch64/vect-fcm-eq-d.c : Likewise.
	* gcc.target/aarch64/vect-fcm-ge-d.c : Likewise.
	* gcc.target/aarch64/vect-fcm-gt-d.c : Likewise.
	* gcc.target/aarch64/vect-fmovd-zero.c : Likewise.
	* gcc.target/aarch64/vect-fmovd.c : Likewise.
	* gcc.target/aarch64/vect-fmovf-zero.c : Likewise.
	* gcc.target/aarch64/vect-fmovf.c : Likewise.
	* gcc.target/aarch64/vect_ctz_1.c : Likewise.

From-SVN: r242821
2016-11-24 09:42:36 +00:00
Martin Liska
47044ef2f5 Fix print_node for CONSTRUCTORs
* print-tree.c (struct bucket): Remove.
	(print_node): Add new argument which drives whether a tree node
	is printed briefly or not.
	(debug_tree): Replace a custom hash table with hash_set<T>.
	* print-tree.h (print_node): Add the argument.

From-SVN: r242820
2016-11-24 09:42:18 +00:00
Chung-Lin Tang
665ad37b6a nios2.c (nios2_init_libfuncs): Add ATTRIBUTE_UNUSED.
2016-11-24  Chung-Lin Tang  <cltang@codesourcery.com>

	* config/nios2/nios2.c (nios2_init_libfuncs): Add ATTRIBUTE_UNUSED.

From-SVN: r242819
2016-11-24 09:28:02 +00:00
Peter Bergner
90b725f0b0 re PR target/78458 (LRA ICE building libgcc for powerpc-linux-gnuspe e500v2)
gcc/
	PR target/78458
	* config/rs6000/rs6000.h (HARD_REGNO_CALLER_SAVE_MODE): Return MODE
	if it is at least NREGS wide.

gcc/testsuite/
	PR target/78458
	* gcc.target/powerpc/pr78458.c: New.

From-SVN: r242818
2016-11-23 20:07:51 -06:00
GCC Administrator
890a4eb056 Daily bump.
From-SVN: r242817
2016-11-24 00:16:15 +00:00
Joseph Myers
6fa42ea366 Fix e500 offset handling for TImode.
Given my previous fix for a missing insn pattern for e500, building
glibc runs into an assembler error "Error: operand out of range (256
is not between 0 and 248)".  This comes from an insn:

(insn 115 1209 1210 (set (reg:DF 27 27 [orig:294 _129 ] [294])
        (subreg:DF (mem/c:TI (plus:SI (reg/f:SI 1 1)
                    (const_int 256 [0x100])) [14 %sfp+256 S16 A128]) 0)) 1909 {*frob_df_ti}
     (nil))

This patch adjusts the offset handling for TImode - and TDmode and
PTImode in case such subregs can arise for them - to be the same as
for TFmode, so that proper SPE offset checks are made in the
TARGET_E500_DOUBLE case.

This allows the glibc build to complete.  Testing shows 372 FAILs
across the gcc, g++ and libstdc++ testsuites; more cleanup is
certainly needed, but this gets to the point where the toolchain at
least builds so it's possible to compare test results when fixing
bugs.

	* config/rs6000/rs6000.c (rs6000_legitimate_offset_address_p): For
	TARGET_E500_DOUBLE. handle TDmode, TImode and PTImode the same as
	TFmode, IFmode and KFmode.

From-SVN: r242814
2016-11-23 23:34:05 +00:00
Joseph Myers
03f24169cd Add another e500 subreg pattern.
Building glibc for powerpc-linux-gnuspe --enable-e500-double, given
the patch <https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02404.html>
applied, fails with errors such as:

../sysdeps/ieee754/ldbl-128ibm/s_modfl.c: In function '__modfl':
../sysdeps/ieee754/ldbl-128ibm/s_modfl.c:91:1: error: unrecognizable insn:
 }
 ^
(insn 31 30 32 2 (set (reg:DF 203)
        (subreg:DF (reg:TI 202) 8)) "../sysdeps/ieee754/ldbl-128ibm/s_modfl.c":44 -1
     (nil))
../sysdeps/ieee754/ldbl-128ibm/s_modfl.c:91:1: internal compiler error: in extract_insn, at recog.c:2311

This patch adds an insn pattern similar to various patterns already
present to handle extracting such a subreg.  This allows the glibc
build to get further, until it runs into an assembler error for which
I have another patch.

gcc:
	* config/rs6000/spe.md (*frob_<SPE64:mode>_ti_8): New insn
	pattern.

gcc/testsuite:
	* gcc.c-torture/compile/20161123-1.c: New test.

From-SVN: r242813
2016-11-23 23:32:54 +00:00
Segher Boessenkool
469585df2d combine: Query can_change_dest_mode before changing dest mode
As reported in https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02388.html .

Changing the mode of a hard register can lead to problems, or at least
it can make worse code if the result will need reloads.


	* combine.c (change_zero_ext): Only change the mode of a hard register
	destination if can_change_dest_mode holds for that.

From-SVN: r242812
2016-11-24 00:30:38 +01:00
Jeff Law
188a209119 * varasm.c (assemble_name): Increase buffer size for name.
From-SVN: r242810
2016-11-23 15:48:45 -07:00
Uros Bizjak
11a669fbeb * config/i386/i386.md: Move some insn patterns around.
From-SVN: r242809
2016-11-23 23:25:12 +01:00
Jeff Law
a2556bdf78 * config/spu/spu.md (floatunsdidf2): Remove unused local variable.
From-SVN: r242807
2016-11-23 15:17:29 -07:00
Jakub Kicinski
03a4ffcd5f * doc/extend.texi: Constify first argument to __builtin_object_size.
From-SVN: r242804
2016-11-23 15:05:18 -07:00
Bernd Edlinger
d5c45ad752 opth-gen.awk: Use unsigned shifts for bit masks.
2016-11-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* opth-gen.awk: Use unsigned shifts for bit masks.  Allow all bits
	to be used.  Add brackets around macro argument.

From-SVN: r242803
2016-11-23 14:53:12 -07:00
Steven G. Kargl
91c9fb42c0 re PR fortran/78297 (ICE in finish_equivalences, at fortran/trans-common.c:1246)
2016-11-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78297
	* trans-common.c (finish_equivalences): Do not dereference a NULL pointer.

2016-11-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78297
	* gfortran.dg/pr78297.f90: New test.

From-SVN: r242802
2016-11-23 21:44:05 +00:00
David Edelsohn
15a3cdd8b0 * gcc.target/powerpc/builtins-3.c: Add -maltivec and -mvsx options.
From-SVN: r242800
2016-11-23 16:06:28 -05:00
Uros Bizjak
cf919e352b i386.md (*<any_or:code>hi_1): Fix operand 2 constraints.
* config/i386/i386.md (*<any_or:code>hi_1): Fix operand 2 constraints.

From-SVN: r242796
2016-11-23 21:23:44 +01:00
Jakub Jelinek
c944c6a2b2 re PR sanitizer/69278 (Confusion option handling for -sanitize-recovery=alll)
PR sanitizer/69278
	* opts.c (parse_sanitizer_options): For -fsanitize=undefined,
	restore enabling also SANITIZE_UNREACHABLE and SANITIZE_RETURN.

	* g++.dg/ubsan/return-7.C: New test.
	* c-c++-common/ubsan/unreachable-4.c: New test.

From-SVN: r242795
2016-11-23 20:51:27 +01:00
Jakub Jelinek
871a2c6c8b re PR tree-optimization/78482 (wrong code at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu)
PR tree-optimization/78482
	* gcc.dg/torture/pr78482.c (c, d): Use signed char instead of char.
	(bar): New function.
	(main): Call bar instead of printf.

From-SVN: r242794
2016-11-23 20:50:23 +01:00
Jakub Jelinek
c39dad64b8 re PR middle-end/69183 (ICE when using OpenMP PRIVATE keyword in OMP DO loop not explicitly encapsulated in OMP PARALLEL region)
PR middle-end/69183
	* omp-low.c (build_outer_var_ref): Change lastprivate argument
	to code, pass it recursively, adjust uses.  For OMP_CLAUSE_PRIVATE
	on worksharing constructs, treat it like clauses on simd construct.
	Formatting fix.
	(lower_rec_input_clauses): For OMP_CLAUSE_PRIVATE_OUTER_REF pass
	OMP_CLAUSE_PRIVATE as last argument to build_outer_var_ref.
	(lower_lastprivate_clauses): Pass OMP_CLAUSE_LASTPRIVATE instead
	of true as last argument to build_outer_var_ref.

	* gfortran.dg/gomp/pr69183.f90: New test.

From-SVN: r242793
2016-11-23 20:28:41 +01:00
Kito Cheng
62567da0df re PR target/78230 (Compile pr66178.c fail for mips64el-elf with N64 abi)
PR target/78230
	* gcc.dg/torture/pr66178.c (test): Use uintptr_t instead of int.
	(test2) Ditto.

From-SVN: r242792
2016-11-23 12:20:33 -07:00
Uros Bizjak
46e89251c4 i386.md (*movqi_internal): Calculate mode attribute of alternatives 7,8,9 depending on TARGET_AVX512DQ.
* gcc.target/config/i386.md (*movqi_internal): Calculate mode
	attribute of alternatives 7,8,9 depending on TARGET_AVX512DQ.
	<TYPE_MSKMOV>: Emit kmovw for MODE_HI insn mode attribute.
	(*k<logic><mode>): Calculate mode attribute depending on
	TARGET_AVX512DQ.  Emit k<logic>w for MODE_HI insn mode attribute.
	(*andqi_1): Calculate mode attribute of alternative 3 depending
	on TARGET_AVX512DQ.  Emit kandw for MODE_HI insn mode attribute.
	(kandn<mode>): Calculate mode attribute of alternative 2 depending
	on TARGET_AVX512DQ.  Emit kandnw for MODE_HI insn mode attribute.
	(kxnor<mode>): Merge insn patterns using SWI1248_AVX512BW mode
	iterator.  Calculate mode attribute of alternative 1 depending
	on TARGET_AVX512DQ.  Emit kxnorw for MODE_HI insn mode attribute.
	(*one_cmplqi2_1): Calculate mode attribute of alternative 2 depending
	on TARGET_AVX512DQ.  Emit knotw for MODE_HI insn mode attribute.

From-SVN: r242791
2016-11-23 20:05:53 +01:00
Jakub Jelinek
25cb6b33f7 re PR c++/77907 (Add "const" to argument of constexpr constructor causes the object to be left in unconstructed state)
PR c++/77907
	* cp-gimplify.c (cp_fold) <case CALL_EXPR>: When calling constructor
	and maybe_constant_value returns non-CALL_EXPR, create INIT_EXPR
	with the object on lhs and maybe_constant_value returned expr on rhs.

	* g++.dg/cpp0x/pr77907.C: New test.

From-SVN: r242790
2016-11-23 19:45:27 +01:00
Alexander Monakov
6103184e81 OpenMP offloading to NVPTX: libgomp changes
* Makefile.am (libgomp_la_SOURCES): Add atomic.c, icv.c, icv-device.c.
	* Makefile.in. Regenerate.
	* configure.ac [nvptx*-*-*] (libgomp_use_pthreads): Set and use it...
	(LIBGOMP_USE_PTHREADS): ...here; new define.
	* configure: Regenerate.
	* config.h.in: Likewise.
	* config/posix/affinity.c: Move to...
	* affinity.c: ...here (new file).  Guard use of Pthreads-specific
	interface by LIBGOMP_USE_PTHREADS. 
	* critical.c: Split out GOMP_atomic_{start,end} into...
	* atomic.c: ...here (new file).
	* env.c: Split out ICV definitions into...
	* icv.c: ...here (new file) and...
	* icv-device.c: ...here. New file.
	* config/linux/lock.c (gomp_init_lock_30): Move to generic lock.c.
	(gomp_destroy_lock_30): Ditto.
	(gomp_set_lock_30): Ditto.
	(gomp_unset_lock_30): Ditto.
	(gomp_test_lock_30): Ditto.
	(gomp_init_nest_lock_30): Ditto.
	(gomp_destroy_nest_lock_30): Ditto.
	(gomp_set_nest_lock_30): Ditto.
	(gomp_unset_nest_lock_30): Ditto.
	(gomp_test_nest_lock_30): Ditto.
	* lock.c: New.
	* config/nvptx/lock.c: New.
	* config/nvptx/bar.c: New.
	* config/nvptx/bar.h: New.
	* config/nvptx/doacross.h: New.
	* config/nvptx/error.c: New.
	* config/nvptx/icv-device.c: New.
	* config/nvptx/mutex.h: New.
	* config/nvptx/pool.h: New.
	* config/nvptx/proc.c: New.
	* config/nvptx/ptrlock.h: New.
	* config/nvptx/sem.h: New.
	* config/nvptx/simple-bar.h: New.
	* config/nvptx/target.c: New.
	* config/nvptx/task.c: New.
	* config/nvptx/team.c: New.
	* config/nvptx/time.c: New.
	* config/posix/simple-bar.h: New.
	* libgomp.h: Guard pthread.h inclusion.  Include simple-bar.h.
	(gomp_num_teams_var): Declare.
	(struct gomp_thread_pool): Change threads_dock member to
	gomp_simple_barrier_t.
	[__nvptx__] (gomp_thread): New implementation.
	(gomp_thread_attr): Guard by LIBGOMP_USE_PTHREADS.
	(gomp_thread_destructor): Ditto.
	(gomp_init_thread_affinity): Ditto.
	* team.c: Guard uses of Pthreads-specific interfaces by
	LIBGOMP_USE_PTHREADS.  Adjust all uses of threads_dock.
	(gomp_free_thread) [__nvptx__]: Do not call 'free'.

	* config/nvptx/alloc.c: Delete.
	* config/nvptx/barrier.c: Ditto.
	* config/nvptx/fortran.c: Ditto.
	* config/nvptx/iter.c: Ditto.
	* config/nvptx/iter_ull.c: Ditto.
	* config/nvptx/loop.c: Ditto.
	* config/nvptx/loop_ull.c: Ditto.
	* config/nvptx/ordered.c: Ditto.
	* config/nvptx/parallel.c: Ditto.
	* config/nvptx/priority_queue.c: Ditto.
	* config/nvptx/sections.c: Ditto.
	* config/nvptx/single.c: Ditto.
	* config/nvptx/splay-tree.c: Ditto.
	* config/nvptx/work.c: Ditto.

	* testsuite/libgomp.fortran/fortran.exp (lang_link_flags): Pass
	-foffload=-lgfortran in addition to -lgfortran.
	* testsuite/libgomp.oacc-fortran/fortran.exp (lang_link_flags): Ditto.

	* plugin/plugin-nvptx.c: Include <limits.h>.
	(struct targ_fn_descriptor): Add new fields.
	(struct ptx_device): Ditto.  Set them...
	(nvptx_open_device): ...here.
	(nvptx_adjust_launch_bounds): New.
	(nvptx_host2dev): Allow NULL 'nvthd'.
	(nvptx_dev2host): Ditto.
	(GOMP_OFFLOAD_get_caps): Add GOMP_OFFLOAD_CAP_OPENMP_400.
	(link_ptx): Adjust log sizes.
	(nvptx_host2dev): Allow NULL 'nvthd'.
	(nvptx_dev2host): Ditto.
	(nvptx_set_clocktick): New.  Use it...
	(GOMP_OFFLOAD_load_image): ...here.  Set new targ_fn_descriptor
	fields.
	(GOMP_OFFLOAD_dev2dev): New.
	(nvptx_adjust_launch_bounds): New.
	(nvptx_stacks_size): New.
	(nvptx_stacks_alloc): New.
	(nvptx_stacks_free): New.
	(GOMP_OFFLOAD_run): New.
	(GOMP_OFFLOAD_async_run): New (stub).

Co-Authored-By: Dmitry Melnik <dm@ispras.ru>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r242789
2016-11-23 21:36:41 +03:00
Jeff Law
6251fe936f * config/mcore/mcore.c (emit_new_cond_insn): Fix prototype.
From-SVN: r242788
2016-11-23 11:15:49 -07:00
Jeff Law
7d1f0a00ed iq2000.c (iq2000_rtx_costs): Avoid multiplication in boolean context warning.
* config/iq2000/iq2000.c (iq2000_rtx_costs): Avoid multiplication
	in boolean context warning.

From-SVN: r242787
2016-11-23 11:10:53 -07:00
Prathamesh Kulkarni
cfe3d65388 re PR middle-end/78153 (strlen return value can be assumed to be less than PTRDIFF_MAX)
2016-11-23  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	PR middle-end/78153
	* gimple-fold.c (fold_stmt_1): Handle case for GIMPLE_RETURN.
	* tree-vrp.c (extract_range_basic): Handle case for
	CFN_BUILT_IN_STRLEN.

testsuite/
	* gcc.dg/tree-ssa/pr78153-1.c: New test.
	* gcc.dg/tree-ssa/pr78153-2.c: Likewise.

From-SVN: r242786
2016-11-23 18:04:14 +00:00
Jeff Law
017fdefeb3 * config/ia64/ia64.c (ia64_emit_insn_before): Fix prototype.
From-SVN: r242785
2016-11-23 10:55:57 -07:00
James Greenhalgh
5774b1fa53 [Patch ARM 17/17] Enable _Float16 for ARM and fix PR target/63250
gcc/

	PR target/63250
	* config/arm/arm-builtins.c (arm_simd_floatHF_type_node): Rename to...
	(arm_fp16_type_node): ...This, make visibile.
	(arm_simd_builtin_std_type): Rename arm_simd_floatHF_type_node to
	arm_fp16_type_node.
	(arm_init_simd_builtin_types): Likewise.
	(arm_init_fp16_builtins): Likewise.
	* config/arm/arm.c (arm_excess_precision): New.
	(arm_floatn_mode): Likewise.
	(TARGET_C_EXCESS_PRECISION): Likewise.
	(TARGET_FLOATN_MODE): Likewise.
	(arm_promoted_type): Only promote arm_fp16_type_node.
	* config/arm/arm.h (arm_fp16_type_node): Declare.

gcc/testsuite/

	PR target/63250
	* lib/target-supports.exp (add_options_for_float16): Add
	-mfp16-format=ieee when testign arm*-*-*.

From-SVN: r242784
2016-11-23 17:36:21 +00:00
James Greenhalgh
5e0f10a0f5 [Patch 16/17 libgcc ARM] Half to double precision conversions
gcc/

	* config/arm/arm.c (arm_convert_to_type): Delete.
	(TARGET_CONVERT_TO_TYPE): Delete.
	(arm_init_libfuncs): Enable trunc_optab from DFmode to HFmode.
	(arm_libcall_uses_aapcs_base): Add trunc_optab from DF- to HFmode.
	* config/arm/arm.h (TARGET_FP16_TO_DOUBLE): New.
	* config/arm/arm.md (truncdfhf2): Only convert through SFmode if we
	are in fast math mode, and have no single step hardware instruction.
	(extendhfdf2): Only expand through SFmode if we don't have a
	single-step hardware instruction.
	* config/arm/vfp.md (*truncdfhf2): New.
	(extendhfdf2): Likewise.

gcc/testsuite/

	* gcc.target/arm/fp16-rounding-alt-1.c (ROUNDED): Change expected
	result.
	* gcc.target/arm/fp16-rounding-ieee-1.c (ROUNDED): Change expected
	result.

From-SVN: r242783
2016-11-23 17:33:39 +00:00
James Greenhalgh
bea64ca303 [Patch 15/17 libgcc ARM] Add double to half conversions.
libgcc/

	* config/arm/fp16.c (binary64): New.
	(__gnu_d2h_internal): New.
	(__gnu_d2h_ieee): New.
	(__gnu_d2h_alternative): New.



Co-Authored-By: Matthew Wahab <matthew.wahab@arm.com>

From-SVN: r242782
2016-11-23 17:31:25 +00:00
James Greenhalgh
8630cadbc5 [Patch 14/17] [libgcc, ARM] Generalise float-to-half conversion function.
libgcc/

	* config/arm/fp16.c (struct format): New.
	(binary32): New.
	(__gnu_float2h_internal): New.  Body moved from
	__gnu_f2h_internal and generalize.
	(_gnu_f2h_internal): Move body to function __gnu_float2h_internal.
	Call it with binary32.



Co-Authored-By: Matthew Wahab <matthew.wahab@arm.com>

From-SVN: r242781
2016-11-23 17:30:02 +00:00
James Greenhalgh
ba75a1747c [Patch testsuite patch 10/17] Add options for floatN when checking effective target for support
gcc/testsuite/

	* lib/target-supports.exp (check_effective_target_float16): Add
	options for _Float16.
	(check_effective_target_float32): Add options for _Float32.
	(check_effective_target_float64): Add options for _Float64.
	(check_effective_target_float128): Add options for _Float128.
	(check_effective_target_float32x): Add options for _Float32x.
	(check_effective_target_float64x): Add options for _Float64x.
	(check_effective_target_float128x): Add options for _Float128x.

From-SVN: r242780
2016-11-23 17:28:36 +00:00
James Greenhalgh
5823ef2335 [Patch libgcc 9/17] Update soft-fp from glibc
libgcc/

	* soft-fp/extendhftf2.c: New.
	* soft-fp/fixhfti.c: Likewise.
	* soft-fp/fixunshfti.c: Likewise.
	* soft-fp/floattihf.c: Likewise.
	* soft-fp/floatuntihf.c: Likewise.
	* soft-fp/half.h: Likewise.
	* soft-fp/trunctfhf2.c: Likewise.

From-SVN: r242779
2016-11-23 17:27:27 +00:00
James Greenhalgh
3479b7af5e [Patch 8/17] Make _Float16 available if HFmode is available
gcc/

	* targhooks.c (default_floatn_mode): Enable _Float16 if a target
	provides HFmode.

From-SVN: r242778
2016-11-23 17:25:41 +00:00
James Greenhalgh
8f23c89a5f [Patch 7/17] Delete TARGET_FLT_EVAL_METHOD and poison it.
gcc/

	* config/s390/s390.h (TARGET_FLT_EVAL_METHOD): Delete.
	* config/m68k/m68k.h (TARGET_FLT_EVAL_METHOD): Delete.
	* config/i386/i386.h (TARGET_FLT_EVAL_METHOD): Delete.
	* defaults.h (TARGET_FLT_EVAL_METHOD): Delete.
	* doc/tm.texi.in (TARGET_FLT_EVAL_METHOD): Delete.
	* doc/tm.texi: Regenerate.
	* system.h (TARGET_FLT_EVAL_METHOD): Poison.

From-SVN: r242777
2016-11-23 17:24:28 +00:00
James Greenhalgh
56d8ffc170 [Patch 6/17] Migrate excess precision logic to use TARGET_EXCESS_PRECISION
gcc/

	* toplev.c (init_excess_precision): Delete most logic.
	* tree.c (excess_precision_type): Rewrite to use
	TARGET_EXCESS_PRECISION.
	* doc/invoke.texi (-fexcess-precision): Document behaviour in a
	more generic fashion.
	* ginclude/float.h: Wrap definition of FLT_EVAL_METHOD in
	__STDC_WANT_IEC_60559_TYPES_EXT__.

gcc/c-family/

	* c-common.c (excess_precision_mode_join): New.
	(c_ts18661_flt_eval_method): New.
	(c_c11_flt_eval_method): Likewise.
	(c_flt_eval_method): Likewise.
	* c-common.h (excess_precision_mode_join): New.
	(c_flt_eval_method): Likewise.
	* c-cppbuiltin.c (c_cpp_flt_eval_method_iec_559): New.
	(cpp_iec_559_value): Call it.
	(c_cpp_builtins): Modify logic for __LIBGCC_*_EXCESS_PRECISION__,
	call c_flt_eval_method to set __FLT_EVAL_METHOD__ and
	__FLT_EVAL_METHOD_TS_18661_3__.

gcc/testsuite/

	* gcc.dg/fpermitted-flt-eval-methods_3.c: New.
	* gcc.dg/fpermitted-flt-eval-methods_4.c: Likewise.

From-SVN: r242776
2016-11-23 17:23:12 +00:00
James Greenhalgh
04f0fcf7bd [Patch 5/17] Add -fpermitted-flt-eval-methods=[c11|ts-18661-3]
gcc/c-family/

	* c-opts.c (c_common_post_options): Add logic to handle the default
	case for -fpermitted-flt-eval-methods.

gcc/

	* common.opt (fpermitted-flt-eval-methods): New.
	* doc/invoke.texi (-fpermitted-flt-eval-methods): Document it.
	* flag_types.h (permitted_flt_eval_methods): New.

gcc/testsuite/

	* gcc.dg/fpermitted-flt-eval-methods_1.c: New.
	* gcc.dg/fpermitted-flt-eval-methods_2.c: New.

From-SVN: r242775
2016-11-23 17:20:37 +00:00
James Greenhalgh
b89de1b8dd [Patch 4/17] Implement TARGET_C_EXCESS_PRECISION for m68k
gcc/

	* config/m68k/m68k.c (m68k_excess_precision): New.
	(TARGET_C_EXCESS_PRECISION): Define.

From-SVN: r242774
2016-11-23 17:17:35 +00:00
James Greenhalgh
638108bd67 [Patch 3/17] Implement TARGET_C_EXCESS_PRECISION for s390
* config/s390/s390.c (s390_excess_precision): New.
	(TARGET_C_EXCESS_PRECISION): Define.

From-SVN: r242773
2016-11-23 17:16:29 +00:00
James Greenhalgh
e97dfd54b7 [Patch 2/17] Implement TARGET_C_EXCESS_PRECISION for i386
gcc/
	* config/i386/i386.c (ix86_excess_precision): New.
	(TARGET_C_EXCESS_PRECISION): Define.

From-SVN: r242772
2016-11-23 17:15:17 +00:00