2009-02-02 12:27:50 +01:00
|
|
|
# Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
execute.exp: Change copyright header to refer to version 3 of the GNU General Public License...
* gcc.c-torture/execute/execute.exp: Change copyright header to refer to version
3 of the GNU General Public License and to point readers at the COPYING3 file
and the FSF's license web page.
* gcc.c-torture/execute/ieee/ieee.exp, gcc.c-torture/unsorted/unsorted.exp,
gcc.c-torture/compile/compile.exp, gcc.c-torture/compile/structs.c,
gcc.target/powerpc/powerpc.exp, gcc.target/arm/neon/neon.exp, gcc.target/arm/arm.exp,
gcc.target/cris/torture/cris-torture.exp, gcc.target/cris/cris.exp, gcc.target/ia64/ia64.exp,
gcc.target/alpha/alpha.exp, gcc.target/m68k/m68k.exp, gcc.target/spu/spu.exp, gcc.target/mips/mips.exp,
gcc.target/sparc/sparc.exp, gcc.target/i386/i386.exp, gcc.target/x86_64/abi/abi-x86_64.exp, gnat.dg/specs/specs.exp,
gnat.dg/dg.exp, gnat.dg/style/style.exp, gcc.dg/special/mips-abi.exp, gcc.dg/special/special.exp,
gcc.dg/pch/pch.exp, gcc.dg/vxworks/vxworks.exp, gcc.dg/dg.exp, gcc.dg/charset/charset.exp, gcc.dg/weak/weak.exp,
gcc.dg/tree-ssa/tree-ssa.exp, gcc.dg/tls/tls.exp, gcc.dg/cpp/cpp.exp, gcc.dg/cpp/trad/trad.exp,
gcc.dg/matrix/matrix.exp, gcc.dg/vmx/vmx.exp, gcc.dg/compat/struct-layout-1.exp, gcc.dg/compat/compat.exp,
gcc.dg/compat/struct-layout-1_generate.c, gcc.dg/debug/debug.exp, gcc.dg/debug/dwarf2/dwarf2.exp, gcc.dg/tree-prof/tree-prof.exp,
gcc.dg/ipa/ipa.exp, gcc.dg/dfp/dfp.exp, gcc.dg/noncompile/noncompile.exp,
gcc.dg/vect/costmodel/ppc/ppc-costmodel-vect.exp, gcc.dg/vect/costmodel/spu/spu-costmodel-vect.exp,
gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp, gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp,
gcc.dg/vect/vect.exp, gcc.dg/format/format.exp, gcc.misc-tests/i386-prefetch.exp, gcc.misc-tests/sort2.exp,
gcc.misc-tests/matrix1.exp, gcc.misc-tests/dectest.exp, gcc.misc-tests/options.exp, gcc.misc-tests/gcov.exp,
gcc.misc-tests/mg-2.exp, gcc.misc-tests/mg.exp, gcc.misc-tests/bprob.exp, gcc.misc-tests/acker1.exp,
gcc.misc-tests/dhry.exp, gcc.misc-tests/linkage.exp, gcc.misc-tests/arm-isr.exp, gcc.misc-tests/sieve.exp,
g++.old-deja/g++.niklas/README, g++.old-deja/g++.gb/README, g++.old-deja/old-deja.exp,
gfortran.fortran-torture/execute/execute.exp, gfortran.fortran-torture/compile/compile.exp,
treelang/output/output-1.c, treelang/output/output-1.tree, treelang/execute/execute.exp, treelang/Makefile.in,
treelang/compile/compile.exp, g++.dg/dg.exp, g++.dg/debug/debug.exp, g++.dg/debug/dwarf2/dwarf2.exp,
g++.dg/charset/charset.exp, g++.dg/vect/vect.exp, g++.dg/tls/tls.exp, g++.dg/tree-prof/tree-prof.exp,
g++.dg/pch/pch.exp, g++.dg/special/ecos.exp, g++.dg/compat/struct-layout-1.exp,
g++.dg/compat/struct-layout-1_generate.c, g++.dg/compat/compat.exp, g++.dg/gcov/gcov.exp,
g++.dg/bprob/bprob.exp, config/default.exp, gcc.test-framework/test-framework.awk,
gcc.test-framework/gen_directive_tests, gcc.test-framework/test-framework.exp,
objc.dg/special/special.exp, objc.dg/gnu-encoding/gnu-encoding.exp,
objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c, objc.dg/pch/pch.exp, objc.dg/dg.exp, lib/copy-file.exp,
lib/profopt.exp, lib/gcc.exp, lib/mike-g++.exp, lib/c-compat.exp, lib/scanrtl.exp, lib/gfortran-dg.exp, lib/g++.exp,
lib/obj-c++.exp, lib/wrapper.exp, lib/gnat-dg.exp, lib/compat.exp, lib/c-torture.exp, lib/gcc-dg.exp, lib/scanasm.exp, lib/gnat.exp,
lib/treelang-dg.exp, lib/prune.exp, lib/gcov.exp, lib/treelang.exp, lib/dg-pch.exp, lib/scantree.exp,
lib/g++-dg.exp, lib/objc-dg.exp, lib/file-format.exp, lib/target-libpath.exp, lib/obj-c++-dg.exp, lib/scandump.exp,
lib/target-supports-dg.exp, lib/gcc-defs.exp, lib/fortran-torture.exp, lib/objc.exp, lib/scanipa.exp,
lib/mike-gcc.exp, lib/objc-torture.exp, lib/gfortran.exp, lib/target-supports.exp, obj-c++.dg/dg.exp, gfortran.dg/dg.exp,
gfortran.dg/vect/vect.exp, objc/execute/execute.exp, objc/execute/exceptions/exceptions.exp,
objc/compile/compile.exp: Likewise.
From-SVN: r127127
2007-08-01 18:25:11 +02:00
|
|
|
# Free Software Foundation, Inc.
|
1999-11-05 11:38:01 +01:00
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
execute.exp: Change copyright header to refer to version 3 of the GNU General Public License...
* gcc.c-torture/execute/execute.exp: Change copyright header to refer to version
3 of the GNU General Public License and to point readers at the COPYING3 file
and the FSF's license web page.
* gcc.c-torture/execute/ieee/ieee.exp, gcc.c-torture/unsorted/unsorted.exp,
gcc.c-torture/compile/compile.exp, gcc.c-torture/compile/structs.c,
gcc.target/powerpc/powerpc.exp, gcc.target/arm/neon/neon.exp, gcc.target/arm/arm.exp,
gcc.target/cris/torture/cris-torture.exp, gcc.target/cris/cris.exp, gcc.target/ia64/ia64.exp,
gcc.target/alpha/alpha.exp, gcc.target/m68k/m68k.exp, gcc.target/spu/spu.exp, gcc.target/mips/mips.exp,
gcc.target/sparc/sparc.exp, gcc.target/i386/i386.exp, gcc.target/x86_64/abi/abi-x86_64.exp, gnat.dg/specs/specs.exp,
gnat.dg/dg.exp, gnat.dg/style/style.exp, gcc.dg/special/mips-abi.exp, gcc.dg/special/special.exp,
gcc.dg/pch/pch.exp, gcc.dg/vxworks/vxworks.exp, gcc.dg/dg.exp, gcc.dg/charset/charset.exp, gcc.dg/weak/weak.exp,
gcc.dg/tree-ssa/tree-ssa.exp, gcc.dg/tls/tls.exp, gcc.dg/cpp/cpp.exp, gcc.dg/cpp/trad/trad.exp,
gcc.dg/matrix/matrix.exp, gcc.dg/vmx/vmx.exp, gcc.dg/compat/struct-layout-1.exp, gcc.dg/compat/compat.exp,
gcc.dg/compat/struct-layout-1_generate.c, gcc.dg/debug/debug.exp, gcc.dg/debug/dwarf2/dwarf2.exp, gcc.dg/tree-prof/tree-prof.exp,
gcc.dg/ipa/ipa.exp, gcc.dg/dfp/dfp.exp, gcc.dg/noncompile/noncompile.exp,
gcc.dg/vect/costmodel/ppc/ppc-costmodel-vect.exp, gcc.dg/vect/costmodel/spu/spu-costmodel-vect.exp,
gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp, gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp,
gcc.dg/vect/vect.exp, gcc.dg/format/format.exp, gcc.misc-tests/i386-prefetch.exp, gcc.misc-tests/sort2.exp,
gcc.misc-tests/matrix1.exp, gcc.misc-tests/dectest.exp, gcc.misc-tests/options.exp, gcc.misc-tests/gcov.exp,
gcc.misc-tests/mg-2.exp, gcc.misc-tests/mg.exp, gcc.misc-tests/bprob.exp, gcc.misc-tests/acker1.exp,
gcc.misc-tests/dhry.exp, gcc.misc-tests/linkage.exp, gcc.misc-tests/arm-isr.exp, gcc.misc-tests/sieve.exp,
g++.old-deja/g++.niklas/README, g++.old-deja/g++.gb/README, g++.old-deja/old-deja.exp,
gfortran.fortran-torture/execute/execute.exp, gfortran.fortran-torture/compile/compile.exp,
treelang/output/output-1.c, treelang/output/output-1.tree, treelang/execute/execute.exp, treelang/Makefile.in,
treelang/compile/compile.exp, g++.dg/dg.exp, g++.dg/debug/debug.exp, g++.dg/debug/dwarf2/dwarf2.exp,
g++.dg/charset/charset.exp, g++.dg/vect/vect.exp, g++.dg/tls/tls.exp, g++.dg/tree-prof/tree-prof.exp,
g++.dg/pch/pch.exp, g++.dg/special/ecos.exp, g++.dg/compat/struct-layout-1.exp,
g++.dg/compat/struct-layout-1_generate.c, g++.dg/compat/compat.exp, g++.dg/gcov/gcov.exp,
g++.dg/bprob/bprob.exp, config/default.exp, gcc.test-framework/test-framework.awk,
gcc.test-framework/gen_directive_tests, gcc.test-framework/test-framework.exp,
objc.dg/special/special.exp, objc.dg/gnu-encoding/gnu-encoding.exp,
objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c, objc.dg/pch/pch.exp, objc.dg/dg.exp, lib/copy-file.exp,
lib/profopt.exp, lib/gcc.exp, lib/mike-g++.exp, lib/c-compat.exp, lib/scanrtl.exp, lib/gfortran-dg.exp, lib/g++.exp,
lib/obj-c++.exp, lib/wrapper.exp, lib/gnat-dg.exp, lib/compat.exp, lib/c-torture.exp, lib/gcc-dg.exp, lib/scanasm.exp, lib/gnat.exp,
lib/treelang-dg.exp, lib/prune.exp, lib/gcov.exp, lib/treelang.exp, lib/dg-pch.exp, lib/scantree.exp,
lib/g++-dg.exp, lib/objc-dg.exp, lib/file-format.exp, lib/target-libpath.exp, lib/obj-c++-dg.exp, lib/scandump.exp,
lib/target-supports-dg.exp, lib/gcc-defs.exp, lib/fortran-torture.exp, lib/objc.exp, lib/scanipa.exp,
lib/mike-gcc.exp, lib/objc-torture.exp, lib/gfortran.exp, lib/target-supports.exp, obj-c++.dg/dg.exp, gfortran.dg/dg.exp,
gfortran.dg/vect/vect.exp, objc/execute/execute.exp, objc/execute/exceptions/exceptions.exp,
objc/compile/compile.exp: Likewise.
From-SVN: r127127
2007-08-01 18:25:11 +02:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
1999-11-05 11:38:01 +01:00
|
|
|
# (at your option) any later version.
|
2004-02-27 03:01:10 +01:00
|
|
|
#
|
1999-11-05 11:38:01 +01:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2004-02-27 03:01:10 +01:00
|
|
|
#
|
1999-11-05 11:38:01 +01:00
|
|
|
# You should have received a copy of the GNU General Public License
|
execute.exp: Change copyright header to refer to version 3 of the GNU General Public License...
* gcc.c-torture/execute/execute.exp: Change copyright header to refer to version
3 of the GNU General Public License and to point readers at the COPYING3 file
and the FSF's license web page.
* gcc.c-torture/execute/ieee/ieee.exp, gcc.c-torture/unsorted/unsorted.exp,
gcc.c-torture/compile/compile.exp, gcc.c-torture/compile/structs.c,
gcc.target/powerpc/powerpc.exp, gcc.target/arm/neon/neon.exp, gcc.target/arm/arm.exp,
gcc.target/cris/torture/cris-torture.exp, gcc.target/cris/cris.exp, gcc.target/ia64/ia64.exp,
gcc.target/alpha/alpha.exp, gcc.target/m68k/m68k.exp, gcc.target/spu/spu.exp, gcc.target/mips/mips.exp,
gcc.target/sparc/sparc.exp, gcc.target/i386/i386.exp, gcc.target/x86_64/abi/abi-x86_64.exp, gnat.dg/specs/specs.exp,
gnat.dg/dg.exp, gnat.dg/style/style.exp, gcc.dg/special/mips-abi.exp, gcc.dg/special/special.exp,
gcc.dg/pch/pch.exp, gcc.dg/vxworks/vxworks.exp, gcc.dg/dg.exp, gcc.dg/charset/charset.exp, gcc.dg/weak/weak.exp,
gcc.dg/tree-ssa/tree-ssa.exp, gcc.dg/tls/tls.exp, gcc.dg/cpp/cpp.exp, gcc.dg/cpp/trad/trad.exp,
gcc.dg/matrix/matrix.exp, gcc.dg/vmx/vmx.exp, gcc.dg/compat/struct-layout-1.exp, gcc.dg/compat/compat.exp,
gcc.dg/compat/struct-layout-1_generate.c, gcc.dg/debug/debug.exp, gcc.dg/debug/dwarf2/dwarf2.exp, gcc.dg/tree-prof/tree-prof.exp,
gcc.dg/ipa/ipa.exp, gcc.dg/dfp/dfp.exp, gcc.dg/noncompile/noncompile.exp,
gcc.dg/vect/costmodel/ppc/ppc-costmodel-vect.exp, gcc.dg/vect/costmodel/spu/spu-costmodel-vect.exp,
gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp, gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp,
gcc.dg/vect/vect.exp, gcc.dg/format/format.exp, gcc.misc-tests/i386-prefetch.exp, gcc.misc-tests/sort2.exp,
gcc.misc-tests/matrix1.exp, gcc.misc-tests/dectest.exp, gcc.misc-tests/options.exp, gcc.misc-tests/gcov.exp,
gcc.misc-tests/mg-2.exp, gcc.misc-tests/mg.exp, gcc.misc-tests/bprob.exp, gcc.misc-tests/acker1.exp,
gcc.misc-tests/dhry.exp, gcc.misc-tests/linkage.exp, gcc.misc-tests/arm-isr.exp, gcc.misc-tests/sieve.exp,
g++.old-deja/g++.niklas/README, g++.old-deja/g++.gb/README, g++.old-deja/old-deja.exp,
gfortran.fortran-torture/execute/execute.exp, gfortran.fortran-torture/compile/compile.exp,
treelang/output/output-1.c, treelang/output/output-1.tree, treelang/execute/execute.exp, treelang/Makefile.in,
treelang/compile/compile.exp, g++.dg/dg.exp, g++.dg/debug/debug.exp, g++.dg/debug/dwarf2/dwarf2.exp,
g++.dg/charset/charset.exp, g++.dg/vect/vect.exp, g++.dg/tls/tls.exp, g++.dg/tree-prof/tree-prof.exp,
g++.dg/pch/pch.exp, g++.dg/special/ecos.exp, g++.dg/compat/struct-layout-1.exp,
g++.dg/compat/struct-layout-1_generate.c, g++.dg/compat/compat.exp, g++.dg/gcov/gcov.exp,
g++.dg/bprob/bprob.exp, config/default.exp, gcc.test-framework/test-framework.awk,
gcc.test-framework/gen_directive_tests, gcc.test-framework/test-framework.exp,
objc.dg/special/special.exp, objc.dg/gnu-encoding/gnu-encoding.exp,
objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c, objc.dg/pch/pch.exp, objc.dg/dg.exp, lib/copy-file.exp,
lib/profopt.exp, lib/gcc.exp, lib/mike-g++.exp, lib/c-compat.exp, lib/scanrtl.exp, lib/gfortran-dg.exp, lib/g++.exp,
lib/obj-c++.exp, lib/wrapper.exp, lib/gnat-dg.exp, lib/compat.exp, lib/c-torture.exp, lib/gcc-dg.exp, lib/scanasm.exp, lib/gnat.exp,
lib/treelang-dg.exp, lib/prune.exp, lib/gcov.exp, lib/treelang.exp, lib/dg-pch.exp, lib/scantree.exp,
lib/g++-dg.exp, lib/objc-dg.exp, lib/file-format.exp, lib/target-libpath.exp, lib/obj-c++-dg.exp, lib/scandump.exp,
lib/target-supports-dg.exp, lib/gcc-defs.exp, lib/fortran-torture.exp, lib/objc.exp, lib/scanipa.exp,
lib/mike-gcc.exp, lib/objc-torture.exp, lib/gfortran.exp, lib/target-supports.exp, obj-c++.dg/dg.exp, gfortran.dg/dg.exp,
gfortran.dg/vect/vect.exp, objc/execute/execute.exp, objc/execute/exceptions/exceptions.exp,
objc/compile/compile.exp: Likewise.
From-SVN: r127127
2007-08-01 18:25:11 +02:00
|
|
|
# along with GCC; see the file COPYING3. If not see
|
|
|
|
# <http://www.gnu.org/licenses/>.
|
1999-11-05 11:38:01 +01:00
|
|
|
|
|
|
|
# Please email any bugs, comments, and/or additions to this file to:
|
|
|
|
# gcc-patches@gcc.gnu.org
|
|
|
|
|
|
|
|
# This file defines procs for determining features supported by the target.
|
|
|
|
|
2007-12-04 11:16:17 +01:00
|
|
|
# Try to compile the code given by CONTENTS into an output file of
|
|
|
|
# type TYPE, where TYPE is as for target_compile. Return a list
|
|
|
|
# whose first element contains the compiler messages and whose
|
|
|
|
# second element is the name of the output file.
|
2004-11-12 02:11:01 +01:00
|
|
|
#
|
2007-12-04 11:16:17 +01:00
|
|
|
# BASENAME is a prefix to use for source and output files.
|
|
|
|
# If ARGS is not empty, its first element is a string that
|
|
|
|
# should be added to the command line.
|
|
|
|
#
|
|
|
|
# Assume by default that CONTENTS is C code. C++ code should contain
|
|
|
|
# "// C++" and Fortran code should contain "! Fortran".
|
|
|
|
proc check_compile {basename type contents args} {
|
2004-11-12 02:11:01 +01:00
|
|
|
global tool
|
|
|
|
|
2005-04-07 01:27:11 +02:00
|
|
|
if { [llength $args] > 0 } {
|
2006-10-31 20:58:21 +01:00
|
|
|
set options [list "additional_flags=[lindex $args 0]"]
|
2005-04-07 01:27:11 +02:00
|
|
|
} else {
|
|
|
|
set options ""
|
|
|
|
}
|
2007-12-04 11:16:17 +01:00
|
|
|
switch -glob -- $contents {
|
|
|
|
"*! Fortran*" { set src ${basename}[pid].f90 }
|
|
|
|
"*// C++*" { set src ${basename}[pid].cc }
|
|
|
|
default { set src ${basename}[pid].c }
|
|
|
|
}
|
2008-02-04 23:36:26 +01:00
|
|
|
set compile_type $type
|
|
|
|
switch -glob $type {
|
2004-11-12 02:11:01 +01:00
|
|
|
assembly { set output ${basename}[pid].s }
|
|
|
|
object { set output ${basename}[pid].o }
|
2007-12-04 11:16:17 +01:00
|
|
|
executable { set output ${basename}[pid].exe }
|
2008-02-04 23:36:26 +01:00
|
|
|
"rtl-*" {
|
|
|
|
set output ${basename}[pid].s
|
|
|
|
lappend options "additional_flags=-fdump-$type"
|
|
|
|
set compile_type assembly
|
|
|
|
}
|
2004-11-12 02:11:01 +01:00
|
|
|
}
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f $contents
|
|
|
|
close $f
|
2008-02-04 23:36:26 +01:00
|
|
|
set lines [${tool}_target_compile $src $output $compile_type "$options"]
|
2004-11-12 02:11:01 +01:00
|
|
|
file delete $src
|
|
|
|
|
2008-02-04 23:36:26 +01:00
|
|
|
set scan_output $output
|
|
|
|
# Don't try folding this into the switch above; calling "glob" before the
|
|
|
|
# file is created won't work.
|
|
|
|
if [regexp "rtl-(.*)" $type dummy rtl_type] {
|
|
|
|
set scan_output "[glob $src.\[0-9\]\[0-9\]\[0-9\]r.$rtl_type]"
|
|
|
|
file delete $output
|
|
|
|
}
|
|
|
|
|
|
|
|
return [list $lines $scan_output]
|
2004-11-12 02:11:01 +01:00
|
|
|
}
|
|
|
|
|
2005-01-24 19:24:02 +01:00
|
|
|
proc current_target_name { } {
|
|
|
|
global target_info
|
|
|
|
if [info exists target_info(target,name)] {
|
|
|
|
set answer $target_info(target,name)
|
|
|
|
} else {
|
|
|
|
set answer ""
|
|
|
|
}
|
|
|
|
return $answer
|
|
|
|
}
|
|
|
|
|
2006-03-21 00:22:13 +01:00
|
|
|
# Implement an effective-target check for property PROP by invoking
|
2007-09-22 10:26:50 +02:00
|
|
|
# the Tcl command ARGS and seeing if it returns true.
|
|
|
|
|
|
|
|
proc check_cached_effective_target { prop args } {
|
2006-03-21 00:22:13 +01:00
|
|
|
global et_cache
|
|
|
|
|
|
|
|
set target [current_target_name]
|
|
|
|
if {![info exists et_cache($prop,target)]
|
|
|
|
|| $et_cache($prop,target) != $target} {
|
2007-09-22 10:26:50 +02:00
|
|
|
verbose "check_cached_effective_target $prop: checking $target" 2
|
2006-08-02 15:31:56 +02:00
|
|
|
set et_cache($prop,target) $target
|
2007-09-22 10:26:50 +02:00
|
|
|
set et_cache($prop,value) [uplevel eval $args]
|
2006-08-02 15:31:56 +02:00
|
|
|
}
|
|
|
|
set value $et_cache($prop,value)
|
2007-09-22 10:26:50 +02:00
|
|
|
verbose "check_cached_effective_target $prop: returning $value for $target" 2
|
2006-08-02 15:31:56 +02:00
|
|
|
return $value
|
|
|
|
}
|
|
|
|
|
2007-12-04 11:16:17 +01:00
|
|
|
# Like check_compile, but delete the output file and return true if the
|
|
|
|
# compiler printed no messages.
|
|
|
|
proc check_no_compiler_messages_nocache {args} {
|
|
|
|
set result [eval check_compile $args]
|
|
|
|
set lines [lindex $result 0]
|
|
|
|
set output [lindex $result 1]
|
|
|
|
remote_file build delete $output
|
|
|
|
return [string match "" $lines]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Like check_no_compiler_messages_nocache, but cache the result.
|
|
|
|
# PROP is the property we're checking, and doubles as a prefix for
|
|
|
|
# temporary filenames.
|
2007-09-22 10:26:50 +02:00
|
|
|
proc check_no_compiler_messages {prop args} {
|
|
|
|
return [check_cached_effective_target $prop {
|
2007-12-04 11:16:17 +01:00
|
|
|
eval [list check_no_compiler_messages_nocache $prop] $args
|
2007-09-22 10:26:50 +02:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2007-12-04 11:16:17 +01:00
|
|
|
# Like check_compile, but return true if the compiler printed no
|
|
|
|
# messages and if the contents of the output file satisfy PATTERN.
|
|
|
|
# If PATTERN has the form "!REGEXP", the contents satisfy it if they
|
|
|
|
# don't match regular expression REGEXP, otherwise they satisfy it
|
|
|
|
# if they do match regular expression PATTERN. (PATTERN can start
|
|
|
|
# with something like "[!]" if the regular expression needs to match
|
|
|
|
# "!" as the first character.)
|
|
|
|
#
|
|
|
|
# Delete the output file before returning. The other arguments are
|
|
|
|
# as for check_compile.
|
|
|
|
proc check_no_messages_and_pattern_nocache {basename pattern args} {
|
|
|
|
global tool
|
|
|
|
|
|
|
|
set result [eval [list check_compile $basename] $args]
|
|
|
|
set lines [lindex $result 0]
|
|
|
|
set output [lindex $result 1]
|
|
|
|
|
|
|
|
set ok 0
|
|
|
|
if { [string match "" $lines] } {
|
|
|
|
set chan [open "$output"]
|
|
|
|
set invert [regexp {^!(.*)} $pattern dummy pattern]
|
|
|
|
set ok [expr { [regexp $pattern [read $chan]] != $invert }]
|
|
|
|
close $chan
|
|
|
|
}
|
|
|
|
|
|
|
|
remote_file build delete $output
|
|
|
|
return $ok
|
|
|
|
}
|
|
|
|
|
|
|
|
# Like check_no_messages_and_pattern_nocache, but cache the result.
|
|
|
|
# PROP is the property we're checking, and doubles as a prefix for
|
|
|
|
# temporary filenames.
|
2006-08-02 15:31:56 +02:00
|
|
|
proc check_no_messages_and_pattern {prop pattern args} {
|
2007-09-22 10:26:50 +02:00
|
|
|
return [check_cached_effective_target $prop {
|
2007-12-04 11:16:17 +01:00
|
|
|
eval [list check_no_messages_and_pattern_nocache $prop $pattern] $args
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Try to compile and run an executable from code CONTENTS. Return true
|
|
|
|
# if the compiler reports no messages and if execution "passes" in the
|
|
|
|
# usual DejaGNU sense. The arguments are as for check_compile, with
|
|
|
|
# TYPE implicitly being "executable".
|
|
|
|
proc check_runtime_nocache {basename contents args} {
|
|
|
|
global tool
|
|
|
|
|
|
|
|
set result [eval [list check_compile $basename executable $contents] $args]
|
|
|
|
set lines [lindex $result 0]
|
|
|
|
set output [lindex $result 1]
|
|
|
|
|
|
|
|
set ok 0
|
|
|
|
if { [string match "" $lines] } {
|
|
|
|
# No error messages, everything is OK.
|
|
|
|
set result [remote_load target "./$output" "" ""]
|
|
|
|
set status [lindex $result 0]
|
|
|
|
verbose "check_runtime_nocache $basename: status is <$status>" 2
|
|
|
|
if { $status == "pass" } {
|
|
|
|
set ok 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
remote_file build delete $output
|
|
|
|
return $ok
|
|
|
|
}
|
|
|
|
|
|
|
|
# Like check_runtime_nocache, but cache the result. PROP is the
|
|
|
|
# property we're checking, and doubles as a prefix for temporary
|
|
|
|
# filenames.
|
|
|
|
proc check_runtime {prop args} {
|
|
|
|
global tool
|
|
|
|
|
|
|
|
return [check_cached_effective_target $prop {
|
|
|
|
eval [list check_runtime_nocache $prop] $args
|
2007-09-22 10:26:50 +02:00
|
|
|
}]
|
2006-03-21 00:22:13 +01:00
|
|
|
}
|
|
|
|
|
1999-11-05 11:38:01 +01:00
|
|
|
###############################
|
|
|
|
# proc check_weak_available { }
|
|
|
|
###############################
|
|
|
|
|
|
|
|
# weak symbols are only supported in some configs/object formats
|
|
|
|
# this proc returns 1 if they're supported, 0 if they're not, or -1 if unsure
|
|
|
|
|
|
|
|
proc check_weak_available { } {
|
2001-07-19 20:08:17 +02:00
|
|
|
global target_triplet
|
1999-11-05 11:38:01 +01:00
|
|
|
global target_cpu
|
|
|
|
|
|
|
|
# All mips targets should support it
|
2004-02-27 03:01:10 +01:00
|
|
|
|
1999-11-05 11:38:01 +01:00
|
|
|
if { [ string first "mips" $target_cpu ] >= 0 } {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2002-09-27 04:14:12 +02:00
|
|
|
# All solaris2 targets should support it
|
2004-02-27 03:01:10 +01:00
|
|
|
|
2002-09-27 04:14:12 +02:00
|
|
|
if { [regexp ".*-solaris2.*" $target_triplet] } {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2001-07-19 20:08:17 +02:00
|
|
|
# DEC OSF/1/Digital UNIX/Tru64 UNIX supports it
|
|
|
|
|
|
|
|
if { [regexp "alpha.*osf.*" $target_triplet] } {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2004-11-06 05:28:10 +01:00
|
|
|
# Windows targets Cygwin and MingW32 support it
|
|
|
|
|
|
|
|
if { [regexp ".*mingw32|.*cygwin" $target_triplet] } {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2005-03-06 19:26:53 +01:00
|
|
|
# HP-UX 10.X doesn't support it
|
|
|
|
|
2006-12-14 17:13:59 +01:00
|
|
|
if { [istarget "hppa*-*-hpux10*"] } {
|
2005-03-06 19:26:53 +01:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
1999-11-05 11:38:01 +01:00
|
|
|
# ELF and ECOFF support it. a.out does with gas/gld but may also with
|
|
|
|
# other linkers, so we should try it
|
|
|
|
|
|
|
|
set objformat [gcc_target_object_format]
|
|
|
|
|
|
|
|
switch $objformat {
|
|
|
|
elf { return 1 }
|
|
|
|
ecoff { return 1 }
|
|
|
|
a.out { return 1 }
|
2004-10-28 02:16:57 +02:00
|
|
|
mach-o { return 1 }
|
2005-03-06 19:26:53 +01:00
|
|
|
som { return 1 }
|
1999-11-05 11:38:01 +01:00
|
|
|
unknown { return -1 }
|
|
|
|
default { return 0 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-08 00:53:03 +01:00
|
|
|
###############################
|
|
|
|
# proc check_weak_override_available { }
|
|
|
|
###############################
|
|
|
|
|
|
|
|
# Like check_weak_available, but return 0 if weak symbol definitions
|
|
|
|
# cannot be overridden.
|
|
|
|
|
|
|
|
proc check_weak_override_available { } {
|
|
|
|
if { [istarget "*-*-mingw*"] } {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
return [check_weak_available]
|
|
|
|
}
|
|
|
|
|
2003-12-10 07:34:46 +01:00
|
|
|
###############################
|
2005-03-25 03:21:01 +01:00
|
|
|
# proc check_visibility_available { what_kind }
|
2003-12-10 07:34:46 +01:00
|
|
|
###############################
|
|
|
|
|
|
|
|
# The visibility attribute is only support in some object formats
|
2004-11-19 20:59:10 +01:00
|
|
|
# This proc returns 1 if it is supported, 0 if not.
|
2005-03-25 03:21:01 +01:00
|
|
|
# The argument is the kind of visibility, default/protected/hidden/internal.
|
2003-12-10 07:34:46 +01:00
|
|
|
|
2005-03-25 03:21:01 +01:00
|
|
|
proc check_visibility_available { what_kind } {
|
2004-11-19 20:59:10 +01:00
|
|
|
global tool
|
2003-12-10 07:34:46 +01:00
|
|
|
global target_triplet
|
|
|
|
|
2004-09-03 20:10:08 +02:00
|
|
|
# On NetWare, support makes no sense.
|
2006-01-10 08:18:15 +01:00
|
|
|
if { [istarget *-*-netware*] } {
|
2004-09-03 20:10:08 +02:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2005-03-25 03:21:01 +01:00
|
|
|
if [string match "" $what_kind] { set what_kind "hidden" }
|
|
|
|
|
2006-03-21 00:22:13 +01:00
|
|
|
return [check_no_compiler_messages visibility_available_$what_kind object "
|
2005-03-25 03:21:01 +01:00
|
|
|
void f() __attribute__((visibility(\"$what_kind\")));
|
|
|
|
void f() {}
|
|
|
|
"]
|
2003-12-10 07:34:46 +01:00
|
|
|
}
|
|
|
|
|
1999-11-05 11:38:01 +01:00
|
|
|
###############################
|
|
|
|
# proc check_alias_available { }
|
|
|
|
###############################
|
|
|
|
|
|
|
|
# Determine if the target toolchain supports the alias attribute.
|
|
|
|
|
2003-06-06 00:18:55 +02:00
|
|
|
# Returns 2 if the target supports aliases. Returns 1 if the target
|
|
|
|
# only supports weak aliased. Returns 0 if the target does not
|
|
|
|
# support aliases at all. Returns -1 if support for aliases could not
|
|
|
|
# be determined.
|
|
|
|
|
|
|
|
proc check_alias_available { } {
|
1999-11-05 11:38:01 +01:00
|
|
|
global alias_available_saved
|
2004-02-05 06:09:38 +01:00
|
|
|
global tool
|
|
|
|
|
1999-11-05 11:38:01 +01:00
|
|
|
if [info exists alias_available_saved] {
|
|
|
|
verbose "check_alias_available returning saved $alias_available_saved" 2
|
|
|
|
} else {
|
2004-05-29 00:28:22 +02:00
|
|
|
set src alias[pid].c
|
|
|
|
set obj alias[pid].o
|
|
|
|
verbose "check_alias_available compiling testfile $src" 2
|
|
|
|
set f [open $src "w"]
|
2003-06-20 21:11:07 +02:00
|
|
|
# Compile a small test program. The definition of "g" is
|
|
|
|
# necessary to keep the Solaris assembler from complaining
|
|
|
|
# about the program.
|
2004-02-21 04:02:32 +01:00
|
|
|
puts $f "#ifdef __cplusplus\nextern \"C\"\n#endif\n"
|
2003-06-20 21:11:07 +02:00
|
|
|
puts $f "void g() {} void f() __attribute__((alias(\"g\")));"
|
2003-06-06 00:18:55 +02:00
|
|
|
close $f
|
2004-05-29 00:28:22 +02:00
|
|
|
set lines [${tool}_target_compile $src $obj object ""]
|
|
|
|
file delete $src
|
|
|
|
remote_file build delete $obj
|
2003-06-06 00:18:55 +02:00
|
|
|
|
1999-11-05 11:38:01 +01:00
|
|
|
if [string match "" $lines] then {
|
|
|
|
# No error messages, everything is OK.
|
2003-06-06 00:18:55 +02:00
|
|
|
set alias_available_saved 2
|
1999-11-05 11:38:01 +01:00
|
|
|
} else {
|
|
|
|
if [regexp "alias definitions not supported" $lines] {
|
|
|
|
verbose "check_alias_available target does not support aliases" 2
|
|
|
|
|
|
|
|
set objformat [gcc_target_object_format]
|
|
|
|
|
|
|
|
if { $objformat == "elf" } {
|
|
|
|
verbose "check_alias_available but target uses ELF format, so it ought to" 2
|
2003-06-06 00:18:55 +02:00
|
|
|
set alias_available_saved -1
|
1999-11-05 11:38:01 +01:00
|
|
|
} else {
|
2003-06-06 00:18:55 +02:00
|
|
|
set alias_available_saved 0
|
1999-11-05 11:38:01 +01:00
|
|
|
}
|
|
|
|
} else {
|
2001-01-03 19:22:23 +01:00
|
|
|
if [regexp "only weak aliases are supported" $lines] {
|
|
|
|
verbose "check_alias_available target supports only weak aliases" 2
|
2003-06-06 00:18:55 +02:00
|
|
|
set alias_available_saved 1
|
2001-01-03 19:22:23 +01:00
|
|
|
} else {
|
2003-06-06 00:18:55 +02:00
|
|
|
set alias_available_saved -1
|
2001-01-03 19:22:23 +01:00
|
|
|
}
|
1999-11-05 11:38:01 +01:00
|
|
|
}
|
|
|
|
}
|
2004-02-27 03:01:10 +01:00
|
|
|
|
1999-11-05 11:38:01 +01:00
|
|
|
verbose "check_alias_available returning $alias_available_saved" 2
|
|
|
|
}
|
|
|
|
|
|
|
|
return $alias_available_saved
|
|
|
|
}
|
2003-06-06 00:18:55 +02:00
|
|
|
|
|
|
|
# Returns true if --gc-sections is supported on the target.
|
|
|
|
|
|
|
|
proc check_gc_sections_available { } {
|
|
|
|
global gc_sections_available_saved
|
2004-02-05 06:09:38 +01:00
|
|
|
global tool
|
2003-06-06 00:18:55 +02:00
|
|
|
|
2003-06-09 17:33:36 +02:00
|
|
|
if {![info exists gc_sections_available_saved]} {
|
2004-12-04 19:01:09 +01:00
|
|
|
# Some targets don't support gc-sections despite whatever's
|
|
|
|
# advertised by ld's options.
|
|
|
|
if { [istarget alpha*-*-*]
|
|
|
|
|| [istarget ia64-*-*] } {
|
|
|
|
set gc_sections_available_saved 0
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2007-04-14 04:05:43 +02:00
|
|
|
# elf2flt uses -q (--emit-relocs), which is incompatible with
|
|
|
|
# --gc-sections.
|
|
|
|
if { [board_info target exists ldflags]
|
|
|
|
&& [regexp " -elf2flt\[ =\]" " [board_info target ldflags] "] } {
|
|
|
|
set gc_sections_available_saved 0
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2007-03-15 10:34:25 +01:00
|
|
|
# VxWorks kernel modules are relocatable objects linked with -r,
|
|
|
|
# while RTP executables are linked with -q (--emit-relocs).
|
|
|
|
# Both of these options are incompatible with --gc-sections.
|
|
|
|
if { [istarget *-*-vxworks*] } {
|
|
|
|
set gc_sections_available_saved 0
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2003-06-06 00:18:55 +02:00
|
|
|
# Check if the ld used by gcc supports --gc-sections.
|
2004-09-03 20:10:08 +02:00
|
|
|
set gcc_spec [${tool}_target_compile "-dumpspecs" "" "none" ""]
|
|
|
|
regsub ".*\n\*linker:\[ \t\]*\n(\[^ \t\n\]*).*" "$gcc_spec" {\1} linker
|
|
|
|
set gcc_ld [lindex [${tool}_target_compile "-print-prog-name=$linker" "" "none" ""] 0]
|
2003-06-06 00:18:55 +02:00
|
|
|
set ld_output [remote_exec host "$gcc_ld" "--help"]
|
|
|
|
if { [ string first "--gc-sections" $ld_output ] >= 0 } {
|
|
|
|
set gc_sections_available_saved 1
|
|
|
|
} else {
|
|
|
|
set gc_sections_available_saved 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $gc_sections_available_saved
|
|
|
|
}
|
2003-12-24 00:55:06 +01:00
|
|
|
|
2008-04-10 01:58:39 +02:00
|
|
|
# Return 1 if according to target_info struct and explicit target list
|
|
|
|
# target is supposed to support trampolines.
|
|
|
|
|
|
|
|
proc check_effective_target_trampolines { } {
|
|
|
|
if [target_info exists no_trampolines] {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
if { [istarget avr-*-*]
|
|
|
|
|| [istarget hppa2.0w-hp-hpux11.23]
|
|
|
|
|| [istarget hppa64-hp-hpux11.23] } {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2008-06-20 00:08:25 +02:00
|
|
|
# Return 1 if according to target_info struct and explicit target list
|
|
|
|
# target is supposed to keep null pointer checks. This could be due to
|
|
|
|
# use of option fno-delete-null-pointer-checks or hardwired in target.
|
|
|
|
|
|
|
|
proc check_effective_target_keeps_null_pointer_checks { } {
|
|
|
|
if [target_info exists keeps_null_pointer_checks] {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
if { [istarget avr-*-*] } {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2003-12-24 00:55:06 +01:00
|
|
|
# Return true if profiling is supported on the target.
|
|
|
|
|
2004-02-21 03:58:24 +01:00
|
|
|
proc check_profiling_available { test_what } {
|
2003-12-24 00:55:06 +01:00
|
|
|
global profiling_available_saved
|
|
|
|
|
2004-02-21 03:58:24 +01:00
|
|
|
verbose "Profiling argument is <$test_what>" 1
|
|
|
|
|
|
|
|
# These conditions depend on the argument so examine them before
|
|
|
|
# looking at the cache variable.
|
|
|
|
|
|
|
|
# Support for -p on solaris2 relies on mcrt1.o which comes with the
|
|
|
|
# vendor compiler. We cannot reliably predict the directory where the
|
|
|
|
# vendor compiler (and thus mcrt1.o) is installed so we can't
|
|
|
|
# necessarily find mcrt1.o even if we have it.
|
|
|
|
if { [istarget *-*-solaris2*] && [lindex $test_what 1] == "-p" } {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
# Support for -p on irix relies on libprof1.a which doesn't appear to
|
|
|
|
# exist on any irix6 system currently posting testsuite results.
|
|
|
|
# Support for -pg on irix relies on gcrt1.o which doesn't exist yet.
|
|
|
|
# See: http://gcc.gnu.org/ml/gcc/2002-10/msg00169.html
|
2004-02-27 03:01:10 +01:00
|
|
|
if { [istarget mips*-*-irix*]
|
2004-02-21 03:58:24 +01:00
|
|
|
&& ([lindex $test_what 1] == "-p" || [lindex $test_what 1] == "-pg") } {
|
|
|
|
return 0
|
configure.ac (mips*-*-*linux*, [...]): Use mt-mips-gnu.
* configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu.
* configure: Regenerate.
config/
* mt-mips16-compat: New file, taken from mt-mips-elfoabi.
* mt-mips-elfoabi: Include mt-mips16-compat.
* mt-mips-gnu: New file.
gcc/
* config.gcc (mips*-*-linux*, mips64*-*-linux*): Add
mips/t-libgcc-mips16 to tmake_file.
* config/mips/mips-protos.h (mips_call_type): New enum.
(mips_pic_base_register, mips_got_load): Declare.
(mips_restore_gp): Take an rtx argument.
(mips_use_pic_fn_addr_reg_p): Declare.
(mips_expand_call): Replace the sibcall_p argument with
a mips_call_type argument. Add a lazy_p parameter.
(mips_split_call): Declare.
* config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro.
(MIPS16_PIC_TEMP): Likewise.
(reg_class): Delete M16_NA_REGS.
(REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly.
(SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros.
(mips_split_hi_p): Declare.
* config/mips/mips.c (mips_split_hi_p): New array.
(mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS.
(mips_got_symbol_type_p): New function.
(mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P.
(mips16_stub_function_p): New function.
(mips16_local_function_p): Likewise.
(mips_use_pic_fn_addr_reg_p): Likewise.
(mips_cannot_force_const_mem): Return false for HIGHs.
Extend CONST_INT and symbolic handling to MIPS16, using
mips_symbol_insns to check that the base symbol type is a
legitimate constant. Reject GOT-based constants if
TARGET_MIPS16_PCREL_LOADS.
(mips_const_insns): Check targetm.cannot_force_const_mem when
decomposing a symbolic base and a large offset.
(mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters.
When calling a function that needs $25 from MIPS16 code,
move the target address into $25 separately and add a USE
to the call insn.
(mips16_gp_pseudo_reg): Insert the initializer immediately
before the first real insn.
(mips_pic_base_register, mips_got_load): New functions.
(mips_split_symbol): Generalize the name of the LO_SUM_OUT
parameter to LOW_OUT. Say that it can be any valid SET_SRC
when splitting a load-address operation. Split SYMBOL_GOT_DISP
constants and highs of SYMBOL_GOT_PAGE_OFST constants.
(mips_call_tls_get_addr): Update the call to mips_expand_call,
also passing NULL_RTX rather than const0_rtx as the aux argument.
(mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p
instead of TARGET_EXPLICIT_RELOCS.
(mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P.
(mips_load_call_address): Replace the sibcall_p argument with
a mips_call_type argument. Use mips_got_load.
(mips16_local_alias): New structure.
(mips16_local_aliases): New variable.
(mips16_local_aliases_hash): New function.
(mips16_local_aliases_eq): Likewise.
(mips16_local_alias): Likewise.
(mips16_stub_function): Likewise.
(mips16_build_function_stub): Create a local alias for the target
function. Handle TARGET_ABICALLS. For PIC abicalls, emit a
.cpload directive and an R_MIPS_NONE relocation for the target
function, then load the alias rather than the function itself.
Wrap the non-PIC abicalls version in ".option pic0/.option pic2".
(mips16_copy_fpr_return_value): Use mips16_stub_function and
mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol.
(mips16_build_call_stub): Replace the FN parameter with an
FN_PTR parameter. Force the address into a register if it
isn't a call_insn_operand; don't rely on the caller to do this.
If a call to a locally-defined and locally-binding MIPS16
function must be made indirectly, redirect the call to the
function's local alias. Use mips16_stub_function_p,
mips16_stub_function, mips_expand_call and use_reg.
Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols.
Use explicit %hi and %lo accesses where possible.
Use MIPS_CALL to generate the correct code form of a
jal instruction. Add clobbers of $18 instead of uses.
Update the call to mips_emit_call_insn.
(mips_expand_call): Replace the SIBCALL_P argument with a
mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value.
Take a LAZY_P parameter. Call mips16_build_call_stub first,
allowing it to modify the call address. Update the calls to
mips_load_call_address and mips_emit_call_insn.
(mips_split_call): New function.
(mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if
!TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of
SYMBOL_GOT_PAGE_OFST, for MIPS16 code.
(mips_global_pointer): Check mips16_cfun_returns_in_fpr_p.
(mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM
if TARGET_MIPS16.
(mips_cprestore_slot): New function.
(mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16
and use mips_cprestore_slot.
(mips_output_function_prologue): Handle TARGET_MIPS16 for
LOADGP_OLDABI.
(mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16,
then use a copygp_mips16 instruction to set up $28.
(mips_expand_prologue): Initialize the cprestore slot for MIPS16 too.
(mips16_lay_out_constants): Call split_all_insns_noflow.
(mips_reorg_process_insns): Explicitly set all_noreorder_p to
false if TARGET_MIPS16.
(mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16.
(mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the
mips_dangerous_for_la25_p approach for MIPS16 PIC calls too.
(mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for
MIPS16 code. Allow MIPS16 o32 PIC.
(mips_override_options): Allow MIPS16 o32 PIC.
* config/mips/mips.md: Lower CONST_GP_P moves into register moves
after reload if TARGET_USE_GOT.
(UNSPEC_COPYGP): New constant.
(length): Use a default length of 8 for MIPS16 GOT loads.
(*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT.
(*got_page<mode>): Check mips_split_hi_p.
(*got_disp<mode>, *got_page<mode>): Use mips_got_load.
(unspec_got<mode>, unspec_call<mode>): New expanders.
(load_got<mode>, load_call<mode>): Remove the length attributes.
Use a got attribute instead of a type attribute.
(copygp_mips16): New insn.
(restore_gp): Add a scratch clobber and pass it to mips_restore_gp.
(load_call<mode>): Use a "d" constraint instead of an "r" constraint.
(sibcall, sibcall_value, call, call_value): Update the calls
to mips_expand_call.
(call_internal, call_value_internal): Use mips_split_call.
(call_value_multiple_internal): Likewise.
(call_split): Move after call_internal (the insn it is split from).
(call_internal_direct, call_value_internal_direct): Turn into
define_insn_and_splits. Split if TARGET_SPLIT_CALLS.
(call_direct_split, call_value_direct_split): New patterns.
* config/mips/constraints.md (c): Handle TARGET_MIPS16 first
and use M16_REGS instead of M16_NA_REGS.
* config/mips/predicates.md (const_call_insn_operand): Replace
the TARGET_ABSOLUTE_ABICALLS-based check with a more general
mips_use_pic_fn_addr_reg_p check.
(move_operand): Reject HIGHs if mips_split_hi_p.
* config/mips/mips16.S: Assembly as empty if the ABI is not suitable.
(__mips16_floatunsisf): Inline __mips16_floatsisf.
(CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25.
* config/mips/libgcc-mips16.ver: New file.
* config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add
$(srcdir)/config/mips/libgcc-mips16.ver.
gcc/testsuite/
* lib/target-supports.exp (check_profiling_available): Return false
for -p and -pg on MIPS16 targets.
From-SVN: r138912
2008-08-09 21:08:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# We don't yet support profiling for MIPS16.
|
|
|
|
if { [istarget mips*-*-*]
|
|
|
|
&& ![check_effective_target_nomips16]
|
|
|
|
&& ([lindex $test_what 1] == "-p"
|
|
|
|
|| [lindex $test_what 1] == "-pg") } {
|
|
|
|
return 0
|
2004-02-21 03:58:24 +01:00
|
|
|
}
|
|
|
|
|
2008-02-26 01:12:03 +01:00
|
|
|
# MinGW does not support -p.
|
|
|
|
if { [istarget *-*-mingw*] && [lindex $test_what 1] == "-p" } {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2009-05-12 10:34:46 +02:00
|
|
|
# cygwin does not support -p.
|
|
|
|
if { [istarget *-*-cygwin*] && [lindex $test_what 1] == "-p" } {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2007-04-18 01:55:07 +02:00
|
|
|
# uClibc does not have gcrt1.o.
|
|
|
|
if { [check_effective_target_uclibc]
|
|
|
|
&& ([lindex $test_what 1] == "-p"
|
|
|
|
|| [lindex $test_what 1] == "-pg") } {
|
|
|
|
return 0
|
2006-01-10 08:18:15 +01:00
|
|
|
}
|
|
|
|
|
2004-02-21 03:58:24 +01:00
|
|
|
# Now examine the cache variable.
|
2003-12-24 00:55:06 +01:00
|
|
|
if {![info exists profiling_available_saved]} {
|
|
|
|
# Some targets don't have any implementation of __bb_init_func or are
|
|
|
|
# missing other needed machinery.
|
|
|
|
if { [istarget mmix-*-*]
|
2004-08-20 00:29:11 +02:00
|
|
|
|| [istarget arm*-*-eabi*]
|
2008-12-29 11:31:14 +01:00
|
|
|
|| [istarget picochip-*-*]
|
|
|
|
|| [istarget *-*-netware*]
|
2003-12-24 00:55:06 +01:00
|
|
|
|| [istarget arm*-*-elf]
|
2004-08-20 00:29:11 +02:00
|
|
|
|| [istarget arm*-*-symbianelf*]
|
2008-04-10 01:58:39 +02:00
|
|
|
|| [istarget avr-*-*]
|
2007-02-28 03:03:41 +01:00
|
|
|
|| [istarget bfin-*-*]
|
2004-04-22 01:23:33 +02:00
|
|
|
|| [istarget powerpc-*-eabi*]
|
2003-12-24 00:55:06 +01:00
|
|
|
|| [istarget cris-*-*]
|
peep2-xsrand.c, [...]: Drop redundant target-specifier.
* gcc.target/cris/peep2-xsrand.c, gcc.target/cris/asmreg-1.c,
gcc.target/cris/peep2-andu1.c, gcc.target/cris/peep2-xsrand2.c,
gcc.target/cris/20011127-1.c: Drop redundant target-specifier.
* gcc.target/cris/peep2-andu2.c: Ditto. Make dg-do assemble and
add -save-temps.
* gcc.target/cris/torture/cris-torture.exp,
gcc.target/cris/cris.exp: Run for crisv32-*-* too.
* gcc.target/cris/builtin_ctz_v3.c,
gcc.target/cris/builtin_ctz_v8.c,
gcc.target/cris/builtin_clz_v0.c,
gcc.target/cris/builtin_clz_v3.c,
gcc.target/cris/builtin_bswap_v3.c,
gcc.target/cris/builtin_bswap_v8.c, gcc.dg/sibcall-4.c,
gcc.dg/pr19340.c, gcc.dg/20020919-1.c, gcc.dg/pr31866.c,
gcc.dg/torture/cris-asm-mof-1.c, gcc.dg/torture/cris-volatile-1.c,
gcc.dg/weak/typeof-2.c, gcc.dg/tree-ssa/loop-1.c,
gcc.dg/tree-ssa/20040204-1.c, gcc.dg/sibcall-3.c,
lib/target-supports.exp: Adjust for crisv32-*-*.
From-SVN: r130962
2007-12-15 22:31:18 +01:00
|
|
|
|| [istarget crisv32-*-*]
|
2007-08-27 16:28:03 +02:00
|
|
|
|| [istarget fido-*-elf]
|
2004-02-27 03:01:10 +01:00
|
|
|
|| [istarget h8300-*-*]
|
2006-04-14 01:14:25 +02:00
|
|
|
|| [istarget m32c-*-elf]
|
2006-03-03 18:42:50 +01:00
|
|
|
|| [istarget m68k-*-elf]
|
2007-04-16 19:18:08 +02:00
|
|
|
|| [istarget m68k-*-uclinux*]
|
2009-06-24 06:16:25 +02:00
|
|
|
|| [istarget mep-*-elf]
|
2007-09-18 01:44:00 +02:00
|
|
|
|| [istarget mips*-*-elf*]
|
2009-06-10 07:23:39 +02:00
|
|
|
|| [istarget moxie-*-elf*]
|
2008-02-01 17:39:11 +01:00
|
|
|
|| [istarget xstormy16-*]
|
2008-08-06 18:02:16 +02:00
|
|
|
|| [istarget xtensa*-*-elf]
|
2008-12-20 16:28:57 +01:00
|
|
|
|| [istarget *-*-rtems*]
|
MAINTAINERS (mt port): Remove.
* MAINTAINERS (mt port): Remove.
(sco5, unixware, sco udk): Remove.
(Kean Johnston): Add to Write After Approval.
fixincludes:
* inclhack.def (AAB_svr4_replace_byteorder,
AAB_ultrix_ansi_compat, AAB_ultrix_limits, AAB_ultrix_memory,
libc1_G_va_list, libc1_ifdefd_memx, nested_motorola,
ptx_sys_mc_param_h, sco_regset, sco_static_func, sco_utime,
solaris_mutex_init_1, solaris_socket, solaris_unistd,
solaris_widec, svr4_krnl, ultrix_atexit_param, ultrix_atof_param,
ultrix_const3, ultrix_fix_fixproto, ultrix_ifdef, ultrix_locale,
ultrix_math_ifdef, ultrix_nested_ioctl, ultrix_nested_svc,
ultrix_stat, ultrix_static, ultrix_stdlib, ultrix_strings,
ultrix_strings2, ultrix_sys_time, ultrix_unistd,
unicosmk_restrict, uw7_byteorder_fix, windiss_math1,
windiss_math2, windiss_valist): Remove.
* fixincl.x: Regenerate.
* mkfixinc.sh: (arm-semi-aof, hppa1.1-*-osf*, hppa1.1-*-bsd*,
i370-*-openedition, i?86-*-moss*, i?86-*-uwin*,
powerpc-*-eabiaix*): Remove.
* tests/base/math.h: Update.
* tests/base/pthread.h: Update.
* tests/base/stdio.h: Update.
* tests/base/stdlib.h: Update.
* tests/base/string.h: Update.
* tests/base/strings.h: Update.
* tests/base/sys/file.h: Update.
* tests/base/sys/limits.h: Update.
* tests/base/sys/socket.h: Update.
* tests/base/sys/stat.h: Update.
* tests/base/sys/time.h: Update.
* tests/base/testing.h: Update.
* tests/base/unistd.h: Update.
* tests/base/_G_config.h: Remove.
* tests/base/arpa: Remove directory.
* tests/base/fs: Remove directory.
* tests/base/locale.h: Remove.
* tests/base/machine: Remove directory.
* tests/base/rpc/svc.h: Remove.
* tests/base/sys/ioctl.h: Remove.
* tests/base/sys/regset.h: Remove.
* tests/base/sys/times.h: Remove.
* tests/base/sys/utsname.h: Remove.
* tests/base/widec.h: Remove.
gcc:
* config.gcc (Obsolete configurations): Remove list of
configurations.
(Unsupported targets list): Add *-*-linux*aout*, *-*-linux*libc1*,
*-*-solaris2.[0-6], *-*-solaris2.[0-6].*, *-*-sysv*. Remove other
targets matched by those patterns.
(strongarm*-*-*, ep9312*-*-*, xscale-*-*, parisc*-*-*,
m680[012]0-*-*, *-*-linux*libc1*, *-*-linux*aout*,
alpha*-*-unicosmk*, strongarm*-*-freebsd*, ep9312-*-elf,
arm*-*-kaos*, cris-*-aout, parisc*64*-*-linux*, parisc*-*-linux*,
hppa1.1-*-pro*, hppa1.1-*-osf*, hppa1.1-*-bsd*,
i[34567]86-sequent-ptx4*, i[34567]86-sequent-sysv4*,
i[34567]86-*-beoself*, i[34567]86-*-beos*, i[34567]86-*-sco3.2v5*,
i[34567]86-*-sysv5*, i[34567]86-*-sysv4*, i[34567]86-*-uwin*,
i[34567]86-*-kaos*, m68020-*-elf*, m68010-*-netbsdelf*,
mips-wrs-windiss, mt-*-elf, powerpc-*-beos*, powerpc-*-chorusos*,
powerpc-wrs-windiss*, powerpcle-*-sysv*, powerpc-*-kaos*,
powerpcle-*-kaos*, sh*-*-kaos*, sparc-*-sysv4*, strongarm-*-elf*,
strongarm-*-pe, strongarm-*-kaos*, vax-*-bsd*, vax-*-sysv*,
vax-*-ultrix*, xscale-*-elf, xscale-*-coff,
i[34567]86-*-linux*aout*, i[34567]86-*-linux*libc1): Remove.
Make code for Solaris 7 and greater unconditional for Solaris.
(ep9312-*-*, parisc1*, m680[012]0-*-*, parisc*-*-*, mt-*-*):
Remove --with-* handling.
* config/rs6000/sysv4.h (-mwindiss): Remove from all specs.
(LIB_WINDISS_SPEC, CPP_OS_WINDISS_SPEC, STARTFILE_WINDISS_SPEC,
ENDFILE_WINDISS_SPEC, LINK_START_WINDISS_SPEC,
LINK_OS_WINDISS_SPEC): Remove.
* config/rs6000/sysv4.opt (mwindiss): Remove.
* configure.ac (strongarm*-*-*, xscale*-*-*): Remove.
* configure: Regenerate.
* doc/cpp.texi: Don't mention BeOS.
* doc/extend.texi (interrupt): Don't mention MS1.
* doc/install.texi: (i386-@var{any}-sysv, m68k-bull-sysv,
m68k-hp-hpux, m68000-hp-hpux, m68000-att-sysv,
alphaev5-cray-unicosmk*, xscale-*-*, i?86-*-linux*aout,
i?86-*-sco3.2v5*, i?86-*-udk, m68k-hp-hpux, powerpc-*-sysv4,
powerpc-*-sysv4, powerpcle-*-sysv4, *-*-sysv*, vax-dec-ultrix):
Remove.
* doc/invoke.texi (MT Options): Remove.
(-mwindiss): Remove.
(CRIS Options): Remove cris-axis-aout references.
(HPPA Options): Don't mention hppa1.1-*-pro.
* doc/md.texi: (MorphoTech family): Remove.
* libgcc2.c: Don't handle UWIN.
* config/alpha/t-unicosmk: Remove.
* config/alpha/unicosmk.h: Remove.
* config/arm/kaos-arm.h: Remove.
* config/arm/kaos-strongarm.h: Remove.
* config/arm/strongarm-coff.h: Remove.
* config/arm/strongarm-elf.h: Remove.
* config/arm/strongarm-pe.h: Remove.
* config/arm/t-strongarm-pe: Remove.
* config/arm/t-xscale-coff: Remove.
* config/arm/t-xscale-elf: Remove.
* config/arm/xscale-coff.h: Remove.
* config/arm/xscale-elf.h: Remove.
* config/chorus.h: Remove.
* config/cris/aout.h: Remove.
* config/cris/aout.opt: Remove.
* config/cris/t-aout: Remove.
* config/i386/beos-elf.h: Remove.
* config/i386/kaos-i386.h: Remove.
* config/i386/ptx4-i.h: Remove.
* config/i386/sco5.h: Remove.
* config/i386/sco5.opt: Remove.
* config/i386/sysv4-cpp.h: Remove.
* config/i386/sysv5.h: Remove.
* config/i386/t-beos: Remove.
* config/i386/t-sco5: Remove.
* config/i386/t-uwin: Remove.
* config/i386/uwin.asm: Remove.
* config/i386/uwin.h: Remove.
* config/kaos.h: Remove.
* config/mips/windiss.h: Remove.
* config/mt: Remove directory.
* config/pa/pa-osf.h: Remove.
* config/pa/pa-pro-end.h: Remove.
* config/pa/t-pro: Remove.
* config/ptx4.h: Remove.
* config/rs6000/beos.h: Remove.
* config/rs6000/kaos-ppc.h: Remove.
* config/rs6000/t-beos: Remove.
* config/rs6000/windiss.h: Remove.
* config/sh/kaos-sh.h: Remove.
* config/sol2-6.h: Remove.
* config/sparc/sol26-sld.h: Remove.
* config/sparc/sysv4-only.h: Remove.
* config/vax/bsd.h: Remove.
* config/vax/t-memfuncs: Remove.
* config/vax/ultrix.h: Remove.
* config/vax/vaxv.h: Remove.
* config/windiss.h: Remove.
gcc/testsuite:
* g++.dg/abi/arm_cxa_vec1.C: Don't handle xscale*-*-*.
* g++.dg/eh/spbp.C: Don't handle *-*-solaris2.[56]*.
* g++.dg/warn/miss-format-1.C: Don't handle Solaris before Solaris
7.
* gcc.c-torture/compile/981006-1.c: Don't handle xscale*-*-*,
strongarm*-*-* and cris-*-aout*.
* gcc.c-torture/execute/941014-1.x: Don't handle xscale*-*-* and
strongarm*-*-*.
* gcc.dg/20030909-1.c: Don't handle xscale*-*-* and
strongarm*-*-*.
* gcc.dg/20031108-1.c: Don't handle xscale*-*-* and
strongarm*-*-*.
* gcc.dg/20040813-1.c: Don't handle *-*-sysv5*.
* gcc.dg/arm-asm.c: Don't handle strongarm*-*-* and xscale*-*-*.
* gcc.dg/arm-scd42-1.c: Use target arm*-*-*.
* gcc.dg/arm-scd42-3.c: Use target arm*-*-*.
* gcc.dg/cpp/assert4.c: Don't handle BeOS.
* gcc.dg/debug/pr35154.c: Don't handle *-*-sysv5*.
* gcc.dg/intmax_t-1.c: Don't handle *-*-solaris2.5.1 and
xscale*-*-elf*.
* gcc.dg/pragma-align.c: Don't handle i?86-*-sco3.2v5*.
* gcc.dg/pthread-init-2.c: Don't handle *-*-solaris2.5.1.
* gcc.misc-tests/arm-isr.exp: Use target arm*-*-*.
* gcc.target/powerpc/ppc-sdata-1.c: Don't handle powerpc-*-sysv*.
* gcc.target/powerpc/ppc-sdata-2.c: Don't handle powerpc-*-sysv*.
* gcc.target/powerpc/ppc-stackalign-1.c: Don't handle
powerpc-*-sysv*.
* gfortran.dg/debug/pr35154-stabs.f: Don't handle *-*-sysv5*.
* lib/target-supports.exp: Don't handle strongarm*-*-elf,
xscale*-*-elf and *-*-windiss.
* obj-c++.dg/dwarf-2.mm: Don't handle *-*-solaris2.[56]*.
* objc.dg/dwarf-1.m: Don't handle *-*-solaris2.[56]*.
* objc.dg/dwarf-2.m: Don't handle *-*-solaris2.[56]*.
* gcc.dg/mt-loopi1.c: Remove.
gnattools:
* configure.ac (xscale*-wrs-vx*, xscale*-wrs-coff): Remove.
* configure: Regenerate.
libcpp:
* configure.ac (parisc*64*-*-*): Remove.
* configure: Regenerate.
libffi:
* configure.ac (parisc*-*-linux*, powerpc-*-sysv*,
powerpc-*-beos*): Remove.
* configure: Regenerate.
libgcc:
* config.host (strongarm*-*-*, ep9312*-*-*, xscale-*-*,
parisc*-*-*, m680[012]0-*-*, *-*-linux*libc1*, *-*-linux*aout*,
alpha*-*-unicosmk*, strongarm*-*-freebsd*, ep9312-*-elf,
arm*-*-kaos*, cris-*-aout, parisc*64*-*-linux*, parisc*-*-linux*,
hppa1.1-*-pro*, hppa1.1-*-osf*, hppa1.1-*-bsd*,
i[34567]86-sequent-ptx4*, i[34567]86-sequent-sysv4*,
i[34567]86-*-beoself*, i[34567]86-*-beos*, i[34567]86-*-sco3.2v5*,
i[34567]86-*-sysv5*, i[34567]86-*-sysv4*, i[34567]86-*-uwin*,
i[34567]86-*-kaos*, m68020-*-elf*, m68010-*-netbsdelf*,
mips-wrs-windiss, mt-*-elf, powerpc-*-beos*, powerpc-*-chorusos*,
powerpc-wrs-windiss*, powerpcle-*-sysv*, powerpc-*-kaos*,
powerpcle-*-kaos*, sh*-*-kaos*, sparc-*-sysv4*, strongarm-*-elf*,
strongarm-*-pe, strongarm-*-kaos*, vax-*-bsd*, vax-*-sysv*,
vax-*-ultrix*, xscale-*-elf, xscale-*-coff): Remove.
libjava:
* configure.host (strongarm*-elf, xscale*-elf): Remove.
libstdc++-v3:
* configure.host (xscale, ep9312, m680[246]0, solaris2.5,
solaris2.5.[0-9], solaris2.6, windiss*): Remove.
* crossconfig.m4 (*-solaris2.5, *-solaris2.6, *-windiss*): Remove.
* configure: Regenerate.
* config/os/solaris/solaris2.5: Remove directory.
* config/os/solaris/solaris2.6: Remove directory.
* config/os/windiss: Remove directory.
From-SVN: r136534
2008-06-07 20:00:15 +02:00
|
|
|
|| [istarget *-*-vxworks*] } {
|
2003-12-24 00:55:06 +01:00
|
|
|
set profiling_available_saved 0
|
|
|
|
} else {
|
|
|
|
set profiling_available_saved 1
|
|
|
|
}
|
|
|
|
}
|
2004-02-27 03:01:10 +01:00
|
|
|
|
2003-12-24 00:55:06 +01:00
|
|
|
return $profiling_available_saved
|
|
|
|
}
|
2004-02-27 03:01:10 +01:00
|
|
|
|
2008-12-29 11:31:14 +01:00
|
|
|
# Check to see if a target is "freestanding". This is as per the definition
|
|
|
|
# in Section 4 of C99 standard. Effectively, it is a target which supports no
|
|
|
|
# extra headers or libraries other than what is considered essential.
|
|
|
|
proc check_effective_target_freestanding { } {
|
|
|
|
if { [istarget picochip-*-*] } then {
|
|
|
|
return 1
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-11-02 03:41:44 +01:00
|
|
|
# Return 1 if target has packed layout of structure members by
|
|
|
|
# default, 0 otherwise. Note that this is slightly different than
|
|
|
|
# whether the target has "natural alignment": both attributes may be
|
|
|
|
# false.
|
|
|
|
|
|
|
|
proc check_effective_target_default_packed { } {
|
2006-03-21 00:22:13 +01:00
|
|
|
return [check_no_compiler_messages default_packed assembly {
|
|
|
|
struct x { char a; long b; } c;
|
|
|
|
int s[sizeof (c) == sizeof (char) + sizeof (long) ? 1 : -1];
|
|
|
|
}]
|
2005-11-02 03:41:44 +01:00
|
|
|
}
|
|
|
|
|
2005-11-02 03:49:24 +01:00
|
|
|
# Return 1 if target has PCC_BITFIELD_TYPE_MATTERS defined. See
|
|
|
|
# documentation, where the test also comes from.
|
|
|
|
|
|
|
|
proc check_effective_target_pcc_bitfield_type_matters { } {
|
2006-03-21 00:22:13 +01:00
|
|
|
# PCC_BITFIELD_TYPE_MATTERS isn't just about unnamed or empty
|
|
|
|
# bitfields, but let's stick to the example code from the docs.
|
|
|
|
return [check_no_compiler_messages pcc_bitfield_type_matters assembly {
|
|
|
|
struct foo1 { char x; char :0; char y; };
|
|
|
|
struct foo2 { char x; int :0; char y; };
|
|
|
|
int s[sizeof (struct foo1) != sizeof (struct foo2) ? 1 : -1];
|
|
|
|
}]
|
2005-11-02 03:49:24 +01:00
|
|
|
}
|
|
|
|
|
Restore detection of unsupported TLS.
2007-09-18 Sandra Loosemore <sandra@codesourcery.com>
gcc/testsuite
Restore detection of unsupported TLS.
Revert this patch:
2007-02-10 Richard Henderson <rth@redhat.com>
* lib/target-supports.exp (check_effective_target_tls): Redefine
to mean non-emulated tls.
* gcc.dg/tls/alias-1.c: Remove tls requirement.
* gcc.dg/tls/asm-1.c, gcc.dg/tls/debug-1.c, gcc.dg/tls/diag-1.c,
gcc.dg/tls/diag-2.c, gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c,
gcc.dg/tls/diag-5.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
gcc.dg/tls/opt-10.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c, gcc.dg/tls/pic-1.c,
gcc.dg/tls/struct-1.c, gcc.dg/tls/trivial.c: Likewise.
And then:
* lib/target-supports.exp (check_effective_target_tls): Use
stronger test for compiler support for TLS.
(check_effective_target_tls_native): New, to test for non-emulated
TLS support.
* g++.dg/gomp/clause-3.C: Use dg-require-effective-target tls_native
instead of dg-require-effective-target tls.
* g++.dg/gomp/copyin-1.C: Likewise.
* g++.dg/gomp/sharing-1.C: Likewise.
* g++.dg/gomp/tls-1.C: Likewise.
* g++.dg/gomp/tls-2.C: Likewise.
* g++.dg/gomp/tls-3.C: Likewise.
* g++.dg/tls/diag-1.C: Likewise.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/tls/diag-3.C: Likewise.
* g++.dg/tls/diag-4.C: Likewise.
* g++.dg/tls/diag-5.C: Likewise.
* g++.dg/tls/init-1.C: Likewise.
* g++.dg/tls/init-2.C: Likewise.
* g++.dg/tls/trivial.C: Likewise.
* gcc.dg/gomp/appendix-a/a.22.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.22.2.c: Likewise.
* gcc.dg/gomp/appendix-a/a.24.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.32.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.33.1.c: Likewise.
* gcc.dg/gomp/clause-1.c: Likewise.
* gcc.dg/gomp/copyin-1.c: Likewise.
* gcc.dg/gomp/sharing-1.c: Likewise.
* gcc.dg/gomp/tls-1.c: Likewise.
* gcc.dg/gomp/tls-2.c: Likewise.
* gcc.dg/tls/alpha-1.c: Likewise.
* gcc.dg/tls/opt-1.c: Likewise.
* gcc.dg/tls/opt-13.c: Likewise.
* gcc.dg/tls/opt-14.c: Likewise.
* gcc.dg/tls/opt-2.c: Likewise.
* gcc.dg/tls/opt-3.c: Likewise.
* gcc.dg/tls/opt-4.c: Likewise.
* gcc.dg/tls/opt-7.c: Likewise.
* gcc.dg/tls/section-1.c: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.4.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.5.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.6.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.24.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.32.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.33.1.f90: Likewise.
* gfortran.dg/gomp/crayptr2.f90: Likewise.
* gfortran.dg/gomp/fixed-1.f: Likewise.
* gfortran.dg/gomp/free-1.f90: Likewise.
* gfortran.dg/gomp/omp_threadprivate1.f90: Likewise.
* gfortran.dg/gomp/omp_threadprivate2.f90: Likewise.
* gfortran.dg/gomp/reduction1.f90: Likewise.
* gfortran.dg/gomp/sharing-1.f90: Likewise.
From-SVN: r128595
2007-09-19 04:35:29 +02:00
|
|
|
# Return 1 if thread local storage (TLS) is supported, 0 otherwise.
|
re PR target/24475 (gcc.dg/tls/pr24428.c execution test and gcc.dg/tls/pr24428-2.c execution test fail on IA32)
PR target/24475
* lib/target-supports.exp (check_effective_target_tls): New.
(check_effective_target_tls_runtime): New.
* gcc.dg/tls/tls.exp, g++.dg/tls/tls.exp: Remove check
for TLS support.
* gcc.dg/tls/opt-1.c, gcc.dg/tls/opt-2.c, gcc.dg/tls/opt-3.c,
gcc.dg/tls/opt-4.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
gcc.dg/tls/opt-7.c, gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c,
gcc.dg/tls/opt-10.c, gcc.dg/tls/diag-1.c, gcc.dg/tls/diag-2.c,
gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c, gcc.dg/tls/diag-5.c,
gcc.dg/tls/alias-1.c, gcc.dg/tls/alpha-1.c, gcc.dg/tls/asm-1.c,
gcc.dg/tls/debug-1.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
gcc.dg/tls/pic-1.c, gcc.dg/tls/section-1.c, gcc.dg/tls/struct-1.c,
gcc.dg/tls/trivial.c, g++.dg/tls/diag-1.C, g++.dg/tls/diag-2.C,
g++.dg/tls/diag-3.C, g++.dg/tls/diag-4.C, g++.dg/tls/init-1.C,
g++.dg/tls/init-2.C, g++.dg/tls/trivial.C: Require
effective-target TLS.
* gcc.dg/tls/pr24428-2.c, gcc.dg/tls/pr24428.c, gcc.dg/tls/opt-11.c,
g++.dg/tls/static-1a.cc, g++.dg/tls/static-1.C: Require
effective-target TLS runtime.
From-SVN: r107804
2005-12-01 07:52:11 +01:00
|
|
|
|
|
|
|
proc check_effective_target_tls {} {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_no_compiler_messages tls assembly {
|
|
|
|
__thread int i;
|
|
|
|
int f (void) { return i; }
|
|
|
|
void g (int j) { i = j; }
|
|
|
|
}]
|
Restore detection of unsupported TLS.
2007-09-18 Sandra Loosemore <sandra@codesourcery.com>
gcc/testsuite
Restore detection of unsupported TLS.
Revert this patch:
2007-02-10 Richard Henderson <rth@redhat.com>
* lib/target-supports.exp (check_effective_target_tls): Redefine
to mean non-emulated tls.
* gcc.dg/tls/alias-1.c: Remove tls requirement.
* gcc.dg/tls/asm-1.c, gcc.dg/tls/debug-1.c, gcc.dg/tls/diag-1.c,
gcc.dg/tls/diag-2.c, gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c,
gcc.dg/tls/diag-5.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
gcc.dg/tls/opt-10.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c, gcc.dg/tls/pic-1.c,
gcc.dg/tls/struct-1.c, gcc.dg/tls/trivial.c: Likewise.
And then:
* lib/target-supports.exp (check_effective_target_tls): Use
stronger test for compiler support for TLS.
(check_effective_target_tls_native): New, to test for non-emulated
TLS support.
* g++.dg/gomp/clause-3.C: Use dg-require-effective-target tls_native
instead of dg-require-effective-target tls.
* g++.dg/gomp/copyin-1.C: Likewise.
* g++.dg/gomp/sharing-1.C: Likewise.
* g++.dg/gomp/tls-1.C: Likewise.
* g++.dg/gomp/tls-2.C: Likewise.
* g++.dg/gomp/tls-3.C: Likewise.
* g++.dg/tls/diag-1.C: Likewise.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/tls/diag-3.C: Likewise.
* g++.dg/tls/diag-4.C: Likewise.
* g++.dg/tls/diag-5.C: Likewise.
* g++.dg/tls/init-1.C: Likewise.
* g++.dg/tls/init-2.C: Likewise.
* g++.dg/tls/trivial.C: Likewise.
* gcc.dg/gomp/appendix-a/a.22.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.22.2.c: Likewise.
* gcc.dg/gomp/appendix-a/a.24.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.32.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.33.1.c: Likewise.
* gcc.dg/gomp/clause-1.c: Likewise.
* gcc.dg/gomp/copyin-1.c: Likewise.
* gcc.dg/gomp/sharing-1.c: Likewise.
* gcc.dg/gomp/tls-1.c: Likewise.
* gcc.dg/gomp/tls-2.c: Likewise.
* gcc.dg/tls/alpha-1.c: Likewise.
* gcc.dg/tls/opt-1.c: Likewise.
* gcc.dg/tls/opt-13.c: Likewise.
* gcc.dg/tls/opt-14.c: Likewise.
* gcc.dg/tls/opt-2.c: Likewise.
* gcc.dg/tls/opt-3.c: Likewise.
* gcc.dg/tls/opt-4.c: Likewise.
* gcc.dg/tls/opt-7.c: Likewise.
* gcc.dg/tls/section-1.c: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.4.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.5.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.6.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.24.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.32.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.33.1.f90: Likewise.
* gfortran.dg/gomp/crayptr2.f90: Likewise.
* gfortran.dg/gomp/fixed-1.f: Likewise.
* gfortran.dg/gomp/free-1.f90: Likewise.
* gfortran.dg/gomp/omp_threadprivate1.f90: Likewise.
* gfortran.dg/gomp/omp_threadprivate2.f90: Likewise.
* gfortran.dg/gomp/reduction1.f90: Likewise.
* gfortran.dg/gomp/sharing-1.f90: Likewise.
From-SVN: r128595
2007-09-19 04:35:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if *native* thread local storage (TLS) is supported, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_tls_native {} {
|
targhooks.h (default_emutls_var_fields, [...]): Declare.
* targhooks.h (default_emutls_var_fields,
default_emutls_var_init): Declare.
* tree.h (DECL_THREAD_LOCAL): Compare against TLS_MODEL_REAL.
* target.h (struct gcc_target): Add struct emutls member.
* target-def.h (TARGET_EMUTLS_GET_ADDRESS,
TARGET_EMUTLS_REGISTER_COMMON, TARGET_EMUTLS_VAR_SECTION,
TARGET_EMUTLS_TMPL_SECTION, TARGET_EMUTLS_VAR_PREFIX,
TARGET_EMUTLS_TMPL_PREFIX, TARGET_EMUTLS_VAR_FIELDS,
TARGET_EMUTLS_VAR_INIT, TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS,
TARGET_EMUTLS_VAR_ALIGN_FIXED, TARGET_EMUTLS): New.
(TARGET_INITIALIZER): Add TARGET_EMUTLS.
* builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS,
BUILT_IN_EMUTLS_REGISTER_COMMON): Get name from targetm structure.
* dwarf2out.c (loc_descriptor_from_tree_1): Check if emutls can
emit debug information.
* coretypes.h (tls_model): Add TLS_MODEL_EMULATED, TLS_MODEL_REAL.
* varasm.c: Include targhooks.h.
(emutls_object_section, emutls_tmpl_section): New.
(EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): Remove.
(EMUTLS_SEPARATOR): New.
(prefix_name): New.
(get_emutls_object_name): New.
(default_emutls_var_fields): New, broken out of ...
(get_emutls_object_type): ... here. Adjust to use target hooks.
(get_emutls_init_templ_addr): Adjust to use target hooks.
(emutls_decl): Adjust to use target hooks.
(emutls_finish): Likewise.
(default_emutls_var_init): New, broken out of ...
(assemble_variable): ... here. Adjust to use target hooks.
* output.h (enum section_category): Add SECCAT_EMUTLS_VAR,
SECCAT_EMUTLS_TMPL.
* c-common.c (handle_section_attribute): Prevent overriding
sections for emulated tls with special sections.
* config/i386/i386.c (x86_64_elf_select_section): Add
SECCAT_EMUTLS_VAR and SECCAT_EMUTLS_TMPL.
(x86_64_elf_unique_section): Likewise.
* config/vxworks.c: Include tree.h.
(vxworks_emutls_var_fields, vxworks_emutls_var_init): New.
(vxworks_override_options): Set TLS scheme.
* gcc/doc/tm.texi (Emulated TLS): New node.
gcc/testsuite/
* gcc.dg/tls/section-2.c: New.
* gcc.dg/tls/emutls-1.c: New.
* lib/target-supports.exp (check_effective_target_tls_native):
Exclude vxworks.
From-SVN: r134729
2008-04-27 17:35:19 +02:00
|
|
|
# VxWorks uses emulated TLS machinery, but with non-standard helper
|
|
|
|
# functions, so we fail to automatically detect it.
|
|
|
|
global target_triplet
|
|
|
|
if { [regexp ".*-.*-vxworks.*" $target_triplet] } {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2007-12-09 13:07:51 +01:00
|
|
|
return [check_no_messages_and_pattern tls_native "!emutls" assembly {
|
2007-12-04 11:16:17 +01:00
|
|
|
__thread int i;
|
|
|
|
int f (void) { return i; }
|
|
|
|
void g (int j) { i = j; }
|
|
|
|
}]
|
re PR target/24475 (gcc.dg/tls/pr24428.c execution test and gcc.dg/tls/pr24428-2.c execution test fail on IA32)
PR target/24475
* lib/target-supports.exp (check_effective_target_tls): New.
(check_effective_target_tls_runtime): New.
* gcc.dg/tls/tls.exp, g++.dg/tls/tls.exp: Remove check
for TLS support.
* gcc.dg/tls/opt-1.c, gcc.dg/tls/opt-2.c, gcc.dg/tls/opt-3.c,
gcc.dg/tls/opt-4.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
gcc.dg/tls/opt-7.c, gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c,
gcc.dg/tls/opt-10.c, gcc.dg/tls/diag-1.c, gcc.dg/tls/diag-2.c,
gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c, gcc.dg/tls/diag-5.c,
gcc.dg/tls/alias-1.c, gcc.dg/tls/alpha-1.c, gcc.dg/tls/asm-1.c,
gcc.dg/tls/debug-1.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
gcc.dg/tls/pic-1.c, gcc.dg/tls/section-1.c, gcc.dg/tls/struct-1.c,
gcc.dg/tls/trivial.c, g++.dg/tls/diag-1.C, g++.dg/tls/diag-2.C,
g++.dg/tls/diag-3.C, g++.dg/tls/diag-4.C, g++.dg/tls/init-1.C,
g++.dg/tls/init-2.C, g++.dg/tls/trivial.C: Require
effective-target TLS.
* gcc.dg/tls/pr24428-2.c, gcc.dg/tls/pr24428.c, gcc.dg/tls/opt-11.c,
g++.dg/tls/static-1a.cc, g++.dg/tls/static-1.C: Require
effective-target TLS runtime.
From-SVN: r107804
2005-12-01 07:52:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if TLS executables can run correctly, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_tls_runtime {} {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_runtime tls_runtime {
|
|
|
|
__thread int thr = 0;
|
|
|
|
int main (void) { return thr; }
|
|
|
|
}]
|
re PR target/24475 (gcc.dg/tls/pr24428.c execution test and gcc.dg/tls/pr24428-2.c execution test fail on IA32)
PR target/24475
* lib/target-supports.exp (check_effective_target_tls): New.
(check_effective_target_tls_runtime): New.
* gcc.dg/tls/tls.exp, g++.dg/tls/tls.exp: Remove check
for TLS support.
* gcc.dg/tls/opt-1.c, gcc.dg/tls/opt-2.c, gcc.dg/tls/opt-3.c,
gcc.dg/tls/opt-4.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
gcc.dg/tls/opt-7.c, gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c,
gcc.dg/tls/opt-10.c, gcc.dg/tls/diag-1.c, gcc.dg/tls/diag-2.c,
gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c, gcc.dg/tls/diag-5.c,
gcc.dg/tls/alias-1.c, gcc.dg/tls/alpha-1.c, gcc.dg/tls/asm-1.c,
gcc.dg/tls/debug-1.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
gcc.dg/tls/pic-1.c, gcc.dg/tls/section-1.c, gcc.dg/tls/struct-1.c,
gcc.dg/tls/trivial.c, g++.dg/tls/diag-1.C, g++.dg/tls/diag-2.C,
g++.dg/tls/diag-3.C, g++.dg/tls/diag-4.C, g++.dg/tls/init-1.C,
g++.dg/tls/init-2.C, g++.dg/tls/trivial.C: Require
effective-target TLS.
* gcc.dg/tls/pr24428-2.c, gcc.dg/tls/pr24428.c, gcc.dg/tls/opt-11.c,
g++.dg/tls/static-1a.cc, g++.dg/tls/static-1.C: Require
effective-target TLS runtime.
From-SVN: r107804
2005-12-01 07:52:11 +01:00
|
|
|
}
|
|
|
|
|
backport: configure: Regenerate.
2008-09-02 Sebastian Pop <sebastian.pop@amd.com>
Tobias Grosser <grosser@fim.uni-passau.de>
Jan Sjodin <jan.sjodin@amd.com>
Harsha Jagasia <harsha.jagasia@amd.com>
Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
Konrad Trifunovic <konrad.trifunovic@inria.fr>
Adrien Eliche <aeliche@isty.uvsq.fr>
Merge from graphite branch.
* configure: Regenerate.
* Makefile.in: Regenerate.
* configure.ac (host_libs): Add ppl and cloog.
Add checks for PPL and CLooG.
* Makefile.def (ppl, cloog): Added modules and dependences.
* Makefile.tpl (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC): New.
(HOST_PPLLIBS, HOST_PPLINC, HOST_CLOOGLIBS, HOST_CLOOGINC): New.
gcc/
* graphite.c: New.
* graphite.h: New.
* tree-loop-linear.c (perfect_loop_nest_depth): Export.
* doc/invoke.texi (-floop-block, -floop-interchange,
-floop-strip-mine): Document new flags.
* tree-into-ssa.c (gimple_vec): Moved...
* tree-loop-distribution.c (rdg_component): Moved...
* cfgloopmanip.c: Include tree-flow.h.
(update_dominators_in_loop): New.
(create_empty_if_region_on_edge): New.
(create_empty_loop_on_edge): New.
(loopify): Use update_dominators_in_loop.
* tree-pass.h (pass_graphite_transforms): Declared.
* configure: Regenerate.
* tree-phinodes.c (make_phi_node): Export.
(add_phi_node_to_bb): New, split from create_phi_node.
* tree-chrec.c (for_each_scev_op): New.
* tree-chrec.h (for_each_scev_op): Declared.
* tree-ssa-loop-ivopts.c (get_phi_with_result): New.
(remove_statement): Call get_phi_with_result.
* config.in (HAVE_cloog): Undef.
* gdbinit.in (pgg): New.
* timevar.def (TV_GRAPHITE_TRANSFORMS): New.
* tree-ssa-loop.c (graphite_transforms): New.
(gate_graphite_transforms): New.
(pass_graphite_transforms): New.
* configure.ac (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC,
HAVE_cloog): Defined.
* tree-vectorizer.c (rename_variables_in_bb): Export.
* tree-data-ref.c (dr_may_alias_p): Export.
(stmt_simple_memref_p): New.
(find_data_references_in_stmt): Export.
(find_data_references_in_loop): Export.
(create_rdg_edge_for_ddr): Initialize RDGE_RELATION.
(create_rdg_edges_for_scalar): Initialize RDGE_RELATION.
(create_rdg_vertices): Export.
(build_empty_rdg): New.
(build_rdg): Call build_empty_rdg. Free dependence_relations.
* tree-data-ref.h (rdg_component): ... here.
(scop_p): New.
(struct data_reference): Add a field scop.
(DR_SCOP): New.
(find_data_references_in_loop): Declared.
(find_data_references_in_stmt): Declared.
(create_rdg_vertices): Declared.
(dr_may_alias_p): Declared.
(stmt_simple_memref_p): Declared.
(struct rdg_edge): Add a field ddr_p relation.
(build_empty_rdg): Declared.
* lambda.h (lambda_matrix): Declare a VEC of.
(find_induction_var_from_exit_cond): Declared.
(lambda_vector_compare): New.
* common.opt (fgraphite, floop-strip-mine,
floop-interchange, floop-block): New flags.
* lambda-code.c (find_induction_var_from_exit_cond): Export.
* cfgloop.c (is_loop_exit): New.
* cfgloop.h (is_loop_exit): Declared.
(create_empty_if_region_on_edge): Declared.
(create_empty_loop_on_edge): Declared.
* tree-flow.h (add_phi_node_to_bb): Declared.
(make_phi_node): Declared.
(rename_variables_in_bb): Declared.
(perfect_loop_nest_depth): Declared.
(graphite_transform_loops): Declared.
* Makefile.in (cfgloopmanip.o): Depend on TREE_FLOW_H.
(graphite.o-warn): Add -Wno-error.
(PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC): Declared.
(LIBS): Add GMPLIBS, CLOOGLIBS, PPLLIBS.
(INCLUDES): Add PPLINC, CLOOGINC.
(OBJS-common): Add graphite.o.
(graphite.o): Add rule.
* gimple.h (gimple_vec): ... here.
* tree-cfg.c (print_loops): Start printing at ENTRY_BLOCK_PTR.
* passes.c (init_optimization_passes): Schedule
pass_graphite_transforms.
testsuite/
* gcc.dg/graphite/scop-{0,1,2,3,4,5,6,7,8,9,
10,11,12,13,14,15,16,17,18}.c: New.
* gcc.dg/graphite/graphite.exp: New.
* gcc.dg/graphite/scop-matmult.c: New.
* gcc.dg/graphite/block-0.c: New.
* lib/target-supports.exp (check_effective_target_fgraphite): New.
* gfortran.dg/graphite/block-1.f90: New.
* gfortran.dg/graphite/scop-{1,2}.f: New.
* gfortran.dg/graphite/block-{1,3,4}.f90: New.
* gfortran.dg/graphite/graphite.exp: New.
Co-Authored-By: Adrien Eliche <aeliche@isty.uvsq.fr>
Co-Authored-By: Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
Co-Authored-By: Harsha Jagasia <harsha.jagasia@amd.com>
Co-Authored-By: Jan Sjodin <jan.sjodin@amd.com>
Co-Authored-By: Konrad Trifunovic <konrad.trifunovic@inria.fr>
Co-Authored-By: Tobias Grosser <grosser@fim.uni-passau.de>
From-SVN: r139893
2008-09-02 18:31:04 +02:00
|
|
|
# Return 1 if compilation with -fgraphite is error-free for trivial
|
|
|
|
# code, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_fgraphite {} {
|
|
|
|
return [check_no_compiler_messages fgraphite object {
|
|
|
|
void foo (void) { }
|
2008-09-04 03:15:41 +02:00
|
|
|
} "-O1 -fgraphite"]
|
backport: configure: Regenerate.
2008-09-02 Sebastian Pop <sebastian.pop@amd.com>
Tobias Grosser <grosser@fim.uni-passau.de>
Jan Sjodin <jan.sjodin@amd.com>
Harsha Jagasia <harsha.jagasia@amd.com>
Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
Konrad Trifunovic <konrad.trifunovic@inria.fr>
Adrien Eliche <aeliche@isty.uvsq.fr>
Merge from graphite branch.
* configure: Regenerate.
* Makefile.in: Regenerate.
* configure.ac (host_libs): Add ppl and cloog.
Add checks for PPL and CLooG.
* Makefile.def (ppl, cloog): Added modules and dependences.
* Makefile.tpl (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC): New.
(HOST_PPLLIBS, HOST_PPLINC, HOST_CLOOGLIBS, HOST_CLOOGINC): New.
gcc/
* graphite.c: New.
* graphite.h: New.
* tree-loop-linear.c (perfect_loop_nest_depth): Export.
* doc/invoke.texi (-floop-block, -floop-interchange,
-floop-strip-mine): Document new flags.
* tree-into-ssa.c (gimple_vec): Moved...
* tree-loop-distribution.c (rdg_component): Moved...
* cfgloopmanip.c: Include tree-flow.h.
(update_dominators_in_loop): New.
(create_empty_if_region_on_edge): New.
(create_empty_loop_on_edge): New.
(loopify): Use update_dominators_in_loop.
* tree-pass.h (pass_graphite_transforms): Declared.
* configure: Regenerate.
* tree-phinodes.c (make_phi_node): Export.
(add_phi_node_to_bb): New, split from create_phi_node.
* tree-chrec.c (for_each_scev_op): New.
* tree-chrec.h (for_each_scev_op): Declared.
* tree-ssa-loop-ivopts.c (get_phi_with_result): New.
(remove_statement): Call get_phi_with_result.
* config.in (HAVE_cloog): Undef.
* gdbinit.in (pgg): New.
* timevar.def (TV_GRAPHITE_TRANSFORMS): New.
* tree-ssa-loop.c (graphite_transforms): New.
(gate_graphite_transforms): New.
(pass_graphite_transforms): New.
* configure.ac (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC,
HAVE_cloog): Defined.
* tree-vectorizer.c (rename_variables_in_bb): Export.
* tree-data-ref.c (dr_may_alias_p): Export.
(stmt_simple_memref_p): New.
(find_data_references_in_stmt): Export.
(find_data_references_in_loop): Export.
(create_rdg_edge_for_ddr): Initialize RDGE_RELATION.
(create_rdg_edges_for_scalar): Initialize RDGE_RELATION.
(create_rdg_vertices): Export.
(build_empty_rdg): New.
(build_rdg): Call build_empty_rdg. Free dependence_relations.
* tree-data-ref.h (rdg_component): ... here.
(scop_p): New.
(struct data_reference): Add a field scop.
(DR_SCOP): New.
(find_data_references_in_loop): Declared.
(find_data_references_in_stmt): Declared.
(create_rdg_vertices): Declared.
(dr_may_alias_p): Declared.
(stmt_simple_memref_p): Declared.
(struct rdg_edge): Add a field ddr_p relation.
(build_empty_rdg): Declared.
* lambda.h (lambda_matrix): Declare a VEC of.
(find_induction_var_from_exit_cond): Declared.
(lambda_vector_compare): New.
* common.opt (fgraphite, floop-strip-mine,
floop-interchange, floop-block): New flags.
* lambda-code.c (find_induction_var_from_exit_cond): Export.
* cfgloop.c (is_loop_exit): New.
* cfgloop.h (is_loop_exit): Declared.
(create_empty_if_region_on_edge): Declared.
(create_empty_loop_on_edge): Declared.
* tree-flow.h (add_phi_node_to_bb): Declared.
(make_phi_node): Declared.
(rename_variables_in_bb): Declared.
(perfect_loop_nest_depth): Declared.
(graphite_transform_loops): Declared.
* Makefile.in (cfgloopmanip.o): Depend on TREE_FLOW_H.
(graphite.o-warn): Add -Wno-error.
(PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC): Declared.
(LIBS): Add GMPLIBS, CLOOGLIBS, PPLLIBS.
(INCLUDES): Add PPLINC, CLOOGINC.
(OBJS-common): Add graphite.o.
(graphite.o): Add rule.
* gimple.h (gimple_vec): ... here.
* tree-cfg.c (print_loops): Start printing at ENTRY_BLOCK_PTR.
* passes.c (init_optimization_passes): Schedule
pass_graphite_transforms.
testsuite/
* gcc.dg/graphite/scop-{0,1,2,3,4,5,6,7,8,9,
10,11,12,13,14,15,16,17,18}.c: New.
* gcc.dg/graphite/graphite.exp: New.
* gcc.dg/graphite/scop-matmult.c: New.
* gcc.dg/graphite/block-0.c: New.
* lib/target-supports.exp (check_effective_target_fgraphite): New.
* gfortran.dg/graphite/block-1.f90: New.
* gfortran.dg/graphite/scop-{1,2}.f: New.
* gfortran.dg/graphite/block-{1,3,4}.f90: New.
* gfortran.dg/graphite/graphite.exp: New.
Co-Authored-By: Adrien Eliche <aeliche@isty.uvsq.fr>
Co-Authored-By: Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
Co-Authored-By: Harsha Jagasia <harsha.jagasia@amd.com>
Co-Authored-By: Jan Sjodin <jan.sjodin@amd.com>
Co-Authored-By: Konrad Trifunovic <konrad.trifunovic@inria.fr>
Co-Authored-By: Tobias Grosser <grosser@fim.uni-passau.de>
From-SVN: r139893
2008-09-02 18:31:04 +02:00
|
|
|
}
|
|
|
|
|
2006-01-24 00:44:16 +01:00
|
|
|
# Return 1 if compilation with -fopenmp is error-free for trivial
|
|
|
|
# code, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_fopenmp {} {
|
2006-03-21 00:22:13 +01:00
|
|
|
return [check_no_compiler_messages fopenmp object {
|
|
|
|
void foo (void) { }
|
|
|
|
} "-fopenmp"]
|
2006-01-24 00:44:16 +01:00
|
|
|
}
|
|
|
|
|
2008-01-17 18:54:56 +01:00
|
|
|
# Return 1 if compilation with -pthread is error-free for trivial
|
|
|
|
# code, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_pthread {} {
|
|
|
|
return [check_no_compiler_messages pthread object {
|
|
|
|
void foo (void) { }
|
|
|
|
} "-pthread"]
|
|
|
|
}
|
|
|
|
|
2009-05-28 12:48:35 +02:00
|
|
|
# Return 1 if compilation with -mpe-aligned-commons is error-free
|
|
|
|
# for trivial code, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_pe_aligned_commons {} {
|
|
|
|
if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } {
|
|
|
|
return [check_no_compiler_messages pe_aligned_commons object {
|
|
|
|
int foo;
|
|
|
|
} "-mpe-aligned-commons"]
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2007-03-29 01:08:26 +02:00
|
|
|
# Return 1 if the target supports -fstack-protector
|
|
|
|
proc check_effective_target_fstack_protector {} {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_runtime fstack_protector {
|
|
|
|
int main (void) { return 0; }
|
|
|
|
} "-fstack-protector"]
|
2007-03-29 01:08:26 +02:00
|
|
|
}
|
|
|
|
|
2006-01-30 18:06:16 +01:00
|
|
|
# Return 1 if compilation with -freorder-blocks-and-partition is error-free
|
|
|
|
# for trivial code, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_freorder {} {
|
2006-03-21 00:22:13 +01:00
|
|
|
return [check_no_compiler_messages freorder object {
|
|
|
|
void foo (void) { }
|
|
|
|
} "-freorder-blocks-and-partition"]
|
2006-01-30 18:06:16 +01:00
|
|
|
}
|
|
|
|
|
2005-04-07 01:27:11 +02:00
|
|
|
# Return 1 if -fpic and -fPIC are supported, as in no warnings or errors
|
|
|
|
# emitted, 0 otherwise. Whether a shared library can actually be built is
|
|
|
|
# out of scope for this test.
|
|
|
|
|
|
|
|
proc check_effective_target_fpic { } {
|
2006-03-21 00:22:13 +01:00
|
|
|
# Note that M68K has a multilib that supports -fpic but not
|
|
|
|
# -fPIC, so we need to check both. We test with a program that
|
|
|
|
# requires GOT references.
|
|
|
|
foreach arg {fpic fPIC} {
|
|
|
|
if [check_no_compiler_messages $arg object {
|
2005-04-07 01:27:11 +02:00
|
|
|
extern int foo (void); extern int bar;
|
|
|
|
int baz (void) { return foo () + bar; }
|
2006-03-21 00:22:13 +01:00
|
|
|
} "-$arg"] {
|
|
|
|
return 1
|
2005-04-07 01:27:11 +02:00
|
|
|
}
|
|
|
|
}
|
2006-03-21 00:22:13 +01:00
|
|
|
return 0
|
2005-04-07 01:27:11 +02:00
|
|
|
}
|
|
|
|
|
2006-05-20 16:33:58 +02:00
|
|
|
# Return true if the target supports -mpaired-single (as used on MIPS).
|
|
|
|
|
|
|
|
proc check_effective_target_mpaired_single { } {
|
2006-05-20 16:40:59 +02:00
|
|
|
return [check_no_compiler_messages mpaired_single object {
|
2006-05-20 16:33:58 +02:00
|
|
|
void foo (void) { }
|
|
|
|
} "-mpaired-single"]
|
|
|
|
}
|
|
|
|
|
2007-11-29 03:50:46 +01:00
|
|
|
# Return true if the target has access to FPU instructions.
|
2007-11-20 22:17:58 +01:00
|
|
|
|
2007-11-29 03:50:46 +01:00
|
|
|
proc check_effective_target_hard_float { } {
|
2008-02-05 22:28:42 +01:00
|
|
|
if { [istarget mips*-*-*] } {
|
2008-02-04 23:36:26 +01:00
|
|
|
return [check_no_compiler_messages hard_float assembly {
|
2008-02-05 22:28:42 +01:00
|
|
|
#if (defined __mips_soft_float || defined __mips16)
|
2008-02-04 23:36:26 +01:00
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
|
|
|
# The generic test equates hard_float with "no call for adding doubles".
|
|
|
|
return [check_no_messages_and_pattern hard_float "!\\(call" rtl-expand {
|
|
|
|
double a (double b, double c) { return b + c; }
|
2007-11-20 22:17:58 +01:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2007-09-20 22:17:45 +02:00
|
|
|
# Return true if the target is a 64-bit MIPS target.
|
|
|
|
|
|
|
|
proc check_effective_target_mips64 { } {
|
|
|
|
return [check_no_compiler_messages mips64 assembly {
|
|
|
|
#ifndef __mips64
|
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
mips.h (ISA_HAS_DSP, [...]): New macros.
gcc/
* config/mips/mips.h (ISA_HAS_DSP, ISA_HAS_DSPR2): New macros.
* config/mips/mips.c (mips_set_mips16_mode): Don't clear the DSP
flags for MIPS16.
(override_options): Check TARGET_HARD_FLOAT_ABI instead of
TARGET_HARD_FLOAT when testing whether -mpaired-single is
supported.
(mips_conditional_register_usage): Check ISA_HAS_DSP instead of
TARGET_DSP.
* config/mips/constraints.md (ka): Check ISA_HAS_DSPR2 instead of
TARGET_DSPR2.
* config/mips/mips.md (ANYF): Require TARGET_HARD_FLOAT for V2SF.
(mulv2sf3, movv2sf, movv2sf_hardfloat_64bit): Require
TARGET_HARD_FLOAT.
(<u>mulsidi3_32bit_internal, <u>msubsidi4, <u>maddsidi4): Check
ISA_HAS_DSPR2 instead of TARGET_HAS_DSPR2.
* config/mips/mips-dsp.md: Use ISA_HAS_DSP instead of TARGET_HAS_DSP
throughout.
* config/mips/mips-dspr2.md: Likewise ISA_HAS_DSPR2 and
TARGET_HAS_DSPR2.
* config/mips/mips-fixed.md: Use ISA_HAS_DSP and ISA_HAS_DSPR2
instead of TARGET_HAS_DSP and TARGET_HAS_DSPR2.
* config/mips/mips-ps-3d.md: Add TARGET_HARD_FLOAT to V2SF patterns.
gcc/testsuite/
* lib/target-supports.exp (check_effective_target_nomips16): New
procedure.
* lib/fortran-torture.exp: Check nomips16 as well as mpaired_single
for mipsisa64*-*-*.
* gcc.dg/vect/vect.exp: Likewise.
* g++.dg/vect/vect.exp: Likewise.
* gcc.target/mips/mips.exp (setup_mips_tests): Don't set mips_mips16.
(dg-mips-options): Don't skip -march* and -mips* tests for -mips16.
* gcc.target/mips/branch-cost-1.c (foo): Add NOMIPS16.
* gcc.target/mips/branch-cost-2.c (foo): Likewise.
* gcc.target/mips/clear-cache-1.c (f): Likewise.
* gcc.target/mips/dpaq_sa_l_w.c (f1, f2, f3): Likewise.
* gcc.target/mips/dpsq_sa_l_w.c (f1, f2, f3): Likewise.
* gcc.target/mips/fix-vr4130-1.c (foo): Likewise.
* gcc.target/mips/fix-vr4130-2.c (foo): Likewise.
* gcc.target/mips/fix-vr4130-3.c (foo): Likewise.
* gcc.target/mips/fix-vr4130-4.c (foo): Likewise.
* gcc.target/mips/fixed-scalar-type.c (test1, test2, test3, test4)
(test5, test6, test7, test8, test9, test10, test11, test12, test13)
(test14, test15, test16, test17, test18): Likewise.
* gcc.target/mips/fixed-vector-type.c (test1, test2, test3, test4)
(test5, test6, test7, test8, test9, test10, test11, test12, test13)
(test14, test15, test16, test17, test18, test19, test20, test21)
(test22): Likewise.
* gcc.target/mips/madd-1.c (f1, f2, f3): Likewise.
* gcc.target/mips/madd-2.c (f1, f2, f3): Likewise.
* gcc.target/mips/madd-4.c (f1, f2, f3): Likewise.
* gcc.target/mips/maddu-1.c (f1, f2, f3): Likewise.
* gcc.target/mips/maddu-2.c (f1, f2, f3): Likewise.
* gcc.target/mips/maddu-4.c (f1, f2, f3): Likewise.
* gcc.target/mips/mips-3d-1.c (main): Likewise.
* gcc.target/mips/mips-3d-2.c (main, test0, test1, test2, test3)
(test4, test5, test6, test7, test8, test9, test10, test11, test12)
(test13, test14, test15, test16, test17, test18, test19, test20)
(test21, test22, test23, test24, test25, test26, test27, test28)
(test29, test30, test31): Likewise.
* gcc.target/mips/mips-3d-3.c (main, test0, test1, test2, test3)
(test4, test5, test6, test7, test8, test9, test10, test11, test12)
(test13, test14, test15, test16, test17, test18, test19, test20)
(test21, test22, test23, test24, test25, test26, test27, test28)
(test29, test30, test31, test32, test33, test34, test35, test36)
(test37, test38, test39, test40, test41, test42, test43, test44)
(test45, test46, test47, test48, test49, test50, test51, test52)
(test53, test54, test55, test56, test57, test58, test59, test60)
(test61, test62, test63): Likewise.
* gcc.target/mips/mips-3d-4.c (main, test0, test1, test2, test3)
(test4, test5, test6, test7, test8, test9, test10, test11, test12)
(test13, test14, test15, test16, test17, test18, test19, test20)
(test21, test22, test23, test24, test25, test26, test27, test28)
(test29, test30, test31): Likewise.
* gcc.target/mips/mips-3d-5.c (main, test0, test1, test2, test3)
(test4, test5, test6, test7, test8, test9, test10, test11, test12)
(test13, test14, test15, test16, test17, test18, test19, test20)
(test21, test22, test23, test24, test25, test26, test27, test28)
(test29, test30, test31): Likewise.
* gcc.target/mips/mips-3d-6.c (main, test0, test1, test2, test3)
(test4, test5, test6, test7, test8, test9, test10, test11, test12)
(test13, test14, test15): Likewise.
* gcc.target/mips/mips-3d-7.c (main, test0, test1, test2, test3)
(test4, test5, test6, test7, test8, test9, test10, test11, test12)
(test13, test14, test15): Likewise.
* gcc.target/mips/mips-3d-8.c (main, test0, test1, test2, test3)
(test4, test5, test6, test7, test8, test9, test10, test11, test12)
(test13, test14, test15, test16, test17, test18, test19, test20)
(test21, test22, test23, test24, test25, test26, test27, test28)
(test29, test30, test31): Likewise.
* gcc.target/mips/mips-3d-9.c (matrix_multiply2, matrix_multiply3)
(matrix_multiply4: Likewise.
* gcc.target/mips/mips-ps-1.c (main): Likewise.
* gcc.target/mips/mips-ps-2.c (main): Likewise.
* gcc.target/mips/mips-ps-3.c (main): Likewise.
* gcc.target/mips/mips-ps-4.c (main, test0, test1, test2, test3)
(test4, test5, test6, test7, test8, test9, test10, test11, test12)
(test13, test14, test15, test16, test17, test18, test19, test20)
(test21, test22, test23, test24, test25, test26, test27, test28)
(test29, test30, test31): Likewise.
* gcc.target/mips/mips-ps-5.c (main, test0, test1, test2, test3)
(test4, test5, test6, test7, test8, test9, test10, test11, test12)
(test13, test14, test15, test16, test17, test18, test19, test20)
(test21, test22, test23, test24, test25, test26, test27, test28)
(test29, test30, test31): Likewise.
* gcc.target/mips/mips-ps-5.c (main): Likewise.
* gcc.target/mips/mips-ps-6.c (main): Likewise.
* gcc.target/mips/mips-ps-type.c (init, move, load, store, add, sub)
(neg, mul, madd, msub, nmadd, nmsub, cond_move1, cond_move2): Likewise.
* gcc.target/mips/mips32-dsp-type.c (add_v2hi,add_v4qi, sub_v2hi)
(sub_v4qi): Likewise.
* gcc.target/mips/mips32-dsp.c (test_MIPS_DSP, add_v2q15, add_v4i8)
(sub_v2q15, sub_v4i8, test_MIPS_DSP): Likewise.
* gcc.target/mips/movcc-1.c (sub1, sub2): Likewise.
* gcc.target/mips/movcc-2.c (sub4, sub5): Likewise.
* gcc.target/mips/movcc-3.c (sub3, sub6, sub7, sub8, sub9, suba)
(subb, subc): Likewise.
* gcc.target/mips/msub-1.c (f1, f2): Likewise.
* gcc.target/mips/msub-2.c (f1, f2): Likewise.
* gcc.target/mips/msub-4.c (f1, f2): Likewise.
* gcc.target/mips/msubu-1.c (f1, f2): Likewise.
* gcc.target/mips/msubu-2.c (f1, f2): Likewise.
* gcc.target/mips/msubu-4.c (f1, f2): Likewise.
* gcc.target/mips/nmadd-1.c (sub1, sub2, sub3, sub4): Likewise.
* gcc.target/mips/nmadd-2.c (sub1, sub2, sub3, sub4): Likewise.
* gcc.target/mips/rsqrt-1.c (foo, bar): Likewise.
* gcc.target/mips/rsqrt-2.c (foo, bar): Likewise.
* gcc.target/mips/sb1-1.c (divide, recip, squareroot, rsqrt): Likewise.
* gcc.target/mips/vr-mult-1.c (f1, f2): Likewise.
* gcc.target/mips/vr-mult-2.c (f1, f2): Likewise.
From-SVN: r128683
2007-09-23 11:24:21 +02:00
|
|
|
# Return true if the target is a MIPS target that does not produce
|
|
|
|
# MIPS16 code.
|
|
|
|
|
|
|
|
proc check_effective_target_nomips16 { } {
|
|
|
|
return [check_no_compiler_messages nomips16 object {
|
|
|
|
#ifndef __mips
|
|
|
|
#error FOO
|
|
|
|
#else
|
|
|
|
/* A cheap way of testing for -mflip-mips16. */
|
|
|
|
void foo (void) { asm ("addiu $20,$20,1"); }
|
|
|
|
void bar (void) { asm ("addiu $20,$20,1"); }
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2007-09-22 22:10:52 +02:00
|
|
|
# Add the options needed for MIPS16 function attributes. At the moment,
|
|
|
|
# we don't support MIPS16 PIC.
|
|
|
|
|
|
|
|
proc add_options_for_mips16_attribute { flags } {
|
2008-05-12 04:07:56 +02:00
|
|
|
return "$flags -mno-abicalls -fno-pic -DMIPS16=__attribute__((mips16))"
|
2007-09-22 22:10:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Return true if we can force a mode that allows MIPS16 code generation.
|
2007-09-24 21:57:29 +02:00
|
|
|
# We don't support MIPS16 PIC, and only support MIPS16 -mhard-float
|
|
|
|
# for o32 and o64.
|
2007-09-22 22:10:52 +02:00
|
|
|
|
|
|
|
proc check_effective_target_mips16_attribute { } {
|
|
|
|
return [check_no_compiler_messages mips16_attribute assembly {
|
2007-09-24 21:57:29 +02:00
|
|
|
#ifdef PIC
|
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
#if defined __mips_hard_float \
|
|
|
|
&& (!defined _ABIO32 || _MIPS_SIM != _ABIO32) \
|
|
|
|
&& (!defined _ABIO64 || _MIPS_SIM != _ABIO64)
|
2007-09-22 22:10:52 +02:00
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
} [add_options_for_mips16_attribute ""]]
|
|
|
|
}
|
|
|
|
|
2007-03-21 10:11:25 +01:00
|
|
|
# Return 1 if the current multilib does not generate PIC by default.
|
|
|
|
|
|
|
|
proc check_effective_target_nonpic { } {
|
|
|
|
return [check_no_compiler_messages nonpic assembly {
|
|
|
|
#if __PIC__
|
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2007-02-23 23:12:49 +01:00
|
|
|
# Return 1 if the target does not use a status wrapper.
|
|
|
|
|
|
|
|
proc check_effective_target_unwrapped { } {
|
|
|
|
if { [target_info needs_status_wrapper] != "" \
|
|
|
|
&& [target_info needs_status_wrapper] != "0" } {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2005-03-05 11:08:31 +01:00
|
|
|
# Return true if iconv is supported on the target. In particular IBM1047.
|
2004-02-27 03:01:10 +01:00
|
|
|
|
|
|
|
proc check_iconv_available { test_what } {
|
2004-03-09 02:53:28 +01:00
|
|
|
global libiconv
|
2004-02-27 03:01:10 +01:00
|
|
|
|
2005-03-23 17:45:45 +01:00
|
|
|
# If the tool configuration file has not set libiconv, try "-liconv"
|
|
|
|
if { ![info exists libiconv] } {
|
|
|
|
set libiconv "-liconv"
|
|
|
|
}
|
2007-12-04 11:16:17 +01:00
|
|
|
set test_what [lindex $test_what 1]
|
|
|
|
return [check_runtime_nocache $test_what [subst {
|
|
|
|
#include <iconv.h>
|
|
|
|
int main (void)
|
|
|
|
{
|
|
|
|
iconv_t cd;
|
|
|
|
|
|
|
|
cd = iconv_open ("$test_what", "UTF-8");
|
|
|
|
if (cd == (iconv_t) -1)
|
|
|
|
return 1;
|
|
|
|
return 0;
|
2004-03-09 02:53:28 +01:00
|
|
|
}
|
2007-12-04 11:16:17 +01:00
|
|
|
}] $libiconv]
|
2004-02-27 03:01:10 +01:00
|
|
|
}
|
2004-04-10 00:24:29 +02:00
|
|
|
|
|
|
|
# Return true if named sections are supported on this target.
|
2006-03-21 00:22:13 +01:00
|
|
|
|
2004-04-10 00:24:29 +02:00
|
|
|
proc check_named_sections_available { } {
|
2006-03-21 00:22:13 +01:00
|
|
|
return [check_no_compiler_messages named_sections assembly {
|
2004-11-12 02:11:01 +01:00
|
|
|
int __attribute__ ((section("whatever"))) foo;
|
2006-03-21 00:22:13 +01:00
|
|
|
}]
|
2004-04-10 00:24:29 +02:00
|
|
|
}
|
2004-05-29 00:31:44 +02:00
|
|
|
|
2005-06-23 20:50:25 +02:00
|
|
|
# Return 1 if the target supports Fortran real kinds larger than real(8),
|
2005-10-04 23:45:50 +02:00
|
|
|
# 0 otherwise.
|
|
|
|
#
|
|
|
|
# When the target name changes, replace the cached result.
|
2005-06-23 20:50:25 +02:00
|
|
|
|
|
|
|
proc check_effective_target_fortran_large_real { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_no_compiler_messages fortran_large_real executable {
|
|
|
|
! Fortran
|
|
|
|
integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1)
|
|
|
|
real(kind=k) :: x
|
|
|
|
x = cos (x)
|
|
|
|
end
|
|
|
|
}]
|
2005-06-23 20:50:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target supports Fortran integer kinds larger than
|
2005-10-04 23:45:50 +02:00
|
|
|
# integer(8), 0 otherwise.
|
|
|
|
#
|
|
|
|
# When the target name changes, replace the cached result.
|
2005-06-23 20:50:25 +02:00
|
|
|
|
|
|
|
proc check_effective_target_fortran_large_int { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_no_compiler_messages fortran_large_int executable {
|
|
|
|
! Fortran
|
|
|
|
integer,parameter :: k = selected_int_kind (range (0_8) + 1)
|
|
|
|
integer(kind=k) :: i
|
|
|
|
end
|
|
|
|
}]
|
2005-06-23 20:50:25 +02:00
|
|
|
}
|
|
|
|
|
2008-05-15 14:57:41 +02:00
|
|
|
# Return 1 if the target supports Fortran integer(16), 0 otherwise.
|
|
|
|
#
|
|
|
|
# When the target name changes, replace the cached result.
|
|
|
|
|
|
|
|
proc check_effective_target_fortran_integer_16 { } {
|
|
|
|
return [check_no_compiler_messages fortran_integer_16 executable {
|
|
|
|
! Fortran
|
|
|
|
integer(16) :: i
|
|
|
|
end
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2005-11-04 09:44:29 +01:00
|
|
|
# Return 1 if we can statically link libgfortran, 0 otherwise.
|
|
|
|
#
|
|
|
|
# When the target name changes, replace the cached result.
|
|
|
|
|
|
|
|
proc check_effective_target_static_libgfortran { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_no_compiler_messages static_libgfortran executable {
|
|
|
|
! Fortran
|
|
|
|
print *, 'test'
|
|
|
|
end
|
|
|
|
} "-static"]
|
2005-11-04 09:44:29 +01:00
|
|
|
}
|
|
|
|
|
2007-10-31 18:04:42 +01:00
|
|
|
# Return 1 if the target supports executing 750CL paired-single instructions, 0
|
|
|
|
# otherwise. Cache the result.
|
|
|
|
|
|
|
|
proc check_750cl_hw_available { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_cached_effective_target 750cl_hw_available {
|
|
|
|
# If this is not the right target then we can skip the test.
|
|
|
|
if { ![istarget powerpc-*paired*] } {
|
|
|
|
expr 0
|
|
|
|
} else {
|
|
|
|
check_runtime_nocache 750cl_hw_available {
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
#ifdef __MACH__
|
|
|
|
asm volatile ("ps_mul v0,v0,v0");
|
|
|
|
#else
|
|
|
|
asm volatile ("ps_mul 0,0,0");
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
} "-mpaired"
|
|
|
|
}
|
|
|
|
}]
|
2007-10-31 18:04:42 +01:00
|
|
|
}
|
|
|
|
|
2008-03-20 20:43:56 +01:00
|
|
|
# Return 1 if the target supports executing SSE2 instructions, 0
|
|
|
|
# otherwise. Cache the result.
|
|
|
|
|
|
|
|
proc check_sse2_hw_available { } {
|
|
|
|
return [check_cached_effective_target sse2_hw_available {
|
|
|
|
# If this is not the right target then we can skip the test.
|
|
|
|
if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
|
|
|
|
expr 0
|
|
|
|
} else {
|
|
|
|
check_runtime_nocache sse2_hw_available {
|
|
|
|
#include "cpuid.h"
|
|
|
|
int main ()
|
|
|
|
{
|
|
|
|
unsigned int eax, ebx, ecx, edx = 0;
|
|
|
|
if (__get_cpuid (1, &eax, &ebx, &ecx, &edx))
|
|
|
|
return !(edx & bit_SSE2);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
} ""
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2004-05-29 00:31:44 +02:00
|
|
|
# Return 1 if the target supports executing AltiVec instructions, 0
|
|
|
|
# otherwise. Cache the result.
|
|
|
|
|
|
|
|
proc check_vmx_hw_available { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_cached_effective_target vmx_hw_available {
|
2004-05-29 00:31:44 +02:00
|
|
|
# Some simulators are known to not support VMX instructions.
|
|
|
|
if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] } {
|
2007-12-04 11:16:17 +01:00
|
|
|
expr 0
|
2005-03-15 19:41:19 +01:00
|
|
|
} else {
|
2007-12-04 11:16:17 +01:00
|
|
|
# Most targets don't require special flags for this test case, but
|
|
|
|
# Darwin does.
|
|
|
|
if { [istarget *-*-darwin*]
|
|
|
|
|| [istarget *-*-aix*] } {
|
|
|
|
set options "-maltivec"
|
|
|
|
} else {
|
|
|
|
set options ""
|
2004-05-29 00:31:44 +02:00
|
|
|
}
|
2007-12-04 11:16:17 +01:00
|
|
|
check_runtime_nocache vmx_hw_available {
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
#ifdef __MACH__
|
|
|
|
asm volatile ("vor v0,v0,v0");
|
|
|
|
#else
|
|
|
|
asm volatile ("vor 0,0,0");
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
} $options
|
2004-05-29 00:31:44 +02:00
|
|
|
}
|
2007-12-04 11:16:17 +01:00
|
|
|
}]
|
2004-05-29 00:31:44 +02:00
|
|
|
}
|
2004-11-12 02:11:01 +01:00
|
|
|
|
2009-01-13 18:52:32 +01:00
|
|
|
# Return 1 if the target supports executing AltiVec and Cell PPU
|
|
|
|
# instructions, 0 otherwise. Cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_cell_hw { } {
|
|
|
|
return [check_cached_effective_target cell_hw_available {
|
|
|
|
# Some simulators are known to not support VMX and PPU instructions.
|
|
|
|
if { [istarget powerpc-*-eabi*] } {
|
|
|
|
expr 0
|
|
|
|
} else {
|
|
|
|
# Most targets don't require special flags for this test
|
|
|
|
# case, but Darwin and AIX do.
|
|
|
|
if { [istarget *-*-darwin*]
|
|
|
|
|| [istarget *-*-aix*] } {
|
|
|
|
set options "-maltivec -mcpu=cell"
|
|
|
|
} else {
|
|
|
|
set options "-mcpu=cell"
|
|
|
|
}
|
|
|
|
check_runtime_nocache cell_hw_available {
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
#ifdef __MACH__
|
|
|
|
asm volatile ("vor v0,v0,v0");
|
|
|
|
asm volatile ("lvlx v0,r0,r0");
|
|
|
|
#else
|
|
|
|
asm volatile ("vor 0,0,0");
|
|
|
|
asm volatile ("lvlx 0,0,0");
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
} $options
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2009-01-13 04:14:32 +01:00
|
|
|
# Return 1 if the target supports executing 64-bit instructions, 0
|
|
|
|
# otherwise. Cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_powerpc64 { } {
|
|
|
|
global powerpc64_available_saved
|
|
|
|
global tool
|
|
|
|
|
|
|
|
if [info exists powerpc64_available_saved] {
|
|
|
|
verbose "check_effective_target_powerpc64 returning saved $powerpc64_available_saved" 2
|
|
|
|
} else {
|
|
|
|
set powerpc64_available_saved 0
|
|
|
|
|
|
|
|
# Some simulators are known to not support powerpc64 instructions.
|
|
|
|
if { [istarget powerpc-*-eabi*] || [istarget powerpc-ibm-aix*] } {
|
|
|
|
verbose "check_effective_target_powerpc64 returning 0" 2
|
|
|
|
return $powerpc64_available_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set up, compile, and execute a test program containing a 64-bit
|
|
|
|
# instruction. Include the current process ID in the file
|
|
|
|
# names to prevent conflicts with invocations for multiple
|
|
|
|
# testsuites.
|
|
|
|
set src ppc[pid].c
|
|
|
|
set exe ppc[pid].x
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f "int main() {"
|
|
|
|
puts $f "#ifdef __MACH__"
|
|
|
|
puts $f " asm volatile (\"extsw r0,r0\");"
|
|
|
|
puts $f "#else"
|
|
|
|
puts $f " asm volatile (\"extsw 0,0\");"
|
|
|
|
puts $f "#endif"
|
|
|
|
puts $f " return 0; }"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
set opts "additional_flags=-mcpu=G5"
|
|
|
|
|
|
|
|
verbose "check_effective_target_powerpc64 compiling testfile $src" 2
|
|
|
|
set lines [${tool}_target_compile $src $exe executable "$opts"]
|
|
|
|
file delete $src
|
|
|
|
|
|
|
|
if [string match "" $lines] then {
|
|
|
|
# No error message, compilation succeeded.
|
|
|
|
set result [${tool}_load "./$exe" "" ""]
|
|
|
|
set status [lindex $result 0]
|
|
|
|
remote_file build delete $exe
|
|
|
|
verbose "check_effective_target_powerpc64 testfile status is <$status>" 2
|
|
|
|
|
|
|
|
if { $status == "pass" } then {
|
|
|
|
set powerpc64_available_saved 1
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
verbose "check_effective_target_powerpc64 testfile compilation failed" 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $powerpc64_available_saved
|
|
|
|
}
|
|
|
|
|
2005-02-11 23:34:57 +01:00
|
|
|
# GCC 3.4.0 for powerpc64-*-linux* included an ABI fix for passing
|
|
|
|
# complex float arguments. This affects gfortran tests that call cabsf
|
|
|
|
# in libm built by an earlier compiler. Return 1 if libm uses the same
|
|
|
|
# argument passing as the compiler under test, 0 otherwise.
|
|
|
|
#
|
|
|
|
# When the target name changes, replace the cached result.
|
|
|
|
|
|
|
|
proc check_effective_target_broken_cplxf_arg { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_cached_effective_target broken_cplxf_arg {
|
|
|
|
# Skip the work for targets known not to be affected.
|
|
|
|
if { ![istarget powerpc64-*-linux*] } {
|
|
|
|
expr 0
|
|
|
|
} elseif { ![is-effective-target lp64] } {
|
|
|
|
expr 0
|
2005-02-11 23:34:57 +01:00
|
|
|
} else {
|
2007-12-04 11:16:17 +01:00
|
|
|
check_runtime_nocache broken_cplxf_arg {
|
|
|
|
#include <complex.h>
|
|
|
|
extern void abort (void);
|
|
|
|
float fabsf (float);
|
|
|
|
float cabsf (_Complex float);
|
|
|
|
int main ()
|
|
|
|
{
|
|
|
|
_Complex float cf;
|
|
|
|
float f;
|
|
|
|
cf = 3 + 4.0fi;
|
|
|
|
f = cabsf (cf);
|
|
|
|
if (fabsf (f - 5.0) > 0.0001)
|
|
|
|
abort ();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
} "-lm"
|
2005-02-11 23:34:57 +01:00
|
|
|
}
|
2007-12-04 11:16:17 +01:00
|
|
|
}]
|
2005-02-11 23:34:57 +01:00
|
|
|
}
|
|
|
|
|
pr18425.c: Use effective target vect_long.
* gcc.dg/vect/pr18425.c: Use effective target vect_long.
* gcc.dg/vect/vect-13.c, gcc.dg/vect/vect-17.c, gcc.dg/vect/vect-18.c,
gcc.dg/vect/vect-19.c, gcc.dg/vect/vect-20.c, gcc.dg/vect/vect-48a.c,
gcc.dg/vect/vect-56a.c, gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-77.c,
gcc.dg/vect/vect-77a.c, gcc.dg/vect/vect-78.c, gcc.dg/vect/vect-86.c,
gcc.dg/vect/vect-87.c, gcc.dg/vect/vect-88.c: XFAIL for alpha.
* gcc.dg/vect/vect.exp: Add check for alpha.
* lib/target-supports.exp (check_alpha_max_hw_available): New.
(check_effective_target_vect_int): Enable for alpha.
(check_effective_target_vect_long): New.
(is-effective-target): Add it.
From-SVN: r91105
2004-11-23 23:03:31 +01:00
|
|
|
proc check_alpha_max_hw_available { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_runtime alpha_max_hw_available {
|
|
|
|
int main() { return __builtin_alpha_amask(1<<8) != 0; }
|
|
|
|
}]
|
pr18425.c: Use effective target vect_long.
* gcc.dg/vect/pr18425.c: Use effective target vect_long.
* gcc.dg/vect/vect-13.c, gcc.dg/vect/vect-17.c, gcc.dg/vect/vect-18.c,
gcc.dg/vect/vect-19.c, gcc.dg/vect/vect-20.c, gcc.dg/vect/vect-48a.c,
gcc.dg/vect/vect-56a.c, gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-77.c,
gcc.dg/vect/vect-77a.c, gcc.dg/vect/vect-78.c, gcc.dg/vect/vect-86.c,
gcc.dg/vect/vect-87.c, gcc.dg/vect/vect-88.c: XFAIL for alpha.
* gcc.dg/vect/vect.exp: Add check for alpha.
* lib/target-supports.exp (check_alpha_max_hw_available): New.
(check_effective_target_vect_int): Enable for alpha.
(check_effective_target_vect_long): New.
(is-effective-target): Add it.
From-SVN: r91105
2004-11-23 23:03:31 +01:00
|
|
|
}
|
|
|
|
|
2005-05-06 19:03:10 +02:00
|
|
|
# Returns true iff the FUNCTION is available on the target system.
|
|
|
|
# (This is essentially a Tcl implementation of Autoconf's
|
|
|
|
# AC_CHECK_FUNC.)
|
|
|
|
|
|
|
|
proc check_function_available { function } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_no_compiler_messages ${function}_available \
|
|
|
|
executable [subst {
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
#endif
|
|
|
|
char $function ();
|
|
|
|
int main () { $function (); }
|
|
|
|
}]]
|
2005-05-06 19:03:10 +02:00
|
|
|
}
|
|
|
|
|
2005-05-16 02:51:38 +02:00
|
|
|
# Returns true iff "fork" is available on the target system.
|
2005-05-06 19:03:10 +02:00
|
|
|
|
|
|
|
proc check_fork_available {} {
|
|
|
|
return [check_function_available "fork"]
|
|
|
|
}
|
|
|
|
|
2005-05-16 02:51:38 +02:00
|
|
|
# Returns true iff "mkfifo" is available on the target system.
|
2005-05-06 19:03:10 +02:00
|
|
|
|
|
|
|
proc check_mkfifo_available {} {
|
2005-05-16 02:51:38 +02:00
|
|
|
if {[istarget *-*-cygwin*]} {
|
|
|
|
# Cygwin has mkfifo, but support is incomplete.
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2005-05-06 19:03:10 +02:00
|
|
|
return [check_function_available "mkfifo"]
|
|
|
|
}
|
|
|
|
|
2006-05-10 23:55:34 +02:00
|
|
|
# Returns true iff "__cxa_atexit" is used on the target system.
|
|
|
|
|
|
|
|
proc check_cxa_atexit_available { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_cached_effective_target cxa_atexit_available {
|
|
|
|
if { [istarget "hppa*-*-hpux10*"] } {
|
|
|
|
# HP-UX 10 doesn't have __cxa_atexit but subsequent test passes.
|
|
|
|
expr 0
|
2009-04-29 10:03:33 +02:00
|
|
|
} elseif { [istarget "*-*-vxworks"] } {
|
|
|
|
# vxworks doesn't have __cxa_atexit but subsequent test passes.
|
|
|
|
expr 0
|
2006-05-10 23:55:34 +02:00
|
|
|
} else {
|
2007-12-04 11:16:17 +01:00
|
|
|
check_runtime_nocache cxa_atexit_available {
|
|
|
|
// C++
|
|
|
|
#include <stdlib.h>
|
|
|
|
static unsigned int count;
|
|
|
|
struct X
|
|
|
|
{
|
|
|
|
X() { count = 1; }
|
|
|
|
~X()
|
|
|
|
{
|
|
|
|
if (count != 3)
|
|
|
|
exit(1);
|
|
|
|
count = 4;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
void f()
|
|
|
|
{
|
|
|
|
static X x;
|
|
|
|
}
|
|
|
|
struct Y
|
|
|
|
{
|
|
|
|
Y() { f(); count = 2; }
|
|
|
|
~Y()
|
|
|
|
{
|
|
|
|
if (count != 2)
|
|
|
|
exit(1);
|
|
|
|
count = 3;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
Y y;
|
|
|
|
int main() { return 0; }
|
|
|
|
}
|
2006-05-10 23:55:34 +02:00
|
|
|
}
|
2007-12-04 11:16:17 +01:00
|
|
|
}]
|
2006-05-10 23:55:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-11-12 02:11:01 +01:00
|
|
|
# Return 1 if we're generating 32-bit code using default options, 0
|
|
|
|
# otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_ilp32 { } {
|
2006-03-21 00:22:13 +01:00
|
|
|
return [check_no_compiler_messages ilp32 object {
|
|
|
|
int dummy[sizeof (int) == 4
|
|
|
|
&& sizeof (void *) == 4
|
|
|
|
&& sizeof (long) == 4 ? 1 : -1];
|
|
|
|
}]
|
2004-11-12 02:11:01 +01:00
|
|
|
}
|
|
|
|
|
2006-04-14 01:14:25 +02:00
|
|
|
# Return 1 if we're generating 32-bit or larger integers using default
|
|
|
|
# options, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_int32plus { } {
|
|
|
|
return [check_no_compiler_messages int32plus object {
|
|
|
|
int dummy[sizeof (int) >= 4 ? 1 : -1];
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if we're generating 32-bit or larger pointers using default
|
|
|
|
# options, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_ptr32plus { } {
|
|
|
|
return [check_no_compiler_messages ptr32plus object {
|
|
|
|
int dummy[sizeof (void *) >= 4 ? 1 : -1];
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if we support 32-bit or larger array and structure sizes
|
|
|
|
# using default options, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_size32plus { } {
|
|
|
|
return [check_no_compiler_messages size32plus object {
|
|
|
|
char dummy[65537];
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Returns 1 if we're generating 16-bit or smaller integers with the
|
|
|
|
# default options, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_int16 { } {
|
|
|
|
return [check_no_compiler_messages int16 object {
|
|
|
|
int dummy[sizeof (int) < 4 ? 1 : -1];
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2004-11-12 02:11:01 +01:00
|
|
|
# Return 1 if we're generating 64-bit code using default options, 0
|
|
|
|
# otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_lp64 { } {
|
2006-03-21 00:22:13 +01:00
|
|
|
return [check_no_compiler_messages lp64 object {
|
|
|
|
int dummy[sizeof (int) == 4
|
|
|
|
&& sizeof (void *) == 8
|
|
|
|
&& sizeof (long) == 8 ? 1 : -1];
|
|
|
|
}]
|
2004-11-12 02:11:01 +01:00
|
|
|
}
|
|
|
|
|
2008-10-01 09:38:53 +02:00
|
|
|
# Return 1 if we're generating 64-bit code using default llp64 options,
|
|
|
|
# 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_llp64 { } {
|
|
|
|
return [check_no_compiler_messages llp64 object {
|
|
|
|
int dummy[sizeof (int) == 4
|
|
|
|
&& sizeof (void *) == 8
|
|
|
|
&& sizeof (long long) == 8
|
|
|
|
&& sizeof (long) == 4 ? 1 : -1];
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2006-12-08 19:14:21 +01:00
|
|
|
# Return 1 if the target supports long double larger than double,
|
|
|
|
# 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_large_long_double { } {
|
|
|
|
return [check_no_compiler_messages large_long_double object {
|
|
|
|
int dummy[sizeof(long double) > sizeof(double) ? 1 : -1];
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2009-04-28 01:27:21 +02:00
|
|
|
# Return 1 if the target supports double larger than float,
|
|
|
|
# 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_large_double { } {
|
|
|
|
return [check_no_compiler_messages large_double object {
|
|
|
|
int dummy[sizeof(double) > sizeof(float) ? 1 : -1];
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target supports double of 64 bits,
|
|
|
|
# 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_double64 { } {
|
|
|
|
return [check_no_compiler_messages double64 object {
|
|
|
|
int dummy[sizeof(double) == 8 ? 1 : -1];
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target supports double of at least 64 bits,
|
|
|
|
# 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_double64plus { } {
|
|
|
|
return [check_no_compiler_messages double64plus object {
|
|
|
|
int dummy[sizeof(double) >= 8 ? 1 : -1];
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
target-supports.exp (check_effective_target_fixed_point): New to check if targets have fixed-point supports.
* lib/target-supports.exp (check_effective_target_fixed_point): New to
check if targets have fixed-point supports.
* gcc.dg/fixed-point/fixed-point.exp: New file.
* gcc.dg/fixed-point/addsub.c, gcc.dg/fixed-point/allconv.c,
* gcc.dg/fixed-point/allop.c, gcc.dg/fixed-point/call-by-value.c,
* gcc.dg/fixed-point/cast-bad.c, gcc.dg/fixed-point/composite-type.c,
* gcc.dg/fixed-point/const-1.c, gcc.dg/fixed-point/constant.c,
* gcc.dg/fixed-point/constants-pedantic.c,
* gcc.dg/fixed-point/convert.c, gcc.dg/fixed-point/define.c,
* gcc.dg/fixed-point/keywords-c89.c, gcc.dg/fixed-point/keywords-c99.c,
* gcc.dg/fixed-point/keywords-ignored-c99.c,
* gcc.dg/fixed-point/keywords-pedantic.c,
* gcc.dg/fixed-point/keywords-reserved.c, gcc.dg/fixed-point/binary.c,
* gcc.dg/fixed-point/modes.c, gcc.dg/fixed-point/noassoc.c,
* gcc.dg/fixed-point/types.c, gcc.dg/fixed-point/typespec.c,
* gcc.dg/fixed-point/unary.c, gcc.dg/fixed-point/func-array.c,
* gcc.dg/fixed-point/func-scalar.c, gcc.dg/fixed-point/func-struct.c,
* gcc.dg/fixed-point/func-vararg-mixed.c,
* gcc.dg/fixed-point/operator-logical.c,
* gcc.dg/fixed-point/struct-union.c,
* gcc.dg/fixed-point/bit-complement.c,
* gcc.dg/fixed-point/operator-bitwise.c,
* gcc.dg/fixed-point/operator-comma.c,
* gcc.dg/fixed-point/struct-layout-1.c,
* gcc.dg/fixed-point/union-init.c,
* gcc.dg/fixed-point/Wbad-function-cast-1.c,
* gcc.dg/fixed-point/func-mixed.c,
* gcc.dg/fixed-point/func-vararg-size0.c,
* gcc.dg/fixed-point/func-vararg.c, gcc.dg/fixed-point/int-warning.c,
* gcc.dg/fixed-point/loop-index.c, gcc.dg/fixed-point/operator-cond.c,
* gcc.dg/fixed-point/operator-unary.c,
* gcc.dg/fixed-point/allop-const.c,
* gcc.dg/fixed-point/muldiv-warning.c,
* gcc.dg/nofixed-point-1.c,
* gcc.target/mips/dpaq_sa_l_w.c, gcc.target/mips/dpsq_sa_l_w.c,
* gcc.target/mips/fixed-vector-type.c,
* gcc.target/mips/fixed-scalar-type.c: New tests.
From-SVN: r128661
2007-09-22 02:27:56 +02:00
|
|
|
# Return 1 if the target supports compiling fixed-point,
|
|
|
|
# 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_fixed_point { } {
|
|
|
|
return [check_no_compiler_messages fixed_point object {
|
|
|
|
_Sat _Fract x; _Sat _Accum y;
|
|
|
|
}]
|
|
|
|
}
|
2006-12-08 19:14:21 +01:00
|
|
|
|
target-supports.exp (check_effective_target_dfp_nocache, [...]): New.
* lib/target-supports.exp (check_effective_target_dfp_nocache,
check_effective_target_dfprt_nocache): New.
(check_effective_target_dfp): Use check_effective_target_dfp_nocache.
(check_effective_target_dfprt): New.
* lib/c-compat.exp (check_dfp): Remove.
(compat_dfp_setup): Use check_effective_target_dfprt_nocache.
* gcc.dg/dfp/dfp.exp: Compile, execute, or skip tests based on
level of support for decimal float.
* gcc.dg/dfp/call-by-value.c, cast.c, compare-eq-const.c,
compare-eq-d128.c, compare-eq-d32.c, compare-eq-d64.c,
compare-eq-dfp.c, compare-rel-const.c, compare-rel-d128.c,
compare-rel-d32.c, compare-rel-d64.c, compare-rel-dfp.c,
convert-bfp.c, convert-bfp-fold.c, convert-complex.c, convert-dfp.c,
convert-dfp-fold.c, convert-dfp-round.c, convert-int-fold.c,
convert-int-saturate.c, func-array.c, func-mixed.c, func-scalar.c,
func-struct.c, func-vararg-dfp.c, func-vararg-mixed.c,
func-vararg-size0.c, inf-1.c, loop-index.c, nan-1.c, nan-2.c,
operator-arith-fold.c, operator-assignment.c, operator-comma.c,
operator-cond.c, operator-logical.c, operator-unary.c, snan.c,
struct-layout-1.c, union-init.c, usual-arith-conv.c: Remove dg-do
directives.
From-SVN: r109779
2006-01-17 01:09:27 +01:00
|
|
|
# Return 1 if the target supports compiling decimal floating point,
|
|
|
|
# 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_dfp_nocache { } {
|
|
|
|
verbose "check_effective_target_dfp_nocache: compiling source" 2
|
2007-12-04 11:16:17 +01:00
|
|
|
set ret [check_no_compiler_messages_nocache dfp object {
|
target-supports.exp (check_effective_target_dfp_nocache, [...]): New.
* lib/target-supports.exp (check_effective_target_dfp_nocache,
check_effective_target_dfprt_nocache): New.
(check_effective_target_dfp): Use check_effective_target_dfp_nocache.
(check_effective_target_dfprt): New.
* lib/c-compat.exp (check_dfp): Remove.
(compat_dfp_setup): Use check_effective_target_dfprt_nocache.
* gcc.dg/dfp/dfp.exp: Compile, execute, or skip tests based on
level of support for decimal float.
* gcc.dg/dfp/call-by-value.c, cast.c, compare-eq-const.c,
compare-eq-d128.c, compare-eq-d32.c, compare-eq-d64.c,
compare-eq-dfp.c, compare-rel-const.c, compare-rel-d128.c,
compare-rel-d32.c, compare-rel-d64.c, compare-rel-dfp.c,
convert-bfp.c, convert-bfp-fold.c, convert-complex.c, convert-dfp.c,
convert-dfp-fold.c, convert-dfp-round.c, convert-int-fold.c,
convert-int-saturate.c, func-array.c, func-mixed.c, func-scalar.c,
func-struct.c, func-vararg-dfp.c, func-vararg-mixed.c,
func-vararg-size0.c, inf-1.c, loop-index.c, nan-1.c, nan-2.c,
operator-arith-fold.c, operator-assignment.c, operator-comma.c,
operator-cond.c, operator-logical.c, operator-unary.c, snan.c,
struct-layout-1.c, union-init.c, usual-arith-conv.c: Remove dg-do
directives.
From-SVN: r109779
2006-01-17 01:09:27 +01:00
|
|
|
_Decimal32 x; _Decimal64 y; _Decimal128 z;
|
2007-12-04 11:16:17 +01:00
|
|
|
}]
|
target-supports.exp (check_effective_target_dfp_nocache, [...]): New.
* lib/target-supports.exp (check_effective_target_dfp_nocache,
check_effective_target_dfprt_nocache): New.
(check_effective_target_dfp): Use check_effective_target_dfp_nocache.
(check_effective_target_dfprt): New.
* lib/c-compat.exp (check_dfp): Remove.
(compat_dfp_setup): Use check_effective_target_dfprt_nocache.
* gcc.dg/dfp/dfp.exp: Compile, execute, or skip tests based on
level of support for decimal float.
* gcc.dg/dfp/call-by-value.c, cast.c, compare-eq-const.c,
compare-eq-d128.c, compare-eq-d32.c, compare-eq-d64.c,
compare-eq-dfp.c, compare-rel-const.c, compare-rel-d128.c,
compare-rel-d32.c, compare-rel-d64.c, compare-rel-dfp.c,
convert-bfp.c, convert-bfp-fold.c, convert-complex.c, convert-dfp.c,
convert-dfp-fold.c, convert-dfp-round.c, convert-int-fold.c,
convert-int-saturate.c, func-array.c, func-mixed.c, func-scalar.c,
func-struct.c, func-vararg-dfp.c, func-vararg-mixed.c,
func-vararg-size0.c, inf-1.c, loop-index.c, nan-1.c, nan-2.c,
operator-arith-fold.c, operator-assignment.c, operator-comma.c,
operator-cond.c, operator-logical.c, operator-unary.c, snan.c,
struct-layout-1.c, union-init.c, usual-arith-conv.c: Remove dg-do
directives.
From-SVN: r109779
2006-01-17 01:09:27 +01:00
|
|
|
verbose "check_effective_target_dfp_nocache: returning $ret" 2
|
|
|
|
return $ret
|
|
|
|
}
|
|
|
|
|
|
|
|
proc check_effective_target_dfprt_nocache { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_runtime_nocache dfprt {
|
|
|
|
_Decimal32 x = 1.2df; _Decimal64 y = 2.3dd; _Decimal128 z;
|
|
|
|
int main () { z = x + y; return 0; }
|
|
|
|
}]
|
target-supports.exp (check_effective_target_dfp_nocache, [...]): New.
* lib/target-supports.exp (check_effective_target_dfp_nocache,
check_effective_target_dfprt_nocache): New.
(check_effective_target_dfp): Use check_effective_target_dfp_nocache.
(check_effective_target_dfprt): New.
* lib/c-compat.exp (check_dfp): Remove.
(compat_dfp_setup): Use check_effective_target_dfprt_nocache.
* gcc.dg/dfp/dfp.exp: Compile, execute, or skip tests based on
level of support for decimal float.
* gcc.dg/dfp/call-by-value.c, cast.c, compare-eq-const.c,
compare-eq-d128.c, compare-eq-d32.c, compare-eq-d64.c,
compare-eq-dfp.c, compare-rel-const.c, compare-rel-d128.c,
compare-rel-d32.c, compare-rel-d64.c, compare-rel-dfp.c,
convert-bfp.c, convert-bfp-fold.c, convert-complex.c, convert-dfp.c,
convert-dfp-fold.c, convert-dfp-round.c, convert-int-fold.c,
convert-int-saturate.c, func-array.c, func-mixed.c, func-scalar.c,
func-struct.c, func-vararg-dfp.c, func-vararg-mixed.c,
func-vararg-size0.c, inf-1.c, loop-index.c, nan-1.c, nan-2.c,
operator-arith-fold.c, operator-assignment.c, operator-comma.c,
operator-cond.c, operator-logical.c, operator-unary.c, snan.c,
struct-layout-1.c, union-init.c, usual-arith-conv.c: Remove dg-do
directives.
From-SVN: r109779
2006-01-17 01:09:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target supports compiling Decimal Floating Point,
|
|
|
|
# 0 otherwise.
|
nodfp-1.c: New test.
* gcc.dg/nodfp-1.c: New test.
* gcc.dg/compat/scalar-return-dfp_x.c: Likewise.
* gcc.dg/compat/scalar-return-dfp_x.c: Likewise.
* gcc.dg/compat/scalar-return-dfp_main.c: Likewise.
* gcc.dg/compat/scalar-by-value-dfp_main.c: Likewise.
* gcc.dg/compat/scalar-by-value-dfp_x.c: Likewise.
* gcc.dg/compat/scalar-return-dfp_y.c: Likewise.
* gcc.dg/compat/scalar-by-value-dfp_y.c: Likewise.
* gcc.dg/debug/dwarf2/dwarf-float.c: Likewise.
* gcc.dg/debug/dwarf2/dwarf-dfp.c: Likewise.
* gcc.dg/format/dfp-scanf-1.c: Likewise.
* gcc.dg/format/dfp-printf-1.c: Likewise.
* gcc.dg/compat/struct-layout-1.exp: Use c-compat.exp.
(compat_setup_dfp): New.
* gcc.dg/compat/compat.exp: Use it.
(compat-use-alt-compiler, compat-use-tst-compiler): Move to new file.
Make some variables global, prepend "compat_" to their names.
* gcc.dg/compat/struct-layout-1.h: Conditional DFP support.
* gcc.dg/compat/struct-layout-1_generate.c: Ditto.
* gcc.misc-tests/dectest.exp: New test driver for decTest.
* lib/compat.exp (compat_skip_list): Make global, rename.
* lib/c-compat.exp: New file.
* lib/target-supports.exp (check_effective_target_dfp): New.
* gcc.dg/dfp/dec-eval-method.c, gcc.dg/dfp/func-array.c,
gcc.dg/dfp/convert-dfp-fold.c, gcc.dg/dfp/struct-union.c,
gcc.dg/dfp/compare-rel.h, gcc.dg/dfp/convert-dfp-round.c,
gcc.dg/dfp/func-struct.c, gcc.dg/dfp/constants-c99.c,
gcc.dg/dfp/compare-eq-d32.c, gcc.dg/dfp/func-vararg-mixed.c,
gcc.dg/dfp/compare-rel-d128.c, gcc.dg/dfp/operator-comma.c,
gcc.dg/dfp/decfloat-constants.c, gcc.dg/dfp/operator-bitwise.c,
gcc.dg/dfp/func-mixed.c, gcc.dg/dfp/compare-eq-dfp.c,
gcc.dg/dfp/operator-assignment.c, gcc.dg/dfp/dfp-round.h,
gcc.dg/dfp/modes.c, gcc.dg/dfp/keywords-c99.c, gcc.dg/dfp/nan-1.c,
gcc.dg/dfp/loop-index.c, gcc.dg/dfp/compare-eq-d64.c,
gcc.dg/dfp/convert-bfp.c, gcc.dg/dfp/usual-arith-conv-const.c,
gcc.dg/dfp/convert-dfp.c, gcc.dg/dfp/compare-rel-const.c,
gcc.dg/dfp/convert-int-fold.c, gcc.dg/dfp/keywords-pedantic.c,
gcc.dg/dfp/compare-rel-d32.c, gcc.dg/dfp/call-by-value.c,
gcc.dg/dfp/constants-hex.c, gcc.dg/dfp/func-scalar.c,
gcc.dg/dfp/keywords-ignored-c99.c, gcc.dg/dfp/snan.c,
gcc.dg/dfp/usual-arith-conv.c, gcc.dg/dfp/constants-pedantic.c,
gcc.dg/dfp/operator-logical.c, gcc.dg/dfp/compare-eq-d128.c,
gcc.dg/dfp/convert-bfp-fold.c, gcc.dg/dfp/ctypes.c,
gcc.dg/dfp/convert-int.c, gcc.dg/dfp/keywords-c89.c,
gcc.dg/dfp/constants.c, gcc.dg/dfp/compare-rel-dfp.c,
gcc.dg/dfp/compare-eq-const.c, gcc.dg/dfp/cast-bad.c,
gcc.dg/dfp/operator-arith-fold.c, gcc.dg/dfp/union-init.c,
gcc.dg/dfp/struct-layout-1.c,
gcc.dg/dfp/compare-eq.hgcc.dg/dfp/convert-int-saturate.c,
gcc.dg/dfp/compare-rel-d64.c, gcc.dg/dfp/func-vararg-size0.c,
gcc.dg/dfp/Wconversion-2.c, gcc.dg/dfp/nan-2.c,
gcc.dg/dfp/operator-cond.c, gcc.dg/dfp/composite-type.c,
gcc.dg/dfp/func-vararg-dfp.c,
gcc.dg/dfp/dfp.expgcc.dg/dfp/keywords-reserved.c,
gcc.dg/dfp/convert-complex.c, gcc.dg/dfp/Wbad-function-cast-1.c,
gcc.dg/dfp/operator-unary.c, gcc.dg/dfp/altivec-types.c,
gcc.dg/dfp/cast.c, gcc.dg/dfp/typespec.c,
gcc.dg/dfp/wtr-conversion-1.c: New tests.
Co-Authored-By: Ben Elliston <bje@au.ibm.com>
Co-Authored-By: Jon Grimm <jgrimm2@us.ibm.com>
Co-Authored-By: Yao Qi <qiyaoltc@cn.ibm.com>
From-SVN: r109604
2006-01-11 22:29:59 +01:00
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_dfp { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_cached_effective_target dfp {
|
|
|
|
check_effective_target_dfp_nocache
|
|
|
|
}]
|
nodfp-1.c: New test.
* gcc.dg/nodfp-1.c: New test.
* gcc.dg/compat/scalar-return-dfp_x.c: Likewise.
* gcc.dg/compat/scalar-return-dfp_x.c: Likewise.
* gcc.dg/compat/scalar-return-dfp_main.c: Likewise.
* gcc.dg/compat/scalar-by-value-dfp_main.c: Likewise.
* gcc.dg/compat/scalar-by-value-dfp_x.c: Likewise.
* gcc.dg/compat/scalar-return-dfp_y.c: Likewise.
* gcc.dg/compat/scalar-by-value-dfp_y.c: Likewise.
* gcc.dg/debug/dwarf2/dwarf-float.c: Likewise.
* gcc.dg/debug/dwarf2/dwarf-dfp.c: Likewise.
* gcc.dg/format/dfp-scanf-1.c: Likewise.
* gcc.dg/format/dfp-printf-1.c: Likewise.
* gcc.dg/compat/struct-layout-1.exp: Use c-compat.exp.
(compat_setup_dfp): New.
* gcc.dg/compat/compat.exp: Use it.
(compat-use-alt-compiler, compat-use-tst-compiler): Move to new file.
Make some variables global, prepend "compat_" to their names.
* gcc.dg/compat/struct-layout-1.h: Conditional DFP support.
* gcc.dg/compat/struct-layout-1_generate.c: Ditto.
* gcc.misc-tests/dectest.exp: New test driver for decTest.
* lib/compat.exp (compat_skip_list): Make global, rename.
* lib/c-compat.exp: New file.
* lib/target-supports.exp (check_effective_target_dfp): New.
* gcc.dg/dfp/dec-eval-method.c, gcc.dg/dfp/func-array.c,
gcc.dg/dfp/convert-dfp-fold.c, gcc.dg/dfp/struct-union.c,
gcc.dg/dfp/compare-rel.h, gcc.dg/dfp/convert-dfp-round.c,
gcc.dg/dfp/func-struct.c, gcc.dg/dfp/constants-c99.c,
gcc.dg/dfp/compare-eq-d32.c, gcc.dg/dfp/func-vararg-mixed.c,
gcc.dg/dfp/compare-rel-d128.c, gcc.dg/dfp/operator-comma.c,
gcc.dg/dfp/decfloat-constants.c, gcc.dg/dfp/operator-bitwise.c,
gcc.dg/dfp/func-mixed.c, gcc.dg/dfp/compare-eq-dfp.c,
gcc.dg/dfp/operator-assignment.c, gcc.dg/dfp/dfp-round.h,
gcc.dg/dfp/modes.c, gcc.dg/dfp/keywords-c99.c, gcc.dg/dfp/nan-1.c,
gcc.dg/dfp/loop-index.c, gcc.dg/dfp/compare-eq-d64.c,
gcc.dg/dfp/convert-bfp.c, gcc.dg/dfp/usual-arith-conv-const.c,
gcc.dg/dfp/convert-dfp.c, gcc.dg/dfp/compare-rel-const.c,
gcc.dg/dfp/convert-int-fold.c, gcc.dg/dfp/keywords-pedantic.c,
gcc.dg/dfp/compare-rel-d32.c, gcc.dg/dfp/call-by-value.c,
gcc.dg/dfp/constants-hex.c, gcc.dg/dfp/func-scalar.c,
gcc.dg/dfp/keywords-ignored-c99.c, gcc.dg/dfp/snan.c,
gcc.dg/dfp/usual-arith-conv.c, gcc.dg/dfp/constants-pedantic.c,
gcc.dg/dfp/operator-logical.c, gcc.dg/dfp/compare-eq-d128.c,
gcc.dg/dfp/convert-bfp-fold.c, gcc.dg/dfp/ctypes.c,
gcc.dg/dfp/convert-int.c, gcc.dg/dfp/keywords-c89.c,
gcc.dg/dfp/constants.c, gcc.dg/dfp/compare-rel-dfp.c,
gcc.dg/dfp/compare-eq-const.c, gcc.dg/dfp/cast-bad.c,
gcc.dg/dfp/operator-arith-fold.c, gcc.dg/dfp/union-init.c,
gcc.dg/dfp/struct-layout-1.c,
gcc.dg/dfp/compare-eq.hgcc.dg/dfp/convert-int-saturate.c,
gcc.dg/dfp/compare-rel-d64.c, gcc.dg/dfp/func-vararg-size0.c,
gcc.dg/dfp/Wconversion-2.c, gcc.dg/dfp/nan-2.c,
gcc.dg/dfp/operator-cond.c, gcc.dg/dfp/composite-type.c,
gcc.dg/dfp/func-vararg-dfp.c,
gcc.dg/dfp/dfp.expgcc.dg/dfp/keywords-reserved.c,
gcc.dg/dfp/convert-complex.c, gcc.dg/dfp/Wbad-function-cast-1.c,
gcc.dg/dfp/operator-unary.c, gcc.dg/dfp/altivec-types.c,
gcc.dg/dfp/cast.c, gcc.dg/dfp/typespec.c,
gcc.dg/dfp/wtr-conversion-1.c: New tests.
Co-Authored-By: Ben Elliston <bje@au.ibm.com>
Co-Authored-By: Jon Grimm <jgrimm2@us.ibm.com>
Co-Authored-By: Yao Qi <qiyaoltc@cn.ibm.com>
From-SVN: r109604
2006-01-11 22:29:59 +01:00
|
|
|
}
|
|
|
|
|
target-supports.exp (check_effective_target_dfp_nocache, [...]): New.
* lib/target-supports.exp (check_effective_target_dfp_nocache,
check_effective_target_dfprt_nocache): New.
(check_effective_target_dfp): Use check_effective_target_dfp_nocache.
(check_effective_target_dfprt): New.
* lib/c-compat.exp (check_dfp): Remove.
(compat_dfp_setup): Use check_effective_target_dfprt_nocache.
* gcc.dg/dfp/dfp.exp: Compile, execute, or skip tests based on
level of support for decimal float.
* gcc.dg/dfp/call-by-value.c, cast.c, compare-eq-const.c,
compare-eq-d128.c, compare-eq-d32.c, compare-eq-d64.c,
compare-eq-dfp.c, compare-rel-const.c, compare-rel-d128.c,
compare-rel-d32.c, compare-rel-d64.c, compare-rel-dfp.c,
convert-bfp.c, convert-bfp-fold.c, convert-complex.c, convert-dfp.c,
convert-dfp-fold.c, convert-dfp-round.c, convert-int-fold.c,
convert-int-saturate.c, func-array.c, func-mixed.c, func-scalar.c,
func-struct.c, func-vararg-dfp.c, func-vararg-mixed.c,
func-vararg-size0.c, inf-1.c, loop-index.c, nan-1.c, nan-2.c,
operator-arith-fold.c, operator-assignment.c, operator-comma.c,
operator-cond.c, operator-logical.c, operator-unary.c, snan.c,
struct-layout-1.c, union-init.c, usual-arith-conv.c: Remove dg-do
directives.
From-SVN: r109779
2006-01-17 01:09:27 +01:00
|
|
|
# Return 1 if the target supports linking and executing Decimal Floating
|
|
|
|
# Point, # 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_dfprt { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_cached_effective_target dfprt {
|
|
|
|
check_effective_target_dfprt_nocache
|
|
|
|
}]
|
target-supports.exp (check_effective_target_dfp_nocache, [...]): New.
* lib/target-supports.exp (check_effective_target_dfp_nocache,
check_effective_target_dfprt_nocache): New.
(check_effective_target_dfp): Use check_effective_target_dfp_nocache.
(check_effective_target_dfprt): New.
* lib/c-compat.exp (check_dfp): Remove.
(compat_dfp_setup): Use check_effective_target_dfprt_nocache.
* gcc.dg/dfp/dfp.exp: Compile, execute, or skip tests based on
level of support for decimal float.
* gcc.dg/dfp/call-by-value.c, cast.c, compare-eq-const.c,
compare-eq-d128.c, compare-eq-d32.c, compare-eq-d64.c,
compare-eq-dfp.c, compare-rel-const.c, compare-rel-d128.c,
compare-rel-d32.c, compare-rel-d64.c, compare-rel-dfp.c,
convert-bfp.c, convert-bfp-fold.c, convert-complex.c, convert-dfp.c,
convert-dfp-fold.c, convert-dfp-round.c, convert-int-fold.c,
convert-int-saturate.c, func-array.c, func-mixed.c, func-scalar.c,
func-struct.c, func-vararg-dfp.c, func-vararg-mixed.c,
func-vararg-size0.c, inf-1.c, loop-index.c, nan-1.c, nan-2.c,
operator-arith-fold.c, operator-assignment.c, operator-comma.c,
operator-cond.c, operator-logical.c, operator-unary.c, snan.c,
struct-layout-1.c, union-init.c, usual-arith-conv.c: Remove dg-do
directives.
From-SVN: r109779
2006-01-17 01:09:27 +01:00
|
|
|
}
|
|
|
|
|
2005-06-03 10:09:47 +02:00
|
|
|
# Return 1 if the target needs a command line argument to enable a SIMD
|
|
|
|
# instruction set.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_cmdline_needed { } {
|
|
|
|
global et_vect_cmdline_needed_saved
|
2006-10-06 02:47:35 +02:00
|
|
|
global et_vect_cmdline_needed_target_name
|
|
|
|
|
|
|
|
if { ![info exists et_vect_cmdline_needed_target_name] } {
|
|
|
|
set et_vect_cmdline_needed_target_name ""
|
|
|
|
}
|
|
|
|
|
|
|
|
# If the target has changed since we set the cached value, clear it.
|
|
|
|
set current_target [current_target_name]
|
|
|
|
if { $current_target != $et_vect_cmdline_needed_target_name } {
|
|
|
|
verbose "check_effective_target_vect_cmdline_needed: `$et_vect_cmdline_needed_target_name' `$current_target'" 2
|
|
|
|
set et_vect_cmdline_needed_target_name $current_target
|
|
|
|
if { [info exists et_vect_cmdline_needed_saved] } {
|
|
|
|
verbose "check_effective_target_vect_cmdline_needed: removing cached result" 2
|
|
|
|
unset et_vect_cmdline_needed_saved
|
|
|
|
}
|
|
|
|
}
|
2005-06-03 10:09:47 +02:00
|
|
|
|
|
|
|
if [info exists et_vect_cmdline_needed_saved] {
|
|
|
|
verbose "check_effective_target_vect_cmdline_needed: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_cmdline_needed_saved 1
|
|
|
|
if { [istarget ia64-*-*]
|
2006-10-06 02:47:35 +02:00
|
|
|
|| (([istarget x86_64-*-*] || [istarget i?86-*-*])
|
2007-01-01 13:56:08 +01:00
|
|
|
&& [check_effective_target_lp64])
|
|
|
|
|| ([istarget powerpc*-*-*]
|
2007-01-27 00:53:28 +01:00
|
|
|
&& ([check_effective_target_powerpc_spe]
|
2008-06-26 08:31:16 +02:00
|
|
|
|| [check_effective_target_powerpc_altivec]))
|
2008-07-02 00:15:47 +02:00
|
|
|
|| [istarget spu-*-*]
|
|
|
|
|| ([istarget arm*-*-*] && [check_effective_target_arm_neon]) } {
|
2005-06-03 10:09:47 +02:00
|
|
|
set et_vect_cmdline_needed_saved 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_cmdline_needed: returning $et_vect_cmdline_needed_saved" 2
|
|
|
|
return $et_vect_cmdline_needed_saved
|
|
|
|
}
|
|
|
|
|
2004-11-18 00:47:21 +01:00
|
|
|
# Return 1 if the target supports hardware vectors of int, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_int { } {
|
|
|
|
global et_vect_int_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_int_saved] {
|
|
|
|
verbose "check_effective_target_vect_int: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_int_saved 0
|
|
|
|
if { [istarget i?86-*-*]
|
2007-10-31 18:04:42 +01:00
|
|
|
|| ([istarget powerpc*-*-*]
|
|
|
|
&& ![istarget powerpc-*-linux*paired*])
|
2006-12-03 21:05:31 +01:00
|
|
|
|| [istarget spu-*-*]
|
2004-11-18 00:47:21 +01:00
|
|
|
|| [istarget x86_64-*-*]
|
pr18425.c: Use effective target vect_long.
* gcc.dg/vect/pr18425.c: Use effective target vect_long.
* gcc.dg/vect/vect-13.c, gcc.dg/vect/vect-17.c, gcc.dg/vect/vect-18.c,
gcc.dg/vect/vect-19.c, gcc.dg/vect/vect-20.c, gcc.dg/vect/vect-48a.c,
gcc.dg/vect/vect-56a.c, gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-77.c,
gcc.dg/vect/vect-77a.c, gcc.dg/vect/vect-78.c, gcc.dg/vect/vect-86.c,
gcc.dg/vect/vect-87.c, gcc.dg/vect/vect-88.c: XFAIL for alpha.
* gcc.dg/vect/vect.exp: Add check for alpha.
* lib/target-supports.exp (check_alpha_max_hw_available): New.
(check_effective_target_vect_int): Enable for alpha.
(check_effective_target_vect_long): New.
(is-effective-target): Add it.
From-SVN: r91105
2004-11-23 23:03:31 +01:00
|
|
|
|| [istarget sparc*-*-*]
|
2005-01-03 20:59:13 +01:00
|
|
|
|| [istarget alpha*-*-*]
|
2008-07-02 00:15:47 +02:00
|
|
|
|| [istarget ia64-*-*]
|
|
|
|
|| [check_effective_target_arm32] } {
|
2004-11-18 00:47:21 +01:00
|
|
|
set et_vect_int_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_int: returning $et_vect_int_saved" 2
|
|
|
|
return $et_vect_int_saved
|
|
|
|
}
|
|
|
|
|
2009-04-29 20:07:23 +02:00
|
|
|
# Return 1 if the target supports signed int->float conversion
|
2007-05-03 14:54:45 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
proc check_effective_target_vect_intfloat_cvt { } {
|
|
|
|
global et_vect_intfloat_cvt_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_intfloat_cvt_saved] {
|
|
|
|
verbose "check_effective_target_vect_intfloat_cvt: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_intfloat_cvt_saved 0
|
|
|
|
if { [istarget i?86-*-*]
|
2007-10-31 18:04:42 +01:00
|
|
|
|| ([istarget powerpc*-*-*]
|
|
|
|
&& ![istarget powerpc-*-linux*paired*])
|
2007-05-03 14:54:45 +02:00
|
|
|
|| [istarget x86_64-*-*] } {
|
|
|
|
set et_vect_intfloat_cvt_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_intfloat_cvt: returning $et_vect_intfloat_cvt_saved" 2
|
|
|
|
return $et_vect_intfloat_cvt_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-04-29 20:07:23 +02:00
|
|
|
# Return 1 if the target supports unsigned int->float conversion
|
|
|
|
#
|
|
|
|
|
|
|
|
proc check_effective_target_vect_uintfloat_cvt { } {
|
|
|
|
global et_vect_uintfloat_cvt_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_uintfloat_cvt_saved] {
|
|
|
|
verbose "check_effective_target_vect_uintfloat_cvt: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_uintfloat_cvt_saved 0
|
|
|
|
if { ([istarget powerpc*-*-*]
|
|
|
|
&& ![istarget powerpc-*-linux*paired*]) } {
|
|
|
|
set et_vect_uintfloat_cvt_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_uintfloat_cvt: returning $et_vect_uintfloat_cvt_saved" 2
|
|
|
|
return $et_vect_uintfloat_cvt_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Return 1 if the target supports signed float->int conversion
|
2007-05-03 14:54:45 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
proc check_effective_target_vect_floatint_cvt { } {
|
|
|
|
global et_vect_floatint_cvt_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_floatint_cvt_saved] {
|
|
|
|
verbose "check_effective_target_vect_floatint_cvt: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_floatint_cvt_saved 0
|
|
|
|
if { [istarget i?86-*-*]
|
2008-08-08 21:00:36 +02:00
|
|
|
|| ([istarget powerpc*-*-*]
|
|
|
|
&& ![istarget powerpc-*-linux*paired*])
|
2007-05-03 14:54:45 +02:00
|
|
|
|| [istarget x86_64-*-*] } {
|
|
|
|
set et_vect_floatint_cvt_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_floatint_cvt: returning $et_vect_floatint_cvt_saved" 2
|
|
|
|
return $et_vect_floatint_cvt_saved
|
|
|
|
}
|
|
|
|
|
2009-04-29 20:07:23 +02:00
|
|
|
# Return 1 if the target supports unsigned float->int conversion
|
|
|
|
#
|
|
|
|
|
|
|
|
proc check_effective_target_vect_floatuint_cvt { } {
|
|
|
|
global et_vect_floatuint_cvt_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_floatuint_cvt_saved] {
|
|
|
|
verbose "check_effective_target_vect_floatuint_cvt: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_floatuint_cvt_saved 0
|
|
|
|
if { ([istarget powerpc*-*-*]
|
|
|
|
&& ![istarget powerpc-*-linux*paired*]) } {
|
|
|
|
set et_vect_floatuint_cvt_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_floatuint_cvt: returning $et_vect_floatuint_cvt_saved" 2
|
|
|
|
return $et_vect_floatuint_cvt_saved
|
|
|
|
}
|
|
|
|
|
2005-05-05 17:12:01 +02:00
|
|
|
# Return 1 is this is an arm target using 32-bit instructions
|
|
|
|
proc check_effective_target_arm32 { } {
|
2007-08-15 19:44:51 +02:00
|
|
|
return [check_no_compiler_messages arm32 assembly {
|
|
|
|
#if !defined(__arm__) || (defined(__thumb__) && !defined(__thumb2__))
|
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
}]
|
2005-05-05 17:12:01 +02:00
|
|
|
}
|
|
|
|
|
2006-10-31 20:58:21 +01:00
|
|
|
# Return 1 if this is an ARM target supporting -mfpu=vfp
|
|
|
|
# -mfloat-abi=softfp. Some multilibs may be incompatible with these
|
|
|
|
# options.
|
|
|
|
|
|
|
|
proc check_effective_target_arm_vfp_ok { } {
|
|
|
|
if { [check_effective_target_arm32] } {
|
|
|
|
return [check_no_compiler_messages arm_vfp_ok object {
|
|
|
|
int dummy;
|
|
|
|
} "-mfpu=vfp -mfloat-abi=softfp"]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Makefile.in (TEXI_GCC_FILES): Add arm-neon-intrinsics.texi.
gcc/
* Makefile.in (TEXI_GCC_FILES): Add arm-neon-intrinsics.texi.
* config.gcc (arm*-*-*): Add arm_neon.h to extra headers.
(with_fpu): Allow --with-fpu=neon.
* config/arm/aof.h (ADDITIONAL_REGISTER_NAMES): Add Q0-Q15.
* config/arm/aout.h (ADDITIONAL_REGISTER_NAMES): Add Q0-Q15.
* config/arm/arm-modes.def (EI, OI, CI, XI): New modes.
* config/arm/arm-protos.h (neon_immediate_valid_for_move)
(neon_immediate_valid_for_logic, neon_output_logic_immediate)
(neon_pairwise_reduce, neon_expand_vector_init, neon_reinterpret)
(neon_emit_pair_result_insn, neon_disambiguate_copy)
(neon_vector_mem_operand, neon_struct_mem_operand, output_move_quad)
(output_move_neon): Add prototypes.
* config/arm/arm.c (FL_NEON): New flag for NEON processor capability.
(all_fpus): Add FPUTYPE_NEON.
(fp_model_for_fpu): Add NEON field.
(arm_return_in_memory): Return vectors <= 16 bytes in ARM registers.
(arm_arg_partial_bytes): Allow NEON vectors to be passed partially
in registers.
(arm_legitimate_address_p): Don't support fancy addressing for NEON
structure moves.
(thumb2_legitimate_address_p): Likewise.
(neon_valid_immediate): Recognize and prepare constants suitable for
NEON instructions.
(neon_immediate_valid_for_move): New function. Recognize and prepare
immediates for NEON move instructions.
(neon_immediate_valid_for_logic): New function. Recognize and
prepare immediates for NEON logic instructions.
(neon_output_logic_immediate): New function. Create asm string
suitable for outputting immediate logic instructions.
(neon_pairwise_reduce): New function. Implement reduction using
pairwise operations.
(neon_expand_vector_init): New function. Expand a (possibly
non-constant) vector initialization.
(neon_vector_mem_operand): New function. Memory operands supported
for quad-word loads/stores to/from ARM or NEON registers. Don't
allow base+offset addressing for core regs.
(neon_struct_mem_operand): New function. Valid mems for NEON
structure moves.
(coproc_secondary_reload_class): Enable NEON registers to be loaded
from neon_vector_mem_operand addresses without a secondary register.
(add_minipool_forward_ref): Handle >8-byte minipool entries.
(add_minipool_backward_ref): Likewise.
(dump_minipool): Likewise.
(push_minipool_fix): Likewise.
(output_move_quad): New function. Output quad-word moves, loads and
stores using ARM registers.
(output_move_vfp): Add support for vectors in VFP (NEON) D
registers.
(output_move_neon): Output a NEON load/store to/from a quadword
register.
(arm_print_operand): Implement new codes:
- 'c' for unadorned integers (without a # sign).
- 'J', 'K' for reg+2/reg+3, reg+3/reg+2 in little/big-endian
mode.
- 'e', 'f' for the low and high D parts of a NEON Q register.
- 'q' outputs a NEON Q register.
- 'h' outputs ranges of D registers for VLDM/VSTM etc.
- 'T' prints NEON opcode features from a coded bitmask.
- 'F' is similar to T, but signed/unsigned codes both print as
'i'.
- 't' is similar to T, but 'u' is printed instead of 'p'.
- 'O' prints 'r' if NEON instruction should perform rounding (as
specified by bitmask), else prints nothing.
- '#' is a punctuation character to stop operand numbers from
running together with following digits in the assembler
strings for instructions (when using mode attributes).
(arm_assemble_integer): Handle extra NEON vector modes. Permute
constant vectors in big-endian mode, where necessary.
(arm_hard_regno_mode_ok): Allow vectors in VFP/NEON registers.
Handle EI, OI, CI, XI modes.
(ashlv4hi3, ashlv2si3, lshrv4hi3, lshrv2si3, ashrv4hi3)
(ashrv2si3): Rename IWMMXT2_BUILTINs to...
(ashlv4hi3_iwmmxt, ashlv2si3_iwmmxt, lshrv4hi3_iwmmxt)
(lshrv2si3_iwmmxt, ashrv4hi3_iwmmxt, ashrv2si3_iwmmxt): New names.
(neon_builtin_type_bits): Add enumeration, one bit for each vector
type.
(v8qi_UP, v4hi_UP, v2si_UP, v2sf_UP, di_UP, v16qi_UP, v8hi_UP)
(v4si_UP, v4sf_UP, v2di_UP, ti_UP, ei_UP, oi_UP, UP): Define macros
to turn v8qi, etc. into bits defined above.
(neon_itype): New enumeration. Classifications of NEON builtins.
(neon_builtin_datum): Define struct. Contains information about
a single builtin (with multiple modes).
(CF): Define helper macro for...
(VAR1...VAR10): Define builtins with a type, name and 1-10 different
modes.
(neon_builtin_data): New array. Define information about builtins
for use during initialization/expansion.
(arm_init_neon_builtins): New function.
(arm_init_builtins): Call arm_init_neon_builtins if TARGET_NEON is
true.
(neon_builtin_compare): New function.
(locate_neon_builtin_icode): New function. Find an insn code for a
builtin given a function code for that builtin. Also return type of
builtin (NEON_BINOP, NEON_UNOP etc.).
(builtin_arg): New enumeration. Types of arguments for builtins.
(arm_expand_neon_args): New function. Expand a generic NEON builtin.
Takes a variable argument list of builtin_arg types, terminated by
NEON_ARG_STOP.
(arm_expand_neon_builtin): New function. Expand a NEON builtin.
(neon_reinterpret): New function. Expand NEON reinterpret intrinsic.
(neon_emit_pair_result_insn): New function. Support returning pairs
of vectors via a pointer.
(neon_disambiguate_copy): New function. Set up operands for a
multi-word copy such that registers do not get clobbered.
(arm_expand_builtin): Call arm_expand_neon_builtin if fcode >=
ARM_BUILTIN_NEON_BASE.
(arm_file_start): Set float-abi attribute for NEON.
(arm_vector_mode_supported_p): Enable NEON vector modes.
(arm_mangle_map_entry): New.
(arm_mangle_map): New.
(arm_mangle_vector_type): New.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __ARM_NEON__
when appropriate.
(TARGET_NEON): New macro. Target supports NEON.
(fputype): Add FPUTYPE_NEON.
(UNITS_PER_SIMD_WORD): Define. Allow quad-word registers to be used
for vectorization based on command-line arg.
(NEON_REGNO_OK_FOR_NREGS): Define.
(VALID_NEON_DREG_MODE, VALID_NEON_QREG_MODE)
(VALID_NEON_STRUCT_MODE): Define.
(PRINT_OPERAND_PUNCT_VALID_P): '#' is valid punctuation.
(arm_builtins): Add ARM_BUILTIN_NEON_BASE.
* config/arm/arm.md (VUNSPEC_POOL_16): Insert constant for unspec.
(consttable_16): Add pattern for outputting 16-byte minipool
entries.
(movv2si, movv4hi, movv8qi): Remove blank expanders (redefined in
vec-common.md).
(vec-common.md, neon.md): Include md files.
* config/arm/arm.opt (mvectorize-with-neon-quad): Add option.
* config/arm/constraints.md (constraint "Dn", "Dl", "DL"): Define.
(memory_constraint "Ut", "Un", "Us"): Define.
* config/arm/iwmmxt.md (VMMX, VSHFT): New mode macros.
(MMX_char): New mode attribute.
(addv8qi3, addv4hi3, addv2si3): Remove. Replace with...
(*add<mode>3_iwmmxt): New insn pattern.
(subv8qi3, subv4hi3, subv2si3): Remove. Replace with...
(*sub<mode>3_iwmmxt): New insn pattern.
(mulv4hi3): Rename to...
(*mulv4hi3_iwmmxt): This.
(smaxv8qi3, smaxv4hi3, smaxv2si3, umaxv8qi3, umaxv4hi3)
(umaxv2si3, sminv8qi3, sminv4hi3, sminv2si3, uminv8qi3)
(uminv4hi3, uminv2si3): Remove. Replace with...
(*smax<mode>3_iwmmxt, *umax<mode>3_iwmmxt, *smin<mode>3_iwmmxt)
(*umin<mode>3_iwmmxt): These.
(ashrv4hi3, ashrv2si3, ashrdi3_iwmmxt): Replace with...
(ashr<mode>3_iwmmxt): This new pattern.
(lshrv4hi3, lshrv2si3, lshrdi3_iwmmxt): Replace with...
(lshr<mode>3_iwmmxt): This new pattern.
(ashlv4hi3, ashlv2si3, ashldi3_iwmmxt): Replace with...
(ashl<mode>3_iwmmxt): This new pattern.
* config/arm/neon-docgen.ml: New file. Generate documentation for
intrinsics.
* config/arm/neon-gen.ml: New file. Generate arm_neon.h header.
* config/arm/arm_neon.h: New (autogenerated).
* config/arm/neon-testgen.ml: New file. Generate NEON tests
automatically.
* config/arm/neon.md: New file. Define NEON instructions.
* config/arm/neon.ml: New file. Abstract description of NEON
instructions, used to generate arm_neon.h header, documentation and tests.
* config/arm/t-arm (MD_INCLUDES): Add vec-common.md, neon.md.
* vec-common.md: New file. Shared parts for iWMMXt and NEON vector
support.
* doc/extend.texi (ARM Built-in Functions): Rename and remove
extraneous comma.
(ARM NEON Intrinsics): New subsection.
* doc/arm-neon-intrinsics.texi: New (autogenerated).
gcc/testsuite/
* gcc.dg/vect/vect.exp: Check is-effective-target arm_neon_hw.
* gcc.dg/vect/tree-vect.h: Check for NEON SIMD support.
* lib/gcc-dg.exp (cleanup-saved-temps): Fix comment.
* lib/target-supports.exp (check_effective_target_arm_neon_ok)
(check_effective_target_arm_neon_hw): New.
* gcc.target/arm/neon/neon.exp: New file.
* gcc.target/arm/neon/polytypes.c: New file.
* gcc.target/arm/neon/v*.c (1870 files): New (autogenerated).
Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
Co-Authored-By: Mark Shinwell <shinwell@codesourcery.com>
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r126911
2007-07-25 14:28:31 +02:00
|
|
|
# Return 1 if this is an ARM target supporting -mfpu=neon
|
|
|
|
# -mfloat-abi=softfp. Some multilibs may be incompatible with these
|
|
|
|
# options.
|
|
|
|
|
|
|
|
proc check_effective_target_arm_neon_ok { } {
|
|
|
|
if { [check_effective_target_arm32] } {
|
|
|
|
return [check_no_compiler_messages arm_neon_ok object {
|
|
|
|
int dummy;
|
|
|
|
} "-mfpu=neon -mfloat-abi=softfp"]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-25 17:49:36 +02:00
|
|
|
# Return 1 is this is an ARM target where -mthumb causes Thumb-1 to be
|
|
|
|
# used.
|
|
|
|
|
|
|
|
proc check_effective_target_arm_thumb1_ok { } {
|
|
|
|
return [check_no_compiler_messages arm_thumb1_ok assembly {
|
|
|
|
#if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__)
|
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
} "-mthumb"]
|
|
|
|
}
|
|
|
|
|
2009-05-23 03:34:53 +02:00
|
|
|
# Return 1 is this is an ARM target where -mthumb causes Thumb-2 to be
|
|
|
|
# used.
|
|
|
|
|
|
|
|
proc check_effective_target_arm_thumb2_ok { } {
|
|
|
|
return [check_no_compiler_messages arm_thumb2_ok assembly {
|
|
|
|
#if !defined(__thumb2__)
|
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
} "-mthumb"]
|
|
|
|
}
|
|
|
|
|
Makefile.in (TEXI_GCC_FILES): Add arm-neon-intrinsics.texi.
gcc/
* Makefile.in (TEXI_GCC_FILES): Add arm-neon-intrinsics.texi.
* config.gcc (arm*-*-*): Add arm_neon.h to extra headers.
(with_fpu): Allow --with-fpu=neon.
* config/arm/aof.h (ADDITIONAL_REGISTER_NAMES): Add Q0-Q15.
* config/arm/aout.h (ADDITIONAL_REGISTER_NAMES): Add Q0-Q15.
* config/arm/arm-modes.def (EI, OI, CI, XI): New modes.
* config/arm/arm-protos.h (neon_immediate_valid_for_move)
(neon_immediate_valid_for_logic, neon_output_logic_immediate)
(neon_pairwise_reduce, neon_expand_vector_init, neon_reinterpret)
(neon_emit_pair_result_insn, neon_disambiguate_copy)
(neon_vector_mem_operand, neon_struct_mem_operand, output_move_quad)
(output_move_neon): Add prototypes.
* config/arm/arm.c (FL_NEON): New flag for NEON processor capability.
(all_fpus): Add FPUTYPE_NEON.
(fp_model_for_fpu): Add NEON field.
(arm_return_in_memory): Return vectors <= 16 bytes in ARM registers.
(arm_arg_partial_bytes): Allow NEON vectors to be passed partially
in registers.
(arm_legitimate_address_p): Don't support fancy addressing for NEON
structure moves.
(thumb2_legitimate_address_p): Likewise.
(neon_valid_immediate): Recognize and prepare constants suitable for
NEON instructions.
(neon_immediate_valid_for_move): New function. Recognize and prepare
immediates for NEON move instructions.
(neon_immediate_valid_for_logic): New function. Recognize and
prepare immediates for NEON logic instructions.
(neon_output_logic_immediate): New function. Create asm string
suitable for outputting immediate logic instructions.
(neon_pairwise_reduce): New function. Implement reduction using
pairwise operations.
(neon_expand_vector_init): New function. Expand a (possibly
non-constant) vector initialization.
(neon_vector_mem_operand): New function. Memory operands supported
for quad-word loads/stores to/from ARM or NEON registers. Don't
allow base+offset addressing for core regs.
(neon_struct_mem_operand): New function. Valid mems for NEON
structure moves.
(coproc_secondary_reload_class): Enable NEON registers to be loaded
from neon_vector_mem_operand addresses without a secondary register.
(add_minipool_forward_ref): Handle >8-byte minipool entries.
(add_minipool_backward_ref): Likewise.
(dump_minipool): Likewise.
(push_minipool_fix): Likewise.
(output_move_quad): New function. Output quad-word moves, loads and
stores using ARM registers.
(output_move_vfp): Add support for vectors in VFP (NEON) D
registers.
(output_move_neon): Output a NEON load/store to/from a quadword
register.
(arm_print_operand): Implement new codes:
- 'c' for unadorned integers (without a # sign).
- 'J', 'K' for reg+2/reg+3, reg+3/reg+2 in little/big-endian
mode.
- 'e', 'f' for the low and high D parts of a NEON Q register.
- 'q' outputs a NEON Q register.
- 'h' outputs ranges of D registers for VLDM/VSTM etc.
- 'T' prints NEON opcode features from a coded bitmask.
- 'F' is similar to T, but signed/unsigned codes both print as
'i'.
- 't' is similar to T, but 'u' is printed instead of 'p'.
- 'O' prints 'r' if NEON instruction should perform rounding (as
specified by bitmask), else prints nothing.
- '#' is a punctuation character to stop operand numbers from
running together with following digits in the assembler
strings for instructions (when using mode attributes).
(arm_assemble_integer): Handle extra NEON vector modes. Permute
constant vectors in big-endian mode, where necessary.
(arm_hard_regno_mode_ok): Allow vectors in VFP/NEON registers.
Handle EI, OI, CI, XI modes.
(ashlv4hi3, ashlv2si3, lshrv4hi3, lshrv2si3, ashrv4hi3)
(ashrv2si3): Rename IWMMXT2_BUILTINs to...
(ashlv4hi3_iwmmxt, ashlv2si3_iwmmxt, lshrv4hi3_iwmmxt)
(lshrv2si3_iwmmxt, ashrv4hi3_iwmmxt, ashrv2si3_iwmmxt): New names.
(neon_builtin_type_bits): Add enumeration, one bit for each vector
type.
(v8qi_UP, v4hi_UP, v2si_UP, v2sf_UP, di_UP, v16qi_UP, v8hi_UP)
(v4si_UP, v4sf_UP, v2di_UP, ti_UP, ei_UP, oi_UP, UP): Define macros
to turn v8qi, etc. into bits defined above.
(neon_itype): New enumeration. Classifications of NEON builtins.
(neon_builtin_datum): Define struct. Contains information about
a single builtin (with multiple modes).
(CF): Define helper macro for...
(VAR1...VAR10): Define builtins with a type, name and 1-10 different
modes.
(neon_builtin_data): New array. Define information about builtins
for use during initialization/expansion.
(arm_init_neon_builtins): New function.
(arm_init_builtins): Call arm_init_neon_builtins if TARGET_NEON is
true.
(neon_builtin_compare): New function.
(locate_neon_builtin_icode): New function. Find an insn code for a
builtin given a function code for that builtin. Also return type of
builtin (NEON_BINOP, NEON_UNOP etc.).
(builtin_arg): New enumeration. Types of arguments for builtins.
(arm_expand_neon_args): New function. Expand a generic NEON builtin.
Takes a variable argument list of builtin_arg types, terminated by
NEON_ARG_STOP.
(arm_expand_neon_builtin): New function. Expand a NEON builtin.
(neon_reinterpret): New function. Expand NEON reinterpret intrinsic.
(neon_emit_pair_result_insn): New function. Support returning pairs
of vectors via a pointer.
(neon_disambiguate_copy): New function. Set up operands for a
multi-word copy such that registers do not get clobbered.
(arm_expand_builtin): Call arm_expand_neon_builtin if fcode >=
ARM_BUILTIN_NEON_BASE.
(arm_file_start): Set float-abi attribute for NEON.
(arm_vector_mode_supported_p): Enable NEON vector modes.
(arm_mangle_map_entry): New.
(arm_mangle_map): New.
(arm_mangle_vector_type): New.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __ARM_NEON__
when appropriate.
(TARGET_NEON): New macro. Target supports NEON.
(fputype): Add FPUTYPE_NEON.
(UNITS_PER_SIMD_WORD): Define. Allow quad-word registers to be used
for vectorization based on command-line arg.
(NEON_REGNO_OK_FOR_NREGS): Define.
(VALID_NEON_DREG_MODE, VALID_NEON_QREG_MODE)
(VALID_NEON_STRUCT_MODE): Define.
(PRINT_OPERAND_PUNCT_VALID_P): '#' is valid punctuation.
(arm_builtins): Add ARM_BUILTIN_NEON_BASE.
* config/arm/arm.md (VUNSPEC_POOL_16): Insert constant for unspec.
(consttable_16): Add pattern for outputting 16-byte minipool
entries.
(movv2si, movv4hi, movv8qi): Remove blank expanders (redefined in
vec-common.md).
(vec-common.md, neon.md): Include md files.
* config/arm/arm.opt (mvectorize-with-neon-quad): Add option.
* config/arm/constraints.md (constraint "Dn", "Dl", "DL"): Define.
(memory_constraint "Ut", "Un", "Us"): Define.
* config/arm/iwmmxt.md (VMMX, VSHFT): New mode macros.
(MMX_char): New mode attribute.
(addv8qi3, addv4hi3, addv2si3): Remove. Replace with...
(*add<mode>3_iwmmxt): New insn pattern.
(subv8qi3, subv4hi3, subv2si3): Remove. Replace with...
(*sub<mode>3_iwmmxt): New insn pattern.
(mulv4hi3): Rename to...
(*mulv4hi3_iwmmxt): This.
(smaxv8qi3, smaxv4hi3, smaxv2si3, umaxv8qi3, umaxv4hi3)
(umaxv2si3, sminv8qi3, sminv4hi3, sminv2si3, uminv8qi3)
(uminv4hi3, uminv2si3): Remove. Replace with...
(*smax<mode>3_iwmmxt, *umax<mode>3_iwmmxt, *smin<mode>3_iwmmxt)
(*umin<mode>3_iwmmxt): These.
(ashrv4hi3, ashrv2si3, ashrdi3_iwmmxt): Replace with...
(ashr<mode>3_iwmmxt): This new pattern.
(lshrv4hi3, lshrv2si3, lshrdi3_iwmmxt): Replace with...
(lshr<mode>3_iwmmxt): This new pattern.
(ashlv4hi3, ashlv2si3, ashldi3_iwmmxt): Replace with...
(ashl<mode>3_iwmmxt): This new pattern.
* config/arm/neon-docgen.ml: New file. Generate documentation for
intrinsics.
* config/arm/neon-gen.ml: New file. Generate arm_neon.h header.
* config/arm/arm_neon.h: New (autogenerated).
* config/arm/neon-testgen.ml: New file. Generate NEON tests
automatically.
* config/arm/neon.md: New file. Define NEON instructions.
* config/arm/neon.ml: New file. Abstract description of NEON
instructions, used to generate arm_neon.h header, documentation and tests.
* config/arm/t-arm (MD_INCLUDES): Add vec-common.md, neon.md.
* vec-common.md: New file. Shared parts for iWMMXt and NEON vector
support.
* doc/extend.texi (ARM Built-in Functions): Rename and remove
extraneous comma.
(ARM NEON Intrinsics): New subsection.
* doc/arm-neon-intrinsics.texi: New (autogenerated).
gcc/testsuite/
* gcc.dg/vect/vect.exp: Check is-effective-target arm_neon_hw.
* gcc.dg/vect/tree-vect.h: Check for NEON SIMD support.
* lib/gcc-dg.exp (cleanup-saved-temps): Fix comment.
* lib/target-supports.exp (check_effective_target_arm_neon_ok)
(check_effective_target_arm_neon_hw): New.
* gcc.target/arm/neon/neon.exp: New file.
* gcc.target/arm/neon/polytypes.c: New file.
* gcc.target/arm/neon/v*.c (1870 files): New (autogenerated).
Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
Co-Authored-By: Mark Shinwell <shinwell@codesourcery.com>
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r126911
2007-07-25 14:28:31 +02:00
|
|
|
# Return 1 if the target supports executing NEON instructions, 0
|
|
|
|
# otherwise. Cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_arm_neon_hw { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_runtime arm_neon_hw_available {
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
long long a = 0, b = 1;
|
|
|
|
asm ("vorr %P0, %P1, %P2"
|
|
|
|
: "=w" (a)
|
|
|
|
: "0" (a), "w" (b));
|
|
|
|
return (a != 1);
|
|
|
|
}
|
|
|
|
} "-mfpu=neon -mfloat-abi=softfp"]
|
Makefile.in (TEXI_GCC_FILES): Add arm-neon-intrinsics.texi.
gcc/
* Makefile.in (TEXI_GCC_FILES): Add arm-neon-intrinsics.texi.
* config.gcc (arm*-*-*): Add arm_neon.h to extra headers.
(with_fpu): Allow --with-fpu=neon.
* config/arm/aof.h (ADDITIONAL_REGISTER_NAMES): Add Q0-Q15.
* config/arm/aout.h (ADDITIONAL_REGISTER_NAMES): Add Q0-Q15.
* config/arm/arm-modes.def (EI, OI, CI, XI): New modes.
* config/arm/arm-protos.h (neon_immediate_valid_for_move)
(neon_immediate_valid_for_logic, neon_output_logic_immediate)
(neon_pairwise_reduce, neon_expand_vector_init, neon_reinterpret)
(neon_emit_pair_result_insn, neon_disambiguate_copy)
(neon_vector_mem_operand, neon_struct_mem_operand, output_move_quad)
(output_move_neon): Add prototypes.
* config/arm/arm.c (FL_NEON): New flag for NEON processor capability.
(all_fpus): Add FPUTYPE_NEON.
(fp_model_for_fpu): Add NEON field.
(arm_return_in_memory): Return vectors <= 16 bytes in ARM registers.
(arm_arg_partial_bytes): Allow NEON vectors to be passed partially
in registers.
(arm_legitimate_address_p): Don't support fancy addressing for NEON
structure moves.
(thumb2_legitimate_address_p): Likewise.
(neon_valid_immediate): Recognize and prepare constants suitable for
NEON instructions.
(neon_immediate_valid_for_move): New function. Recognize and prepare
immediates for NEON move instructions.
(neon_immediate_valid_for_logic): New function. Recognize and
prepare immediates for NEON logic instructions.
(neon_output_logic_immediate): New function. Create asm string
suitable for outputting immediate logic instructions.
(neon_pairwise_reduce): New function. Implement reduction using
pairwise operations.
(neon_expand_vector_init): New function. Expand a (possibly
non-constant) vector initialization.
(neon_vector_mem_operand): New function. Memory operands supported
for quad-word loads/stores to/from ARM or NEON registers. Don't
allow base+offset addressing for core regs.
(neon_struct_mem_operand): New function. Valid mems for NEON
structure moves.
(coproc_secondary_reload_class): Enable NEON registers to be loaded
from neon_vector_mem_operand addresses without a secondary register.
(add_minipool_forward_ref): Handle >8-byte minipool entries.
(add_minipool_backward_ref): Likewise.
(dump_minipool): Likewise.
(push_minipool_fix): Likewise.
(output_move_quad): New function. Output quad-word moves, loads and
stores using ARM registers.
(output_move_vfp): Add support for vectors in VFP (NEON) D
registers.
(output_move_neon): Output a NEON load/store to/from a quadword
register.
(arm_print_operand): Implement new codes:
- 'c' for unadorned integers (without a # sign).
- 'J', 'K' for reg+2/reg+3, reg+3/reg+2 in little/big-endian
mode.
- 'e', 'f' for the low and high D parts of a NEON Q register.
- 'q' outputs a NEON Q register.
- 'h' outputs ranges of D registers for VLDM/VSTM etc.
- 'T' prints NEON opcode features from a coded bitmask.
- 'F' is similar to T, but signed/unsigned codes both print as
'i'.
- 't' is similar to T, but 'u' is printed instead of 'p'.
- 'O' prints 'r' if NEON instruction should perform rounding (as
specified by bitmask), else prints nothing.
- '#' is a punctuation character to stop operand numbers from
running together with following digits in the assembler
strings for instructions (when using mode attributes).
(arm_assemble_integer): Handle extra NEON vector modes. Permute
constant vectors in big-endian mode, where necessary.
(arm_hard_regno_mode_ok): Allow vectors in VFP/NEON registers.
Handle EI, OI, CI, XI modes.
(ashlv4hi3, ashlv2si3, lshrv4hi3, lshrv2si3, ashrv4hi3)
(ashrv2si3): Rename IWMMXT2_BUILTINs to...
(ashlv4hi3_iwmmxt, ashlv2si3_iwmmxt, lshrv4hi3_iwmmxt)
(lshrv2si3_iwmmxt, ashrv4hi3_iwmmxt, ashrv2si3_iwmmxt): New names.
(neon_builtin_type_bits): Add enumeration, one bit for each vector
type.
(v8qi_UP, v4hi_UP, v2si_UP, v2sf_UP, di_UP, v16qi_UP, v8hi_UP)
(v4si_UP, v4sf_UP, v2di_UP, ti_UP, ei_UP, oi_UP, UP): Define macros
to turn v8qi, etc. into bits defined above.
(neon_itype): New enumeration. Classifications of NEON builtins.
(neon_builtin_datum): Define struct. Contains information about
a single builtin (with multiple modes).
(CF): Define helper macro for...
(VAR1...VAR10): Define builtins with a type, name and 1-10 different
modes.
(neon_builtin_data): New array. Define information about builtins
for use during initialization/expansion.
(arm_init_neon_builtins): New function.
(arm_init_builtins): Call arm_init_neon_builtins if TARGET_NEON is
true.
(neon_builtin_compare): New function.
(locate_neon_builtin_icode): New function. Find an insn code for a
builtin given a function code for that builtin. Also return type of
builtin (NEON_BINOP, NEON_UNOP etc.).
(builtin_arg): New enumeration. Types of arguments for builtins.
(arm_expand_neon_args): New function. Expand a generic NEON builtin.
Takes a variable argument list of builtin_arg types, terminated by
NEON_ARG_STOP.
(arm_expand_neon_builtin): New function. Expand a NEON builtin.
(neon_reinterpret): New function. Expand NEON reinterpret intrinsic.
(neon_emit_pair_result_insn): New function. Support returning pairs
of vectors via a pointer.
(neon_disambiguate_copy): New function. Set up operands for a
multi-word copy such that registers do not get clobbered.
(arm_expand_builtin): Call arm_expand_neon_builtin if fcode >=
ARM_BUILTIN_NEON_BASE.
(arm_file_start): Set float-abi attribute for NEON.
(arm_vector_mode_supported_p): Enable NEON vector modes.
(arm_mangle_map_entry): New.
(arm_mangle_map): New.
(arm_mangle_vector_type): New.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __ARM_NEON__
when appropriate.
(TARGET_NEON): New macro. Target supports NEON.
(fputype): Add FPUTYPE_NEON.
(UNITS_PER_SIMD_WORD): Define. Allow quad-word registers to be used
for vectorization based on command-line arg.
(NEON_REGNO_OK_FOR_NREGS): Define.
(VALID_NEON_DREG_MODE, VALID_NEON_QREG_MODE)
(VALID_NEON_STRUCT_MODE): Define.
(PRINT_OPERAND_PUNCT_VALID_P): '#' is valid punctuation.
(arm_builtins): Add ARM_BUILTIN_NEON_BASE.
* config/arm/arm.md (VUNSPEC_POOL_16): Insert constant for unspec.
(consttable_16): Add pattern for outputting 16-byte minipool
entries.
(movv2si, movv4hi, movv8qi): Remove blank expanders (redefined in
vec-common.md).
(vec-common.md, neon.md): Include md files.
* config/arm/arm.opt (mvectorize-with-neon-quad): Add option.
* config/arm/constraints.md (constraint "Dn", "Dl", "DL"): Define.
(memory_constraint "Ut", "Un", "Us"): Define.
* config/arm/iwmmxt.md (VMMX, VSHFT): New mode macros.
(MMX_char): New mode attribute.
(addv8qi3, addv4hi3, addv2si3): Remove. Replace with...
(*add<mode>3_iwmmxt): New insn pattern.
(subv8qi3, subv4hi3, subv2si3): Remove. Replace with...
(*sub<mode>3_iwmmxt): New insn pattern.
(mulv4hi3): Rename to...
(*mulv4hi3_iwmmxt): This.
(smaxv8qi3, smaxv4hi3, smaxv2si3, umaxv8qi3, umaxv4hi3)
(umaxv2si3, sminv8qi3, sminv4hi3, sminv2si3, uminv8qi3)
(uminv4hi3, uminv2si3): Remove. Replace with...
(*smax<mode>3_iwmmxt, *umax<mode>3_iwmmxt, *smin<mode>3_iwmmxt)
(*umin<mode>3_iwmmxt): These.
(ashrv4hi3, ashrv2si3, ashrdi3_iwmmxt): Replace with...
(ashr<mode>3_iwmmxt): This new pattern.
(lshrv4hi3, lshrv2si3, lshrdi3_iwmmxt): Replace with...
(lshr<mode>3_iwmmxt): This new pattern.
(ashlv4hi3, ashlv2si3, ashldi3_iwmmxt): Replace with...
(ashl<mode>3_iwmmxt): This new pattern.
* config/arm/neon-docgen.ml: New file. Generate documentation for
intrinsics.
* config/arm/neon-gen.ml: New file. Generate arm_neon.h header.
* config/arm/arm_neon.h: New (autogenerated).
* config/arm/neon-testgen.ml: New file. Generate NEON tests
automatically.
* config/arm/neon.md: New file. Define NEON instructions.
* config/arm/neon.ml: New file. Abstract description of NEON
instructions, used to generate arm_neon.h header, documentation and tests.
* config/arm/t-arm (MD_INCLUDES): Add vec-common.md, neon.md.
* vec-common.md: New file. Shared parts for iWMMXt and NEON vector
support.
* doc/extend.texi (ARM Built-in Functions): Rename and remove
extraneous comma.
(ARM NEON Intrinsics): New subsection.
* doc/arm-neon-intrinsics.texi: New (autogenerated).
gcc/testsuite/
* gcc.dg/vect/vect.exp: Check is-effective-target arm_neon_hw.
* gcc.dg/vect/tree-vect.h: Check for NEON SIMD support.
* lib/gcc-dg.exp (cleanup-saved-temps): Fix comment.
* lib/target-supports.exp (check_effective_target_arm_neon_ok)
(check_effective_target_arm_neon_hw): New.
* gcc.target/arm/neon/neon.exp: New file.
* gcc.target/arm/neon/polytypes.c: New file.
* gcc.target/arm/neon/v*.c (1870 files): New (autogenerated).
Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
Co-Authored-By: Mark Shinwell <shinwell@codesourcery.com>
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r126911
2007-07-25 14:28:31 +02:00
|
|
|
}
|
|
|
|
|
2008-07-02 00:15:47 +02:00
|
|
|
# Return 1 if this is a ARM target with NEON enabled.
|
|
|
|
|
|
|
|
proc check_effective_target_arm_neon { } {
|
|
|
|
if { [check_effective_target_arm32] } {
|
|
|
|
return [check_no_compiler_messages arm_neon object {
|
|
|
|
#ifndef __ARM_NEON__
|
|
|
|
#error not NEON
|
|
|
|
#else
|
|
|
|
int dummy;
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
mips-modes.def: Add V8QI, V4HI and V2SI modes.
2008-06-15 Mark Shinwell <shinwell@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com>
Maxim Kuvyrkov <maxim@codesourcery.com>
Richard Sandiford <rdsandiford@googlemail.com>
* config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes.
* config/mips/mips-protos.h (mips_expand_vector_init): New.
* config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F
builtins.
* config/mips/mips.c (mips_split_doubleword_move): Handle new modes.
(mips_hard_regno_mode_ok_p): Allow 64-bit vector modes for Loongson.
(mips_vector_mode_supported_p): Add V2SImode, V4HImode and
V8QImode cases.
(LOONGSON_BUILTIN, LOONGSON_BUILTIN_ALIAS): New.
(CODE_FOR_loongson_packsswh, CODE_FOR_loongson_packsshb,
(CODE_FOR_loongson_packushb, CODE_FOR_loongson_paddw,
(CODE_FOR_loongson_paddh, CODE_FOR_loongson_paddb,
(CODE_FOR_loongson_paddsh, CODE_FOR_loongson_paddsb)
(CODE_FOR_loongson_paddush, CODE_FOR_loongson_paddusb)
(CODE_FOR_loongson_pmaxsh, CODE_FOR_loongson_pmaxub)
(CODE_FOR_loongson_pminsh, CODE_FOR_loongson_pminub)
(CODE_FOR_loongson_pmulhuh, CODE_FOR_loongson_pmulhh)
(CODE_FOR_loongson_biadd, CODE_FOR_loongson_psubw)
(CODE_FOR_loongson_psubh, CODE_FOR_loongson_psubb)
(CODE_FOR_loongson_psubsh, CODE_FOR_loongson_psubsb)
(CODE_FOR_loongson_psubush, CODE_FOR_loongson_psubusb)
(CODE_FOR_loongson_punpckhbh, CODE_FOR_loongson_punpckhhw)
(CODE_FOR_loongson_punpckhwd, CODE_FOR_loongson_punpcklbh)
(CODE_FOR_loongson_punpcklhw, CODE_FOR_loongson_punpcklwd): New.
(mips_builtins): Add Loongson builtins.
(mips_loongson_2ef_bdesc): New.
(mips_bdesc_arrays): Add mips_loongson_2ef_bdesc.
(mips_builtin_vector_type): Handle unsigned versions of vector modes.
(MIPS_ATYPE_UQI, MIPS_ATYPE_UDI, MIPS_ATYPE_V2SI, MIPS_ATYPE_UV2SI)
(MIPS_ATYPE_V4HI, MIPS_ATYPE_UV4HI, MIPS_ATYPE_V8QI, MIPS_ATYPE_UV8QI):
New.
(mips_expand_vector_init): New.
* config/mips/mips.h (HAVE_LOONGSON_VECTOR_MODES): New.
(TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_vector_rev
if appropriate.
* config/mips/mips.md: Add unspec numbers for Loongson
builtins. Include loongson.md.
(MOVE64): Include Loongson vector modes.
(SPLITF): Include Loongson vector modes.
(HALFMODE): Handle Loongson vector modes.
* config/mips/loongson.md: New.
* config/mips/loongson.h: New.
* config.gcc: Add loongson.h header for mips*-*-* targets.
* doc/extend.texi (MIPS Loongson Built-in Functions): New.
2008-06-15 Mark Shinwell <shinwell@codesourcery.com>
* lib/target-supports.exp (check_effective_target_mips_loongson): New.
* gcc.target/mips/loongson-simd.c: New.
Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com>
Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com>
From-SVN: r136800
2008-06-15 08:29:06 +02:00
|
|
|
# Return 1 if this a Loongson-2E or -2F target using an ABI that supports
|
|
|
|
# the Loongson vector modes.
|
|
|
|
|
|
|
|
proc check_effective_target_mips_loongson { } {
|
|
|
|
return [check_no_compiler_messages loongson assembly {
|
|
|
|
#if !defined(__mips_loongson_vector_rev)
|
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
arm.c (arm_builtin_va_list): New function.
2009-02-20 Mark Mitchell <mark@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
* config/arm/arm.c (arm_builtin_va_list): New function.
(arm_expand_builtin_va_start): Likewise.
(arm_gimplify_va_arg_expr): Likewise.
(TARGET_BUILD_BUILTIN_VA_LIST): Define.
(TARGET_BUILD_BUILTIN_VA_START): Likewise.
(TARGET_BUILD_BUILTIN_VA_ARG_EXPR): Likewise.
(va_list_type): New variable.
(arm_mangle_type): Mangle va_list_type appropriately.
testsuite:
* gcc.target/arm/va_list.c: New test.
* g++.dg/abi/arm_va_list.C: Likewise.
* lib/target-supports.exp (check_effective_target_arm_eabi): New
function.
* g++.dg/cpp0x/temp-va-arg-bug.C, g++.dg/other/stdarg1.C,
g++.dg/warn/miss-format-1.C, g++.dg/warn/miss-format-3.C,
g++.dg/warn/miss-format-4.C, g++.dg/warn/miss-format-5.C,
g++.dg/warn/miss-format-6.C, g++.old-deja/g++.other/vaarg2.C,
g++.old-deja/g++.other/vaarg3.C, g++.old-deja/g++.other/vaarg4.C,
g++.old-deja/g++.pt/builtin.C: Use -Wno-abi on ARM EABI targets.
Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
From-SVN: r144323
2009-02-20 16:19:38 +01:00
|
|
|
# Return 1 if this is an ARM target that adheres to the ABI for the ARM
|
|
|
|
# Architecture.
|
|
|
|
|
|
|
|
proc check_effective_target_arm_eabi { } {
|
|
|
|
return [check_no_compiler_messages arm_eabi object {
|
|
|
|
#ifndef __ARM_EABI__
|
|
|
|
#error not EABI
|
|
|
|
#else
|
|
|
|
int dummy;
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
target-supports.exp (check_effective_target_powerpc_fprs, [...]): New.
* lib/target-supports.exp (check_effective_target_powerpc_fprs,
check_effective_target_powerpc_altivec_ok): New.
* g++.dg/eh/simd-2.C, g++.dg/ext/altivec-1.C,
g++.dg/ext/altivec-10.C, g++.dg/ext/altivec-11.C,
g++.dg/ext/altivec-12.C, g++.dg/ext/altivec-13.C,
g++.dg/ext/altivec-2.C, g++.dg/ext/altivec-3.C,
g++.dg/ext/altivec-4.C, g++.dg/ext/altivec-5.C,
g++.dg/ext/altivec-6.C, g++.dg/ext/altivec-7.C,
g++.dg/ext/altivec-8.C, g++.dg/ext/altivec-9.C,
g++.dg/ext/altivec-types-1.C, g++.dg/ext/altivec-types-2.C,
g++.dg/ext/altivec-types-3.C, g++.dg/ext/altivec-types-4.C,
gcc.dg/dfp/altivec-types.c, gcc.dg/simd-3.c,
gcc.dg/vect/vect-82_64.c, gcc.dg/vect/vect-83_64.c,
gcc.dg/vmx/vmx.exp, gcc.target/powerpc/980827-1.c,
gcc.target/powerpc/altivec-1.c, gcc.target/powerpc/altivec-10.c,
gcc.target/powerpc/altivec-11.c, gcc.target/powerpc/altivec-12.c,
gcc.target/powerpc/altivec-13.c, gcc.target/powerpc/altivec-14.c,
gcc.target/powerpc/altivec-15.c, gcc.target/powerpc/altivec-16.c,
gcc.target/powerpc/altivec-17.c, gcc.target/powerpc/altivec-18.c,
gcc.target/powerpc/altivec-19.c, gcc.target/powerpc/altivec-2.c,
gcc.target/powerpc/altivec-21.c, gcc.target/powerpc/altivec-22.c,
gcc.target/powerpc/altivec-3.c, gcc.target/powerpc/altivec-4.c,
gcc.target/powerpc/altivec-5.c, gcc.target/powerpc/altivec-6.c,
gcc.target/powerpc/altivec-7.c, gcc.target/powerpc/altivec-8.c,
gcc.target/powerpc/altivec-9.c,
gcc.target/powerpc/altivec-consts.c,
gcc.target/powerpc/altivec-pr22085.c,
gcc.target/powerpc/altivec-splat.c,
gcc.target/powerpc/altivec-types-1.c,
gcc.target/powerpc/altivec-types-2.c,
gcc.target/powerpc/altivec-types-3.c,
gcc.target/powerpc/altivec-types-4.c,
gcc.target/powerpc/altivec-varargs-1.c,
gcc.target/powerpc/altivec-vec-merge.c,
gcc.target/powerpc/ppc-vector-memcpy.c,
gcc.target/powerpc/ppc-vector-memset.c,
gcc.target/powerpc/ppc64-abi-2.c, gcc.target/powerpc/pr16155.c,
gcc.target/powerpc/pr16286.c, gcc.target/powerpc/pr27158.c: Use
these effective targets.
* gcc.dg/vmx/pr27006.c: Add missing close brace.
* gcc.dg/20020103-1.c: XFAIL on powerpc*-*-*.
From-SVN: r113709
2006-05-11 21:56:21 +02:00
|
|
|
# Return 1 if this is a PowerPC target with floating-point registers.
|
|
|
|
|
|
|
|
proc check_effective_target_powerpc_fprs { } {
|
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [istarget rs6000-*-*] } {
|
|
|
|
return [check_no_compiler_messages powerpc_fprs object {
|
|
|
|
#ifdef __NO_FPRS__
|
|
|
|
#error no FPRs
|
|
|
|
#else
|
|
|
|
int dummy;
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-18 23:14:28 +02:00
|
|
|
# Return 1 if this is a PowerPC target with hardware double-precision
|
|
|
|
# floating point.
|
|
|
|
|
|
|
|
proc check_effective_target_powerpc_hard_double { } {
|
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [istarget rs6000-*-*] } {
|
|
|
|
return [check_no_compiler_messages powerpc_hard_double object {
|
|
|
|
#ifdef _SOFT_DOUBLE
|
|
|
|
#error soft double
|
|
|
|
#else
|
|
|
|
int dummy;
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
target-supports.exp (check_effective_target_powerpc_fprs, [...]): New.
* lib/target-supports.exp (check_effective_target_powerpc_fprs,
check_effective_target_powerpc_altivec_ok): New.
* g++.dg/eh/simd-2.C, g++.dg/ext/altivec-1.C,
g++.dg/ext/altivec-10.C, g++.dg/ext/altivec-11.C,
g++.dg/ext/altivec-12.C, g++.dg/ext/altivec-13.C,
g++.dg/ext/altivec-2.C, g++.dg/ext/altivec-3.C,
g++.dg/ext/altivec-4.C, g++.dg/ext/altivec-5.C,
g++.dg/ext/altivec-6.C, g++.dg/ext/altivec-7.C,
g++.dg/ext/altivec-8.C, g++.dg/ext/altivec-9.C,
g++.dg/ext/altivec-types-1.C, g++.dg/ext/altivec-types-2.C,
g++.dg/ext/altivec-types-3.C, g++.dg/ext/altivec-types-4.C,
gcc.dg/dfp/altivec-types.c, gcc.dg/simd-3.c,
gcc.dg/vect/vect-82_64.c, gcc.dg/vect/vect-83_64.c,
gcc.dg/vmx/vmx.exp, gcc.target/powerpc/980827-1.c,
gcc.target/powerpc/altivec-1.c, gcc.target/powerpc/altivec-10.c,
gcc.target/powerpc/altivec-11.c, gcc.target/powerpc/altivec-12.c,
gcc.target/powerpc/altivec-13.c, gcc.target/powerpc/altivec-14.c,
gcc.target/powerpc/altivec-15.c, gcc.target/powerpc/altivec-16.c,
gcc.target/powerpc/altivec-17.c, gcc.target/powerpc/altivec-18.c,
gcc.target/powerpc/altivec-19.c, gcc.target/powerpc/altivec-2.c,
gcc.target/powerpc/altivec-21.c, gcc.target/powerpc/altivec-22.c,
gcc.target/powerpc/altivec-3.c, gcc.target/powerpc/altivec-4.c,
gcc.target/powerpc/altivec-5.c, gcc.target/powerpc/altivec-6.c,
gcc.target/powerpc/altivec-7.c, gcc.target/powerpc/altivec-8.c,
gcc.target/powerpc/altivec-9.c,
gcc.target/powerpc/altivec-consts.c,
gcc.target/powerpc/altivec-pr22085.c,
gcc.target/powerpc/altivec-splat.c,
gcc.target/powerpc/altivec-types-1.c,
gcc.target/powerpc/altivec-types-2.c,
gcc.target/powerpc/altivec-types-3.c,
gcc.target/powerpc/altivec-types-4.c,
gcc.target/powerpc/altivec-varargs-1.c,
gcc.target/powerpc/altivec-vec-merge.c,
gcc.target/powerpc/ppc-vector-memcpy.c,
gcc.target/powerpc/ppc-vector-memset.c,
gcc.target/powerpc/ppc64-abi-2.c, gcc.target/powerpc/pr16155.c,
gcc.target/powerpc/pr16286.c, gcc.target/powerpc/pr27158.c: Use
these effective targets.
* gcc.dg/vmx/pr27006.c: Add missing close brace.
* gcc.dg/20020103-1.c: XFAIL on powerpc*-*-*.
From-SVN: r113709
2006-05-11 21:56:21 +02:00
|
|
|
# Return 1 if this is a PowerPC target supporting -maltivec.
|
|
|
|
|
|
|
|
proc check_effective_target_powerpc_altivec_ok { } {
|
2007-10-31 18:04:42 +01:00
|
|
|
if { ([istarget powerpc*-*-*]
|
|
|
|
&& ![istarget powerpc-*-linux*paired*])
|
target-supports.exp (check_effective_target_powerpc_fprs, [...]): New.
* lib/target-supports.exp (check_effective_target_powerpc_fprs,
check_effective_target_powerpc_altivec_ok): New.
* g++.dg/eh/simd-2.C, g++.dg/ext/altivec-1.C,
g++.dg/ext/altivec-10.C, g++.dg/ext/altivec-11.C,
g++.dg/ext/altivec-12.C, g++.dg/ext/altivec-13.C,
g++.dg/ext/altivec-2.C, g++.dg/ext/altivec-3.C,
g++.dg/ext/altivec-4.C, g++.dg/ext/altivec-5.C,
g++.dg/ext/altivec-6.C, g++.dg/ext/altivec-7.C,
g++.dg/ext/altivec-8.C, g++.dg/ext/altivec-9.C,
g++.dg/ext/altivec-types-1.C, g++.dg/ext/altivec-types-2.C,
g++.dg/ext/altivec-types-3.C, g++.dg/ext/altivec-types-4.C,
gcc.dg/dfp/altivec-types.c, gcc.dg/simd-3.c,
gcc.dg/vect/vect-82_64.c, gcc.dg/vect/vect-83_64.c,
gcc.dg/vmx/vmx.exp, gcc.target/powerpc/980827-1.c,
gcc.target/powerpc/altivec-1.c, gcc.target/powerpc/altivec-10.c,
gcc.target/powerpc/altivec-11.c, gcc.target/powerpc/altivec-12.c,
gcc.target/powerpc/altivec-13.c, gcc.target/powerpc/altivec-14.c,
gcc.target/powerpc/altivec-15.c, gcc.target/powerpc/altivec-16.c,
gcc.target/powerpc/altivec-17.c, gcc.target/powerpc/altivec-18.c,
gcc.target/powerpc/altivec-19.c, gcc.target/powerpc/altivec-2.c,
gcc.target/powerpc/altivec-21.c, gcc.target/powerpc/altivec-22.c,
gcc.target/powerpc/altivec-3.c, gcc.target/powerpc/altivec-4.c,
gcc.target/powerpc/altivec-5.c, gcc.target/powerpc/altivec-6.c,
gcc.target/powerpc/altivec-7.c, gcc.target/powerpc/altivec-8.c,
gcc.target/powerpc/altivec-9.c,
gcc.target/powerpc/altivec-consts.c,
gcc.target/powerpc/altivec-pr22085.c,
gcc.target/powerpc/altivec-splat.c,
gcc.target/powerpc/altivec-types-1.c,
gcc.target/powerpc/altivec-types-2.c,
gcc.target/powerpc/altivec-types-3.c,
gcc.target/powerpc/altivec-types-4.c,
gcc.target/powerpc/altivec-varargs-1.c,
gcc.target/powerpc/altivec-vec-merge.c,
gcc.target/powerpc/ppc-vector-memcpy.c,
gcc.target/powerpc/ppc-vector-memset.c,
gcc.target/powerpc/ppc64-abi-2.c, gcc.target/powerpc/pr16155.c,
gcc.target/powerpc/pr16286.c, gcc.target/powerpc/pr27158.c: Use
these effective targets.
* gcc.dg/vmx/pr27006.c: Add missing close brace.
* gcc.dg/20020103-1.c: XFAIL on powerpc*-*-*.
From-SVN: r113709
2006-05-11 21:56:21 +02:00
|
|
|
|| [istarget rs6000-*-*] } {
|
2007-10-15 17:00:49 +02:00
|
|
|
# AltiVec is not supported on AIX before 5.3.
|
|
|
|
if { [istarget powerpc*-*-aix4*]
|
|
|
|
|| [istarget powerpc*-*-aix5.1*]
|
|
|
|
|| [istarget powerpc*-*-aix5.2*] } {
|
target-supports.exp (check_effective_target_powerpc_fprs, [...]): New.
* lib/target-supports.exp (check_effective_target_powerpc_fprs,
check_effective_target_powerpc_altivec_ok): New.
* g++.dg/eh/simd-2.C, g++.dg/ext/altivec-1.C,
g++.dg/ext/altivec-10.C, g++.dg/ext/altivec-11.C,
g++.dg/ext/altivec-12.C, g++.dg/ext/altivec-13.C,
g++.dg/ext/altivec-2.C, g++.dg/ext/altivec-3.C,
g++.dg/ext/altivec-4.C, g++.dg/ext/altivec-5.C,
g++.dg/ext/altivec-6.C, g++.dg/ext/altivec-7.C,
g++.dg/ext/altivec-8.C, g++.dg/ext/altivec-9.C,
g++.dg/ext/altivec-types-1.C, g++.dg/ext/altivec-types-2.C,
g++.dg/ext/altivec-types-3.C, g++.dg/ext/altivec-types-4.C,
gcc.dg/dfp/altivec-types.c, gcc.dg/simd-3.c,
gcc.dg/vect/vect-82_64.c, gcc.dg/vect/vect-83_64.c,
gcc.dg/vmx/vmx.exp, gcc.target/powerpc/980827-1.c,
gcc.target/powerpc/altivec-1.c, gcc.target/powerpc/altivec-10.c,
gcc.target/powerpc/altivec-11.c, gcc.target/powerpc/altivec-12.c,
gcc.target/powerpc/altivec-13.c, gcc.target/powerpc/altivec-14.c,
gcc.target/powerpc/altivec-15.c, gcc.target/powerpc/altivec-16.c,
gcc.target/powerpc/altivec-17.c, gcc.target/powerpc/altivec-18.c,
gcc.target/powerpc/altivec-19.c, gcc.target/powerpc/altivec-2.c,
gcc.target/powerpc/altivec-21.c, gcc.target/powerpc/altivec-22.c,
gcc.target/powerpc/altivec-3.c, gcc.target/powerpc/altivec-4.c,
gcc.target/powerpc/altivec-5.c, gcc.target/powerpc/altivec-6.c,
gcc.target/powerpc/altivec-7.c, gcc.target/powerpc/altivec-8.c,
gcc.target/powerpc/altivec-9.c,
gcc.target/powerpc/altivec-consts.c,
gcc.target/powerpc/altivec-pr22085.c,
gcc.target/powerpc/altivec-splat.c,
gcc.target/powerpc/altivec-types-1.c,
gcc.target/powerpc/altivec-types-2.c,
gcc.target/powerpc/altivec-types-3.c,
gcc.target/powerpc/altivec-types-4.c,
gcc.target/powerpc/altivec-varargs-1.c,
gcc.target/powerpc/altivec-vec-merge.c,
gcc.target/powerpc/ppc-vector-memcpy.c,
gcc.target/powerpc/ppc-vector-memset.c,
gcc.target/powerpc/ppc64-abi-2.c, gcc.target/powerpc/pr16155.c,
gcc.target/powerpc/pr16286.c, gcc.target/powerpc/pr27158.c: Use
these effective targets.
* gcc.dg/vmx/pr27006.c: Add missing close brace.
* gcc.dg/20020103-1.c: XFAIL on powerpc*-*-*.
From-SVN: r113709
2006-05-11 21:56:21 +02:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
return [check_no_compiler_messages powerpc_altivec_ok object {
|
|
|
|
int dummy;
|
|
|
|
} "-maltivec"]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-03 22:59:36 +01:00
|
|
|
# Return 1 if this is a PowerPC target supporting -mcpu=cell.
|
|
|
|
|
|
|
|
proc check_effective_target_powerpc_ppu_ok { } {
|
|
|
|
if [check_effective_target_powerpc_altivec_ok] {
|
|
|
|
return [check_no_compiler_messages cell_asm_available object {
|
|
|
|
int main (void) {
|
|
|
|
#ifdef __MACH__
|
|
|
|
asm volatile ("lvlx v0,v0,v0");
|
|
|
|
#else
|
|
|
|
asm volatile ("lvlx 0,0,0");
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-07 22:05:03 +01:00
|
|
|
# Return 1 if this is a PowerPC target that supports SPU.
|
|
|
|
|
|
|
|
proc check_effective_target_powerpc_spu { } {
|
2008-06-05 01:20:01 +02:00
|
|
|
if [istarget powerpc*-*-linux*] {
|
|
|
|
return [check_effective_target_powerpc_altivec_ok]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
2008-01-07 22:05:03 +01:00
|
|
|
}
|
|
|
|
|
2009-01-14 18:58:13 +01:00
|
|
|
# Return 1 if this is a PowerPC SPE target. The check includes options
|
|
|
|
# specified by dg-options for this test, so don't cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_powerpc_spe_nocache { } {
|
|
|
|
if { [istarget powerpc*-*-*] } {
|
|
|
|
return [check_no_compiler_messages_nocache powerpc_spe object {
|
|
|
|
#ifndef __SPE__
|
|
|
|
#error not SPE
|
|
|
|
#else
|
|
|
|
int dummy;
|
|
|
|
#endif
|
|
|
|
} [current_compiler_flags]]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-01-01 13:56:08 +01:00
|
|
|
# Return 1 if this is a PowerPC target with SPE enabled.
|
|
|
|
|
|
|
|
proc check_effective_target_powerpc_spe { } {
|
|
|
|
if { [istarget powerpc*-*-*] } {
|
|
|
|
return [check_no_compiler_messages powerpc_spe object {
|
|
|
|
#ifndef __SPE__
|
|
|
|
#error not SPE
|
|
|
|
#else
|
|
|
|
int dummy;
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-01-27 00:53:28 +01:00
|
|
|
# Return 1 if this is a PowerPC target with Altivec enabled.
|
|
|
|
|
|
|
|
proc check_effective_target_powerpc_altivec { } {
|
|
|
|
if { [istarget powerpc*-*-*] } {
|
|
|
|
return [check_no_compiler_messages powerpc_altivec object {
|
|
|
|
#ifndef __ALTIVEC__
|
|
|
|
#error not Altivec
|
|
|
|
#else
|
|
|
|
int dummy;
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-11 20:51:53 +01:00
|
|
|
# Return 1 if this is a PowerPC 405 target. The check includes options
|
|
|
|
# specified by dg-options for this test, so don't cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_powerpc_405_nocache { } {
|
|
|
|
if { [istarget powerpc*-*-*] || [istarget rs6000-*-*] } {
|
|
|
|
return [check_no_compiler_messages_nocache powerpc_405 object {
|
|
|
|
#ifdef __PPC405__
|
|
|
|
int dummy;
|
|
|
|
#else
|
|
|
|
#error not a PPC405
|
|
|
|
#endif
|
|
|
|
} [current_compiler_flags]]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-22 19:21:12 +02:00
|
|
|
# Return 1 if this is a SPU target with a toolchain that
|
|
|
|
# supports automatic overlay generation.
|
|
|
|
|
|
|
|
proc check_effective_target_spu_auto_overlay { } {
|
|
|
|
if { [istarget spu*-*-elf*] } {
|
|
|
|
return [check_no_compiler_messages spu_auto_overlay executable {
|
|
|
|
int main (void) { }
|
|
|
|
} "-Wl,--auto-overlay" ]
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-12 16:29:23 +02:00
|
|
|
# The VxWorks SPARC simulator accepts only EM_SPARC executables and
|
|
|
|
# chokes on EM_SPARC32PLUS or EM_SPARCV9 executables. Return 1 if the
|
|
|
|
# test environment appears to run executables on such a simulator.
|
|
|
|
|
|
|
|
proc check_effective_target_ultrasparc_hw { } {
|
2007-12-04 11:16:17 +01:00
|
|
|
return [check_runtime ultrasparc_hw {
|
|
|
|
int main() { return 0; }
|
|
|
|
} "-mcpu=ultrasparc"]
|
2007-07-12 16:29:23 +02:00
|
|
|
}
|
|
|
|
|
2005-04-05 18:33:29 +02:00
|
|
|
# Return 1 if the target supports hardware vector shift operation.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_shift { } {
|
2005-10-03 07:24:08 +02:00
|
|
|
global et_vect_shift_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_shift_saved] {
|
|
|
|
verbose "check_effective_target_vect_shift: using cached result" 2
|
2005-04-05 18:33:29 +02:00
|
|
|
} else {
|
2005-10-03 07:24:08 +02:00
|
|
|
set et_vect_shift_saved 0
|
2007-10-31 18:04:42 +01:00
|
|
|
if { ([istarget powerpc*-*-*]
|
|
|
|
&& ![istarget powerpc-*-linux*paired*])
|
2005-10-03 07:24:08 +02:00
|
|
|
|| [istarget ia64-*-*]
|
|
|
|
|| [istarget i?86-*-*]
|
2008-07-02 00:15:47 +02:00
|
|
|
|| [istarget x86_64-*-*]
|
|
|
|
|| [check_effective_target_arm32] } {
|
2005-10-03 07:24:08 +02:00
|
|
|
set et_vect_shift_saved 1
|
|
|
|
}
|
2005-04-05 18:33:29 +02:00
|
|
|
}
|
|
|
|
|
2005-10-03 07:24:08 +02:00
|
|
|
verbose "check_effective_target_vect_shift: returning $et_vect_shift_saved" 2
|
|
|
|
return $et_vect_shift_saved
|
2005-04-05 18:33:29 +02:00
|
|
|
}
|
|
|
|
|
pr18425.c: Use effective target vect_long.
* gcc.dg/vect/pr18425.c: Use effective target vect_long.
* gcc.dg/vect/vect-13.c, gcc.dg/vect/vect-17.c, gcc.dg/vect/vect-18.c,
gcc.dg/vect/vect-19.c, gcc.dg/vect/vect-20.c, gcc.dg/vect/vect-48a.c,
gcc.dg/vect/vect-56a.c, gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-77.c,
gcc.dg/vect/vect-77a.c, gcc.dg/vect/vect-78.c, gcc.dg/vect/vect-86.c,
gcc.dg/vect/vect-87.c, gcc.dg/vect/vect-88.c: XFAIL for alpha.
* gcc.dg/vect/vect.exp: Add check for alpha.
* lib/target-supports.exp (check_alpha_max_hw_available): New.
(check_effective_target_vect_int): Enable for alpha.
(check_effective_target_vect_long): New.
(is-effective-target): Add it.
From-SVN: r91105
2004-11-23 23:03:31 +01:00
|
|
|
# Return 1 if the target supports hardware vectors of long, 0 otherwise.
|
|
|
|
#
|
2004-11-30 22:19:49 +01:00
|
|
|
# This can change for different subtargets so do not cache the result.
|
pr18425.c: Use effective target vect_long.
* gcc.dg/vect/pr18425.c: Use effective target vect_long.
* gcc.dg/vect/vect-13.c, gcc.dg/vect/vect-17.c, gcc.dg/vect/vect-18.c,
gcc.dg/vect/vect-19.c, gcc.dg/vect/vect-20.c, gcc.dg/vect/vect-48a.c,
gcc.dg/vect/vect-56a.c, gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-77.c,
gcc.dg/vect/vect-77a.c, gcc.dg/vect/vect-78.c, gcc.dg/vect/vect-86.c,
gcc.dg/vect/vect-87.c, gcc.dg/vect/vect-88.c: XFAIL for alpha.
* gcc.dg/vect/vect.exp: Add check for alpha.
* lib/target-supports.exp (check_alpha_max_hw_available): New.
(check_effective_target_vect_int): Enable for alpha.
(check_effective_target_vect_long): New.
(is-effective-target): Add it.
From-SVN: r91105
2004-11-23 23:03:31 +01:00
|
|
|
|
|
|
|
proc check_effective_target_vect_long { } {
|
2004-11-30 22:19:49 +01:00
|
|
|
if { [istarget i?86-*-*]
|
2007-10-31 18:04:42 +01:00
|
|
|
|| (([istarget powerpc*-*-*]
|
|
|
|
&& ![istarget powerpc-*-linux*paired*])
|
|
|
|
&& [check_effective_target_ilp32])
|
2004-11-30 22:19:49 +01:00
|
|
|
|| [istarget x86_64-*-*]
|
2008-07-02 00:15:47 +02:00
|
|
|
|| [check_effective_target_arm32]
|
2004-11-30 22:19:49 +01:00
|
|
|
|| ([istarget sparc*-*-*] && [check_effective_target_ilp32]) } {
|
|
|
|
set answer 1
|
pr18425.c: Use effective target vect_long.
* gcc.dg/vect/pr18425.c: Use effective target vect_long.
* gcc.dg/vect/vect-13.c, gcc.dg/vect/vect-17.c, gcc.dg/vect/vect-18.c,
gcc.dg/vect/vect-19.c, gcc.dg/vect/vect-20.c, gcc.dg/vect/vect-48a.c,
gcc.dg/vect/vect-56a.c, gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-77.c,
gcc.dg/vect/vect-77a.c, gcc.dg/vect/vect-78.c, gcc.dg/vect/vect-86.c,
gcc.dg/vect/vect-87.c, gcc.dg/vect/vect-88.c: XFAIL for alpha.
* gcc.dg/vect/vect.exp: Add check for alpha.
* lib/target-supports.exp (check_alpha_max_hw_available): New.
(check_effective_target_vect_int): Enable for alpha.
(check_effective_target_vect_long): New.
(is-effective-target): Add it.
From-SVN: r91105
2004-11-23 23:03:31 +01:00
|
|
|
} else {
|
2004-11-30 22:19:49 +01:00
|
|
|
set answer 0
|
pr18425.c: Use effective target vect_long.
* gcc.dg/vect/pr18425.c: Use effective target vect_long.
* gcc.dg/vect/vect-13.c, gcc.dg/vect/vect-17.c, gcc.dg/vect/vect-18.c,
gcc.dg/vect/vect-19.c, gcc.dg/vect/vect-20.c, gcc.dg/vect/vect-48a.c,
gcc.dg/vect/vect-56a.c, gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-77.c,
gcc.dg/vect/vect-77a.c, gcc.dg/vect/vect-78.c, gcc.dg/vect/vect-86.c,
gcc.dg/vect/vect-87.c, gcc.dg/vect/vect-88.c: XFAIL for alpha.
* gcc.dg/vect/vect.exp: Add check for alpha.
* lib/target-supports.exp (check_alpha_max_hw_available): New.
(check_effective_target_vect_int): Enable for alpha.
(check_effective_target_vect_long): New.
(is-effective-target): Add it.
From-SVN: r91105
2004-11-23 23:03:31 +01:00
|
|
|
}
|
|
|
|
|
2004-11-30 22:19:49 +01:00
|
|
|
verbose "check_effective_target_vect_long: returning $answer" 2
|
|
|
|
return $answer
|
pr18425.c: Use effective target vect_long.
* gcc.dg/vect/pr18425.c: Use effective target vect_long.
* gcc.dg/vect/vect-13.c, gcc.dg/vect/vect-17.c, gcc.dg/vect/vect-18.c,
gcc.dg/vect/vect-19.c, gcc.dg/vect/vect-20.c, gcc.dg/vect/vect-48a.c,
gcc.dg/vect/vect-56a.c, gcc.dg/vect/vect-7.c, gcc.dg/vect/vect-77.c,
gcc.dg/vect/vect-77a.c, gcc.dg/vect/vect-78.c, gcc.dg/vect/vect-86.c,
gcc.dg/vect/vect-87.c, gcc.dg/vect/vect-88.c: XFAIL for alpha.
* gcc.dg/vect/vect.exp: Add check for alpha.
* lib/target-supports.exp (check_alpha_max_hw_available): New.
(check_effective_target_vect_int): Enable for alpha.
(check_effective_target_vect_long): New.
(is-effective-target): Add it.
From-SVN: r91105
2004-11-23 23:03:31 +01:00
|
|
|
}
|
|
|
|
|
2004-11-18 00:47:21 +01:00
|
|
|
# Return 1 if the target supports hardware vectors of float, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_float { } {
|
|
|
|
global et_vect_float_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_float_saved] {
|
|
|
|
verbose "check_effective_target_vect_float: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_float_saved 0
|
|
|
|
if { [istarget i?86-*-*]
|
|
|
|
|| [istarget powerpc*-*-*]
|
2006-12-03 21:05:31 +01:00
|
|
|
|| [istarget spu-*-*]
|
2004-11-18 00:47:21 +01:00
|
|
|
|| [istarget mipsisa64*-*-*]
|
2005-01-03 20:59:13 +01:00
|
|
|
|| [istarget x86_64-*-*]
|
2008-07-02 00:15:47 +02:00
|
|
|
|| [istarget ia64-*-*]
|
|
|
|
|| [check_effective_target_arm32] } {
|
2004-11-18 00:47:21 +01:00
|
|
|
set et_vect_float_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_float: returning $et_vect_float_saved" 2
|
|
|
|
return $et_vect_float_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target supports hardware vectors of double, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_double { } {
|
|
|
|
global et_vect_double_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_double_saved] {
|
|
|
|
verbose "check_effective_target_vect_double: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_double_saved 0
|
|
|
|
if { [istarget i?86-*-*]
|
2006-12-03 21:05:31 +01:00
|
|
|
|| [istarget x86_64-*-*]
|
|
|
|
|| [istarget spu-*-*] } {
|
2004-11-18 00:47:21 +01:00
|
|
|
set et_vect_double_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_double: returning $et_vect_double_saved" 2
|
|
|
|
return $et_vect_double_saved
|
|
|
|
}
|
|
|
|
|
2008-08-19 10:31:41 +02:00
|
|
|
# Return 1 if the target supports hardware vectors of long long, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_long_long { } {
|
|
|
|
global et_vect_long_long_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_long_long_saved] {
|
|
|
|
verbose "check_effective_target_vect_long_long: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_long_long_saved 0
|
|
|
|
if { [istarget i?86-*-*]
|
2008-08-20 14:05:38 +02:00
|
|
|
|| [istarget x86_64-*-*] } {
|
2008-08-19 10:31:41 +02:00
|
|
|
set et_vect_long_long_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_long_long: returning $et_vect_long_long_saved" 2
|
|
|
|
return $et_vect_long_long_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-12-21 19:03:31 +01:00
|
|
|
# Return 1 if the target plus current options does not support a vector
|
2005-06-29 20:25:12 +02:00
|
|
|
# max instruction on "int", 0 otherwise.
|
2004-12-21 19:03:31 +01:00
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
2005-06-29 20:25:12 +02:00
|
|
|
proc check_effective_target_vect_no_int_max { } {
|
|
|
|
global et_vect_no_int_max_saved
|
2004-12-21 19:03:31 +01:00
|
|
|
|
2005-06-29 20:25:12 +02:00
|
|
|
if [info exists et_vect_no_int_max_saved] {
|
|
|
|
verbose "check_effective_target_vect_no_int_max: using cached result" 2
|
2004-12-21 19:03:31 +01:00
|
|
|
} else {
|
2005-06-29 20:25:12 +02:00
|
|
|
set et_vect_no_int_max_saved 0
|
2005-06-29 19:27:23 +02:00
|
|
|
if { [istarget sparc*-*-*]
|
2006-12-03 21:05:31 +01:00
|
|
|
|| [istarget spu-*-*]
|
2004-12-21 19:03:31 +01:00
|
|
|
|| [istarget alpha*-*-*] } {
|
2005-06-29 20:25:12 +02:00
|
|
|
set et_vect_no_int_max_saved 1
|
2004-12-21 19:03:31 +01:00
|
|
|
}
|
|
|
|
}
|
2005-06-29 20:25:12 +02:00
|
|
|
verbose "check_effective_target_vect_no_int_max: returning $et_vect_no_int_max_saved" 2
|
|
|
|
return $et_vect_no_int_max_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target plus current options does not support a vector
|
|
|
|
# add instruction on "int", 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_no_int_add { } {
|
|
|
|
global et_vect_no_int_add_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_no_int_add_saved] {
|
|
|
|
verbose "check_effective_target_vect_no_int_add: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_no_int_add_saved 0
|
|
|
|
# Alpha only supports vector add on V8QI and V4HI.
|
|
|
|
if { [istarget alpha*-*-*] } {
|
|
|
|
set et_vect_no_int_add_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_no_int_add: returning $et_vect_no_int_add_saved" 2
|
|
|
|
return $et_vect_no_int_add_saved
|
2004-12-21 19:03:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target plus current options does not support vector
|
|
|
|
# bitwise instructions, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_no_bitwise { } {
|
|
|
|
global et_vect_no_bitwise_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_no_bitwise_saved] {
|
|
|
|
verbose "check_effective_target_vect_no_bitwise: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_no_bitwise_saved 0
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_no_bitwise: returning $et_vect_no_bitwise_saved" 2
|
|
|
|
return $et_vect_no_bitwise_saved
|
|
|
|
}
|
|
|
|
|
2008-08-28 13:11:14 +02:00
|
|
|
# Return 1 if the target plus current options supports vector permutation,
|
|
|
|
# 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_perm { } {
|
|
|
|
global et_vect_perm
|
|
|
|
|
|
|
|
if [info exists et_vect_perm_saved] {
|
|
|
|
verbose "check_effective_target_vect_perm: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_perm_saved 0
|
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [istarget spu-*-*] } {
|
|
|
|
set et_vect_perm_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_perm: returning $et_vect_perm_saved" 2
|
|
|
|
return $et_vect_perm_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-02-16 10:59:00 +01:00
|
|
|
# Return 1 if the target plus current options supports a vector
|
|
|
|
# widening summation of *short* args into *int* result, 0 otherwise.
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
# A target can also support this widening summation if it can support
|
|
|
|
# promotion (unpacking) from shorts to ints.
|
2006-02-16 10:59:00 +01:00
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_widen_sum_hi_to_si { } {
|
|
|
|
global et_vect_widen_sum_hi_to_si
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
|
2006-02-16 10:59:00 +01:00
|
|
|
if [info exists et_vect_widen_sum_hi_to_si_saved] {
|
|
|
|
verbose "check_effective_target_vect_widen_sum_hi_to_si: using cached result" 2
|
|
|
|
} else {
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
set et_vect_widen_sum_hi_to_si_saved [check_effective_target_vect_unpack]
|
2007-05-01 08:58:59 +02:00
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [istarget ia64-*-*] } {
|
2006-02-16 10:59:00 +01:00
|
|
|
set et_vect_widen_sum_hi_to_si_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_widen_sum_hi_to_si: returning $et_vect_widen_sum_hi_to_si_saved" 2
|
|
|
|
return $et_vect_widen_sum_hi_to_si_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target plus current options supports a vector
|
|
|
|
# widening summation of *char* args into *short* result, 0 otherwise.
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
# A target can also support this widening summation if it can support
|
|
|
|
# promotion (unpacking) from chars to shorts.
|
2006-02-16 10:59:00 +01:00
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_widen_sum_qi_to_hi { } {
|
|
|
|
global et_vect_widen_sum_qi_to_hi
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
|
2006-02-16 10:59:00 +01:00
|
|
|
if [info exists et_vect_widen_sum_qi_to_hi_saved] {
|
|
|
|
verbose "check_effective_target_vect_widen_sum_qi_to_hi: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_widen_sum_qi_to_hi_saved 0
|
2007-05-01 08:58:59 +02:00
|
|
|
if { [check_effective_target_vect_unpack]
|
|
|
|
|| [istarget ia64-*-*] } {
|
2006-02-16 10:59:00 +01:00
|
|
|
set et_vect_widen_sum_qi_to_hi_saved 1
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
}
|
2006-02-16 10:59:00 +01:00
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_widen_sum_qi_to_hi: returning $et_vect_widen_sum_qi_to_hi_saved" 2
|
|
|
|
return $et_vect_widen_sum_qi_to_hi_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target plus current options supports a vector
|
|
|
|
# widening summation of *char* args into *int* result, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_widen_sum_qi_to_si { } {
|
|
|
|
global et_vect_widen_sum_qi_to_si
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
|
2006-02-16 10:59:00 +01:00
|
|
|
if [info exists et_vect_widen_sum_qi_to_si_saved] {
|
|
|
|
verbose "check_effective_target_vect_widen_sum_qi_to_si: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_widen_sum_qi_to_si_saved 0
|
|
|
|
if { [istarget powerpc*-*-*] } {
|
|
|
|
set et_vect_widen_sum_qi_to_si_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_widen_sum_qi_to_si: returning $et_vect_widen_sum_qi_to_si_saved" 2
|
|
|
|
return $et_vect_widen_sum_qi_to_si_saved
|
|
|
|
}
|
|
|
|
|
Makefile.in (tree-vect-patterns.o): Add rule for new file.
* Makefile.in (tree-vect-patterns.o): Add rule for new file.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Use
existing STMT_VINFO_VECTYPE if available.
(vect_mark_relevant): Add special handling for stmts that are
marked as STMT_VINFO_IN_PATTERN_P.
(vect_analyze_loop): Call vect_pattern_recog.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (in_pattern_p, related_stmt): New fields in
stmt_info.
(STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros.
(vect_recog_func_ptr): New function-pointer type.
* tree-vect-patterns.c: New file.
(vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern):
(vect_recog_dot_prod_pattern, vect_pattern_recog):
(vect_pattern_recog_1): New functions.
(vect_pattern_recog_funcs): New array of function pointers.
* tree-vectorizer.h (ternary_op): New enum value.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Added
declaration. Revised documentation. Removed redundant dump prints.
Removed redundant argument. Added support for reduction patterns.
(vectorizable_reduction): Added support for reduction patterns.
(vect_transform_stmt): Added support for patterns.
* expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR.
* genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR.
(expand_widen_pattern_expr): New function.
(init_optabs): Initialize new optabs udot_prod_optab,
sdot_prod_optab.
* optabs.h (OTI_sdot_prod, OTI_udot_prod): New.
(sdot_prod_optab, udot_prod_optab): Define new optabs.
(expand_widen_pattern_expr): New function declaration.
* tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New
tree-codes.
* tree-inline.c (estimate_num_insns_1): Added cases for new
tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-pretty-print.c (dump_generic_node): Likewise.
(op_prio): Likewise.
(op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-ssa-operands.c (get_expr_operands): Added case for
DOT_PROD_EXPR.
* tree-vect-patterns.c (widened_name_p): New function.
(vect_recog_dot_prod_pattern): Added function implementation.
* tree-vect-transform.c (get_initial_def_for_reduction): Added
cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR.
* config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New.
* config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New.
* expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR.
* genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR.
(init_optabs): Initialize new optabs widen_ssum_optab,
widen_usum_optab.
* optabs.h (OTI_widen_ssum, OTI_widen_usum): New.
(widen_ssum_optab, widen_usum_optab): Define new optabs.
* tree-vect-generic.c: (expand_vector_operations_1): Check type of
use instead of type of def.
* tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added
function implementation.
* config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi,
widen_ssumv8hi): New.
* doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New
patterns.
From-SVN: r109954
2006-01-19 11:24:00 +01:00
|
|
|
# Return 1 if the target plus current options supports a vector
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
# widening multiplication of *char* args into *short* result, 0 otherwise.
|
|
|
|
# A target can also support this widening multplication if it can support
|
|
|
|
# promotion (unpacking) from chars to shorts, and vect_short_mult (non-widening
|
|
|
|
# multiplication of shorts).
|
Makefile.in (tree-vect-patterns.o): Add rule for new file.
* Makefile.in (tree-vect-patterns.o): Add rule for new file.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Use
existing STMT_VINFO_VECTYPE if available.
(vect_mark_relevant): Add special handling for stmts that are
marked as STMT_VINFO_IN_PATTERN_P.
(vect_analyze_loop): Call vect_pattern_recog.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (in_pattern_p, related_stmt): New fields in
stmt_info.
(STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros.
(vect_recog_func_ptr): New function-pointer type.
* tree-vect-patterns.c: New file.
(vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern):
(vect_recog_dot_prod_pattern, vect_pattern_recog):
(vect_pattern_recog_1): New functions.
(vect_pattern_recog_funcs): New array of function pointers.
* tree-vectorizer.h (ternary_op): New enum value.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Added
declaration. Revised documentation. Removed redundant dump prints.
Removed redundant argument. Added support for reduction patterns.
(vectorizable_reduction): Added support for reduction patterns.
(vect_transform_stmt): Added support for patterns.
* expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR.
* genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR.
(expand_widen_pattern_expr): New function.
(init_optabs): Initialize new optabs udot_prod_optab,
sdot_prod_optab.
* optabs.h (OTI_sdot_prod, OTI_udot_prod): New.
(sdot_prod_optab, udot_prod_optab): Define new optabs.
(expand_widen_pattern_expr): New function declaration.
* tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New
tree-codes.
* tree-inline.c (estimate_num_insns_1): Added cases for new
tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-pretty-print.c (dump_generic_node): Likewise.
(op_prio): Likewise.
(op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-ssa-operands.c (get_expr_operands): Added case for
DOT_PROD_EXPR.
* tree-vect-patterns.c (widened_name_p): New function.
(vect_recog_dot_prod_pattern): Added function implementation.
* tree-vect-transform.c (get_initial_def_for_reduction): Added
cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR.
* config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New.
* config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New.
* expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR.
* genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR.
(init_optabs): Initialize new optabs widen_ssum_optab,
widen_usum_optab.
* optabs.h (OTI_widen_ssum, OTI_widen_usum): New.
(widen_ssum_optab, widen_usum_optab): Define new optabs.
* tree-vect-generic.c: (expand_vector_operations_1): Check type of
use instead of type of def.
* tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added
function implementation.
* config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi,
widen_ssumv8hi): New.
* doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New
patterns.
From-SVN: r109954
2006-01-19 11:24:00 +01:00
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
proc check_effective_target_vect_widen_mult_qi_to_hi { } {
|
|
|
|
global et_vect_widen_mult_qi_to_hi
|
|
|
|
|
|
|
|
if [info exists et_vect_widen_mult_qi_to_hi_saved] {
|
|
|
|
verbose "check_effective_target_vect_widen_mult_qi_to_hi: using cached result" 2
|
Makefile.in (tree-vect-patterns.o): Add rule for new file.
* Makefile.in (tree-vect-patterns.o): Add rule for new file.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Use
existing STMT_VINFO_VECTYPE if available.
(vect_mark_relevant): Add special handling for stmts that are
marked as STMT_VINFO_IN_PATTERN_P.
(vect_analyze_loop): Call vect_pattern_recog.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (in_pattern_p, related_stmt): New fields in
stmt_info.
(STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros.
(vect_recog_func_ptr): New function-pointer type.
* tree-vect-patterns.c: New file.
(vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern):
(vect_recog_dot_prod_pattern, vect_pattern_recog):
(vect_pattern_recog_1): New functions.
(vect_pattern_recog_funcs): New array of function pointers.
* tree-vectorizer.h (ternary_op): New enum value.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Added
declaration. Revised documentation. Removed redundant dump prints.
Removed redundant argument. Added support for reduction patterns.
(vectorizable_reduction): Added support for reduction patterns.
(vect_transform_stmt): Added support for patterns.
* expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR.
* genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR.
(expand_widen_pattern_expr): New function.
(init_optabs): Initialize new optabs udot_prod_optab,
sdot_prod_optab.
* optabs.h (OTI_sdot_prod, OTI_udot_prod): New.
(sdot_prod_optab, udot_prod_optab): Define new optabs.
(expand_widen_pattern_expr): New function declaration.
* tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New
tree-codes.
* tree-inline.c (estimate_num_insns_1): Added cases for new
tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-pretty-print.c (dump_generic_node): Likewise.
(op_prio): Likewise.
(op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-ssa-operands.c (get_expr_operands): Added case for
DOT_PROD_EXPR.
* tree-vect-patterns.c (widened_name_p): New function.
(vect_recog_dot_prod_pattern): Added function implementation.
* tree-vect-transform.c (get_initial_def_for_reduction): Added
cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR.
* config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New.
* config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New.
* expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR.
* genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR.
(init_optabs): Initialize new optabs widen_ssum_optab,
widen_usum_optab.
* optabs.h (OTI_widen_ssum, OTI_widen_usum): New.
(widen_ssum_optab, widen_usum_optab): Define new optabs.
* tree-vect-generic.c: (expand_vector_operations_1): Check type of
use instead of type of def.
* tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added
function implementation.
* config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi,
widen_ssumv8hi): New.
* doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New
patterns.
From-SVN: r109954
2006-01-19 11:24:00 +01:00
|
|
|
} else {
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
if { [check_effective_target_vect_unpack]
|
|
|
|
&& [check_effective_target_vect_short_mult] } {
|
|
|
|
set et_vect_widen_mult_qi_to_hi_saved 1
|
|
|
|
} else {
|
|
|
|
set et_vect_widen_mult_qi_to_hi_saved 0
|
|
|
|
}
|
|
|
|
if { [istarget powerpc*-*-*] } {
|
|
|
|
set et_vect_widen_mult_qi_to_hi_saved 1
|
Makefile.in (tree-vect-patterns.o): Add rule for new file.
* Makefile.in (tree-vect-patterns.o): Add rule for new file.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Use
existing STMT_VINFO_VECTYPE if available.
(vect_mark_relevant): Add special handling for stmts that are
marked as STMT_VINFO_IN_PATTERN_P.
(vect_analyze_loop): Call vect_pattern_recog.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (in_pattern_p, related_stmt): New fields in
stmt_info.
(STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros.
(vect_recog_func_ptr): New function-pointer type.
* tree-vect-patterns.c: New file.
(vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern):
(vect_recog_dot_prod_pattern, vect_pattern_recog):
(vect_pattern_recog_1): New functions.
(vect_pattern_recog_funcs): New array of function pointers.
* tree-vectorizer.h (ternary_op): New enum value.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Added
declaration. Revised documentation. Removed redundant dump prints.
Removed redundant argument. Added support for reduction patterns.
(vectorizable_reduction): Added support for reduction patterns.
(vect_transform_stmt): Added support for patterns.
* expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR.
* genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR.
(expand_widen_pattern_expr): New function.
(init_optabs): Initialize new optabs udot_prod_optab,
sdot_prod_optab.
* optabs.h (OTI_sdot_prod, OTI_udot_prod): New.
(sdot_prod_optab, udot_prod_optab): Define new optabs.
(expand_widen_pattern_expr): New function declaration.
* tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New
tree-codes.
* tree-inline.c (estimate_num_insns_1): Added cases for new
tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-pretty-print.c (dump_generic_node): Likewise.
(op_prio): Likewise.
(op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-ssa-operands.c (get_expr_operands): Added case for
DOT_PROD_EXPR.
* tree-vect-patterns.c (widened_name_p): New function.
(vect_recog_dot_prod_pattern): Added function implementation.
* tree-vect-transform.c (get_initial_def_for_reduction): Added
cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR.
* config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New.
* config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New.
* expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR.
* genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR.
(init_optabs): Initialize new optabs widen_ssum_optab,
widen_usum_optab.
* optabs.h (OTI_widen_ssum, OTI_widen_usum): New.
(widen_ssum_optab, widen_usum_optab): Define new optabs.
* tree-vect-generic.c: (expand_vector_operations_1): Check type of
use instead of type of def.
* tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added
function implementation.
* config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi,
widen_ssumv8hi): New.
* doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New
patterns.
From-SVN: r109954
2006-01-19 11:24:00 +01:00
|
|
|
}
|
|
|
|
}
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
verbose "check_effective_target_vect_widen_mult_qi_to_hi: returning $et_vect_widen_mult_qi_to_hi_saved" 2
|
|
|
|
return $et_vect_widen_mult_qi_to_hi_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target plus current options supports a vector
|
|
|
|
# widening multiplication of *short* args into *int* result, 0 otherwise.
|
|
|
|
# A target can also support this widening multplication if it can support
|
|
|
|
# promotion (unpacking) from shorts to ints, and vect_int_mult (non-widening
|
|
|
|
# multiplication of ints).
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
|
|
|
|
proc check_effective_target_vect_widen_mult_hi_to_si { } {
|
|
|
|
global et_vect_widen_mult_hi_to_si
|
|
|
|
|
|
|
|
if [info exists et_vect_widen_mult_hi_to_si_saved] {
|
|
|
|
verbose "check_effective_target_vect_widen_mult_hi_to_si: using cached result" 2
|
|
|
|
} else {
|
|
|
|
if { [check_effective_target_vect_unpack]
|
|
|
|
&& [check_effective_target_vect_int_mult] } {
|
|
|
|
set et_vect_widen_mult_hi_to_si_saved 1
|
|
|
|
} else {
|
|
|
|
set et_vect_widen_mult_hi_to_si_saved 0
|
|
|
|
}
|
2006-11-10 09:45:47 +01:00
|
|
|
if { [istarget powerpc*-*-*]
|
2006-12-20 15:07:38 +01:00
|
|
|
|| [istarget spu-*-*]
|
2006-11-10 09:45:47 +01:00
|
|
|
|| [istarget i?86-*-*]
|
|
|
|
|| [istarget x86_64-*-*] } {
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
set et_vect_widen_mult_hi_to_si_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_widen_mult_hi_to_si: returning $et_vect_widen_mult_hi_to_si_saved" 2
|
|
|
|
return $et_vect_widen_mult_hi_to_si_saved
|
Makefile.in (tree-vect-patterns.o): Add rule for new file.
* Makefile.in (tree-vect-patterns.o): Add rule for new file.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Use
existing STMT_VINFO_VECTYPE if available.
(vect_mark_relevant): Add special handling for stmts that are
marked as STMT_VINFO_IN_PATTERN_P.
(vect_analyze_loop): Call vect_pattern_recog.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (in_pattern_p, related_stmt): New fields in
stmt_info.
(STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros.
(vect_recog_func_ptr): New function-pointer type.
* tree-vect-patterns.c: New file.
(vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern):
(vect_recog_dot_prod_pattern, vect_pattern_recog):
(vect_pattern_recog_1): New functions.
(vect_pattern_recog_funcs): New array of function pointers.
* tree-vectorizer.h (ternary_op): New enum value.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Added
declaration. Revised documentation. Removed redundant dump prints.
Removed redundant argument. Added support for reduction patterns.
(vectorizable_reduction): Added support for reduction patterns.
(vect_transform_stmt): Added support for patterns.
* expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR.
* genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR.
(expand_widen_pattern_expr): New function.
(init_optabs): Initialize new optabs udot_prod_optab,
sdot_prod_optab.
* optabs.h (OTI_sdot_prod, OTI_udot_prod): New.
(sdot_prod_optab, udot_prod_optab): Define new optabs.
(expand_widen_pattern_expr): New function declaration.
* tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New
tree-codes.
* tree-inline.c (estimate_num_insns_1): Added cases for new
tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-pretty-print.c (dump_generic_node): Likewise.
(op_prio): Likewise.
(op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-ssa-operands.c (get_expr_operands): Added case for
DOT_PROD_EXPR.
* tree-vect-patterns.c (widened_name_p): New function.
(vect_recog_dot_prod_pattern): Added function implementation.
* tree-vect-transform.c (get_initial_def_for_reduction): Added
cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR.
* config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New.
* config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New.
* expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR.
* genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR.
(init_optabs): Initialize new optabs widen_ssum_optab,
widen_usum_optab.
* optabs.h (OTI_widen_ssum, OTI_widen_usum): New.
(widen_ssum_optab, widen_usum_optab): Define new optabs.
* tree-vect-generic.c: (expand_vector_operations_1): Check type of
use instead of type of def.
* tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added
function implementation.
* config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi,
widen_ssumv8hi): New.
* doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New
patterns.
From-SVN: r109954
2006-01-19 11:24:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target plus current options supports a vector
|
|
|
|
# dot-product of signed chars, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_sdot_qi { } {
|
|
|
|
global et_vect_sdot_qi
|
|
|
|
|
|
|
|
if [info exists et_vect_sdot_qi_saved] {
|
|
|
|
verbose "check_effective_target_vect_sdot_qi: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_sdot_qi_saved 0
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_sdot_qi: returning $et_vect_sdot_qi_saved" 2
|
|
|
|
return $et_vect_sdot_qi_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target plus current options supports a vector
|
|
|
|
# dot-product of unsigned chars, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_udot_qi { } {
|
|
|
|
global et_vect_udot_qi
|
|
|
|
|
|
|
|
if [info exists et_vect_udot_qi_saved] {
|
|
|
|
verbose "check_effective_target_vect_udot_qi: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_udot_qi_saved 0
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
if { [istarget powerpc*-*-*] } {
|
Makefile.in (tree-vect-patterns.o): Add rule for new file.
* Makefile.in (tree-vect-patterns.o): Add rule for new file.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Use
existing STMT_VINFO_VECTYPE if available.
(vect_mark_relevant): Add special handling for stmts that are
marked as STMT_VINFO_IN_PATTERN_P.
(vect_analyze_loop): Call vect_pattern_recog.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (in_pattern_p, related_stmt): New fields in
stmt_info.
(STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros.
(vect_recog_func_ptr): New function-pointer type.
* tree-vect-patterns.c: New file.
(vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern):
(vect_recog_dot_prod_pattern, vect_pattern_recog):
(vect_pattern_recog_1): New functions.
(vect_pattern_recog_funcs): New array of function pointers.
* tree-vectorizer.h (ternary_op): New enum value.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Added
declaration. Revised documentation. Removed redundant dump prints.
Removed redundant argument. Added support for reduction patterns.
(vectorizable_reduction): Added support for reduction patterns.
(vect_transform_stmt): Added support for patterns.
* expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR.
* genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR.
(expand_widen_pattern_expr): New function.
(init_optabs): Initialize new optabs udot_prod_optab,
sdot_prod_optab.
* optabs.h (OTI_sdot_prod, OTI_udot_prod): New.
(sdot_prod_optab, udot_prod_optab): Define new optabs.
(expand_widen_pattern_expr): New function declaration.
* tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New
tree-codes.
* tree-inline.c (estimate_num_insns_1): Added cases for new
tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-pretty-print.c (dump_generic_node): Likewise.
(op_prio): Likewise.
(op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-ssa-operands.c (get_expr_operands): Added case for
DOT_PROD_EXPR.
* tree-vect-patterns.c (widened_name_p): New function.
(vect_recog_dot_prod_pattern): Added function implementation.
* tree-vect-transform.c (get_initial_def_for_reduction): Added
cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR.
* config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New.
* config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New.
* expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR.
* genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR.
(init_optabs): Initialize new optabs widen_ssum_optab,
widen_usum_optab.
* optabs.h (OTI_widen_ssum, OTI_widen_usum): New.
(widen_ssum_optab, widen_usum_optab): Define new optabs.
* tree-vect-generic.c: (expand_vector_operations_1): Check type of
use instead of type of def.
* tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added
function implementation.
* config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi,
widen_ssumv8hi): New.
* doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New
patterns.
From-SVN: r109954
2006-01-19 11:24:00 +01:00
|
|
|
set et_vect_udot_qi_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_udot_qi: returning $et_vect_udot_qi_saved" 2
|
|
|
|
return $et_vect_udot_qi_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target plus current options supports a vector
|
|
|
|
# dot-product of signed shorts, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_sdot_hi { } {
|
|
|
|
global et_vect_sdot_hi
|
|
|
|
|
|
|
|
if [info exists et_vect_sdot_hi_saved] {
|
|
|
|
verbose "check_effective_target_vect_sdot_hi: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_sdot_hi_saved 0
|
2007-10-31 18:04:42 +01:00
|
|
|
if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
|
Makefile.in (tree-vect-patterns.o): Add rule for new file.
* Makefile.in (tree-vect-patterns.o): Add rule for new file.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Use
existing STMT_VINFO_VECTYPE if available.
(vect_mark_relevant): Add special handling for stmts that are
marked as STMT_VINFO_IN_PATTERN_P.
(vect_analyze_loop): Call vect_pattern_recog.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (in_pattern_p, related_stmt): New fields in
stmt_info.
(STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros.
(vect_recog_func_ptr): New function-pointer type.
* tree-vect-patterns.c: New file.
(vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern):
(vect_recog_dot_prod_pattern, vect_pattern_recog):
(vect_pattern_recog_1): New functions.
(vect_pattern_recog_funcs): New array of function pointers.
* tree-vectorizer.h (ternary_op): New enum value.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Added
declaration. Revised documentation. Removed redundant dump prints.
Removed redundant argument. Added support for reduction patterns.
(vectorizable_reduction): Added support for reduction patterns.
(vect_transform_stmt): Added support for patterns.
* expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR.
* genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR.
(expand_widen_pattern_expr): New function.
(init_optabs): Initialize new optabs udot_prod_optab,
sdot_prod_optab.
* optabs.h (OTI_sdot_prod, OTI_udot_prod): New.
(sdot_prod_optab, udot_prod_optab): Define new optabs.
(expand_widen_pattern_expr): New function declaration.
* tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New
tree-codes.
* tree-inline.c (estimate_num_insns_1): Added cases for new
tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-pretty-print.c (dump_generic_node): Likewise.
(op_prio): Likewise.
(op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-ssa-operands.c (get_expr_operands): Added case for
DOT_PROD_EXPR.
* tree-vect-patterns.c (widened_name_p): New function.
(vect_recog_dot_prod_pattern): Added function implementation.
* tree-vect-transform.c (get_initial_def_for_reduction): Added
cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR.
* config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New.
* config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New.
* expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR.
* genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR.
(init_optabs): Initialize new optabs widen_ssum_optab,
widen_usum_optab.
* optabs.h (OTI_widen_ssum, OTI_widen_usum): New.
(widen_ssum_optab, widen_usum_optab): Define new optabs.
* tree-vect-generic.c: (expand_vector_operations_1): Check type of
use instead of type of def.
* tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added
function implementation.
* config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi,
widen_ssumv8hi): New.
* doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New
patterns.
From-SVN: r109954
2006-01-19 11:24:00 +01:00
|
|
|
|| [istarget i?86-*-*]
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
|| [istarget x86_64-*-*] } {
|
Makefile.in (tree-vect-patterns.o): Add rule for new file.
* Makefile.in (tree-vect-patterns.o): Add rule for new file.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Use
existing STMT_VINFO_VECTYPE if available.
(vect_mark_relevant): Add special handling for stmts that are
marked as STMT_VINFO_IN_PATTERN_P.
(vect_analyze_loop): Call vect_pattern_recog.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (in_pattern_p, related_stmt): New fields in
stmt_info.
(STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros.
(vect_recog_func_ptr): New function-pointer type.
* tree-vect-patterns.c: New file.
(vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern):
(vect_recog_dot_prod_pattern, vect_pattern_recog):
(vect_pattern_recog_1): New functions.
(vect_pattern_recog_funcs): New array of function pointers.
* tree-vectorizer.h (ternary_op): New enum value.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Added
declaration. Revised documentation. Removed redundant dump prints.
Removed redundant argument. Added support for reduction patterns.
(vectorizable_reduction): Added support for reduction patterns.
(vect_transform_stmt): Added support for patterns.
* expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR.
* genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR.
(expand_widen_pattern_expr): New function.
(init_optabs): Initialize new optabs udot_prod_optab,
sdot_prod_optab.
* optabs.h (OTI_sdot_prod, OTI_udot_prod): New.
(sdot_prod_optab, udot_prod_optab): Define new optabs.
(expand_widen_pattern_expr): New function declaration.
* tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New
tree-codes.
* tree-inline.c (estimate_num_insns_1): Added cases for new
tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-pretty-print.c (dump_generic_node): Likewise.
(op_prio): Likewise.
(op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-ssa-operands.c (get_expr_operands): Added case for
DOT_PROD_EXPR.
* tree-vect-patterns.c (widened_name_p): New function.
(vect_recog_dot_prod_pattern): Added function implementation.
* tree-vect-transform.c (get_initial_def_for_reduction): Added
cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR.
* config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New.
* config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New.
* expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR.
* genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR.
(init_optabs): Initialize new optabs widen_ssum_optab,
widen_usum_optab.
* optabs.h (OTI_widen_ssum, OTI_widen_usum): New.
(widen_ssum_optab, widen_usum_optab): Define new optabs.
* tree-vect-generic.c: (expand_vector_operations_1): Check type of
use instead of type of def.
* tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added
function implementation.
* config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi,
widen_ssumv8hi): New.
* doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New
patterns.
From-SVN: r109954
2006-01-19 11:24:00 +01:00
|
|
|
set et_vect_sdot_hi_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_sdot_hi: returning $et_vect_sdot_hi_saved" 2
|
|
|
|
return $et_vect_sdot_hi_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target plus current options supports a vector
|
|
|
|
# dot-product of unsigned shorts, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_udot_hi { } {
|
|
|
|
global et_vect_udot_hi
|
|
|
|
|
|
|
|
if [info exists et_vect_udot_hi_saved] {
|
|
|
|
verbose "check_effective_target_vect_udot_hi: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_udot_hi_saved 0
|
2007-10-31 18:04:42 +01:00
|
|
|
if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) } {
|
Makefile.in (tree-vect-patterns.o): Add rule for new file.
* Makefile.in (tree-vect-patterns.o): Add rule for new file.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Use
existing STMT_VINFO_VECTYPE if available.
(vect_mark_relevant): Add special handling for stmts that are
marked as STMT_VINFO_IN_PATTERN_P.
(vect_analyze_loop): Call vect_pattern_recog.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (in_pattern_p, related_stmt): New fields in
stmt_info.
(STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros.
(vect_recog_func_ptr): New function-pointer type.
* tree-vect-patterns.c: New file.
(vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern):
(vect_recog_dot_prod_pattern, vect_pattern_recog):
(vect_pattern_recog_1): New functions.
(vect_pattern_recog_funcs): New array of function pointers.
* tree-vectorizer.h (ternary_op): New enum value.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Added
declaration. Revised documentation. Removed redundant dump prints.
Removed redundant argument. Added support for reduction patterns.
(vectorizable_reduction): Added support for reduction patterns.
(vect_transform_stmt): Added support for patterns.
* expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR.
* genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR.
(expand_widen_pattern_expr): New function.
(init_optabs): Initialize new optabs udot_prod_optab,
sdot_prod_optab.
* optabs.h (OTI_sdot_prod, OTI_udot_prod): New.
(sdot_prod_optab, udot_prod_optab): Define new optabs.
(expand_widen_pattern_expr): New function declaration.
* tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New
tree-codes.
* tree-inline.c (estimate_num_insns_1): Added cases for new
tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-pretty-print.c (dump_generic_node): Likewise.
(op_prio): Likewise.
(op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
* tree-ssa-operands.c (get_expr_operands): Added case for
DOT_PROD_EXPR.
* tree-vect-patterns.c (widened_name_p): New function.
(vect_recog_dot_prod_pattern): Added function implementation.
* tree-vect-transform.c (get_initial_def_for_reduction): Added
cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR.
* config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New.
* config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New.
* expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR.
* genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize.
* optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR.
(init_optabs): Initialize new optabs widen_ssum_optab,
widen_usum_optab.
* optabs.h (OTI_widen_ssum, OTI_widen_usum): New.
(widen_ssum_optab, widen_usum_optab): Define new optabs.
* tree-vect-generic.c: (expand_vector_operations_1): Check type of
use instead of type of def.
* tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added
function implementation.
* config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi,
widen_ssumv8hi): New.
* doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New
patterns.
From-SVN: r109954
2006-01-19 11:24:00 +01:00
|
|
|
set et_vect_udot_hi_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_udot_hi: returning $et_vect_udot_hi_saved" 2
|
|
|
|
return $et_vect_udot_hi_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
# Return 1 if the target plus current options supports a vector
|
|
|
|
# demotion (packing) of shorts (to chars) and ints (to shorts)
|
|
|
|
# using modulo arithmetic, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
2007-04-23 08:02:05 +02:00
|
|
|
proc check_effective_target_vect_pack_trunc { } {
|
|
|
|
global et_vect_pack_trunc
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
|
2007-04-23 08:02:05 +02:00
|
|
|
if [info exists et_vect_pack_trunc_saved] {
|
|
|
|
verbose "check_effective_target_vect_pack_trunc: using cached result" 2
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
} else {
|
2007-04-23 08:02:05 +02:00
|
|
|
set et_vect_pack_trunc_saved 0
|
2007-10-31 18:04:42 +01:00
|
|
|
if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
|| [istarget i?86-*-*]
|
spu.md (vec_extract_evenv4si, [...]): Implement.S
2008-08-26 Victor Kaplansky <victork@il.ibm.com>
Dorit Nuzman <dorit@il.ibm.com>
* gcc/config/spu/spu.md (vec_extract_evenv4si,
vec_extract_evenv4sf, vec_extract_evenv8hi,
vec_extract_evenv16qi, vec_extract_oddv4si,
vec_extract_oddv4sf, vec_extract_oddv8hi, vec_extract_oddv16qi,
vec_interleave_highv4sf, vec_interleave_lowv4sf,
vec_interleave_highv4si, vec_interleave_lowv4si,
vec_interleave_highv8hi, vec_interleave_lowv8hi,
vec_interleave_highv16qi, vec_interleave_lowv16qi,
vec_pack_trunc_v8hi, vec_pack_trunc_v4si): Implement.S
Testsuite
* gcc.dg/vect/slp-18.c: Require vect_intfloat_cvt.
* gcc.dg/vect/slp-11.c: Likewise.
* gcc.dg/vect/fast-math-pr35982.c: Likewise.
* lib/target-supports.exp:
(check_effective_target_vect_pack_trunc): Add SPU to the list.
(check_effective_target_vect_extract_even_odd): Likewise.
(check_effective_target_vect_extract_even_odd_wide): Likewise.
(check_effective_target_vect_interleave): Likewise.
Co-Authored-By: Dorit Nuzman <dorit@il.ibm.com>
From-SVN: r139589
2008-08-26 11:14:37 +02:00
|
|
|
|| [istarget x86_64-*-*]
|
|
|
|
|| [istarget spu-*-*] } {
|
2007-04-23 08:02:05 +02:00
|
|
|
set et_vect_pack_trunc_saved 1
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
}
|
|
|
|
}
|
2007-04-23 08:02:05 +02:00
|
|
|
verbose "check_effective_target_vect_pack_trunc: returning $et_vect_pack_trunc_saved" 2
|
|
|
|
return $et_vect_pack_trunc_saved
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target plus current options supports a vector
|
|
|
|
# promotion (unpacking) of chars (to shorts) and shorts (to ints), 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_unpack { } {
|
|
|
|
global et_vect_unpack
|
|
|
|
|
|
|
|
if [info exists et_vect_unpack_saved] {
|
|
|
|
verbose "check_effective_target_vect_unpack: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_unpack_saved 0
|
2007-10-31 18:04:42 +01:00
|
|
|
if { ([istarget powerpc*-*-*] && ![istarget powerpc-*paired*])
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
|| [istarget i?86-*-*]
|
2008-02-20 08:36:47 +01:00
|
|
|
|| [istarget x86_64-*-*]
|
|
|
|
|| [istarget spu-*-*] } {
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
set et_vect_unpack_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_unpack: returning $et_vect_unpack_saved" 2
|
|
|
|
return $et_vect_unpack_saved
|
|
|
|
}
|
|
|
|
|
2007-10-30 06:25:10 +01:00
|
|
|
# Return 1 if the target plus current options does not guarantee
|
|
|
|
# that its STACK_BOUNDARY is >= the reguired vector alignment.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_unaligned_stack { } {
|
|
|
|
global et_unaligned_stack_saved
|
|
|
|
|
|
|
|
if [info exists et_unaligned_stack_saved] {
|
|
|
|
verbose "check_effective_target_unaligned_stack: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_unaligned_stack_saved 0
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_unaligned_stack: returning $et_unaligned_stack_saved" 2
|
|
|
|
return $et_unaligned_stack_saved
|
|
|
|
}
|
|
|
|
|
2004-12-21 19:03:31 +01:00
|
|
|
# Return 1 if the target plus current options does not support a vector
|
|
|
|
# alignment mechanism, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_no_align { } {
|
|
|
|
global et_vect_no_align_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_no_align_saved] {
|
|
|
|
verbose "check_effective_target_vect_no_align: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_no_align_saved 0
|
2004-12-23 11:25:45 +01:00
|
|
|
if { [istarget mipsisa64*-*-*]
|
2005-01-03 20:59:13 +01:00
|
|
|
|| [istarget sparc*-*-*]
|
2008-07-02 00:15:47 +02:00
|
|
|
|| [istarget ia64-*-*]
|
|
|
|
|| [check_effective_target_arm32] } {
|
2004-12-21 19:03:31 +01:00
|
|
|
set et_vect_no_align_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_no_align: returning $et_vect_no_align_saved" 2
|
|
|
|
return $et_vect_no_align_saved
|
|
|
|
}
|
|
|
|
|
2009-06-05 17:28:50 +02:00
|
|
|
# Return 1 if the target supports a vector misalign access, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_hw_misalign { } {
|
|
|
|
global et_vect_hw_misalign_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_hw_misalign_saved] {
|
|
|
|
verbose "check_effective_target_vect_hw_misalign: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_hw_misalign_saved 0
|
2009-06-08 15:26:44 +02:00
|
|
|
if { ([istarget x86_64-*-*]
|
|
|
|
|| [istarget i?86-*-*]) } {
|
2009-06-05 17:28:50 +02:00
|
|
|
set et_vect_hw_misalign_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_hw_misalign: returning $et_vect_hw_misalign_saved" 2
|
|
|
|
return $et_vect_hw_misalign_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-07-16 08:10:25 +02:00
|
|
|
# Return 1 if arrays are aligned to the vector alignment
|
|
|
|
# boundary, 0 otherwise.
|
2007-07-14 07:50:06 +02:00
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_aligned_arrays { } {
|
|
|
|
global et_vect_aligned_arrays
|
|
|
|
|
|
|
|
if [info exists et_vect_aligned_arrays_saved] {
|
|
|
|
verbose "check_effective_target_vect_aligned_arrays: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_aligned_arrays_saved 0
|
2007-10-21 12:01:16 +02:00
|
|
|
if { (([istarget x86_64-*-*]
|
|
|
|
|| [istarget i?86-*-*]) && [is-effective-target lp64])
|
|
|
|
|| [istarget spu-*-*] } {
|
2007-07-14 07:50:06 +02:00
|
|
|
set et_vect_aligned_arrays_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vect_aligned_arrays: returning $et_vect_aligned_arrays_saved" 2
|
|
|
|
return $et_vect_aligned_arrays_saved
|
|
|
|
}
|
|
|
|
|
2007-10-21 12:01:16 +02:00
|
|
|
# Return 1 if types of size 32 bit or less are naturally aligned
|
|
|
|
# (aligned to their type-size), 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_natural_alignment_32 { } {
|
|
|
|
global et_natural_alignment_32
|
|
|
|
|
|
|
|
if [info exists et_natural_alignment_32_saved] {
|
|
|
|
verbose "check_effective_target_natural_alignment_32: using cached result" 2
|
|
|
|
} else {
|
|
|
|
# FIXME: 32bit powerpc: guaranteed only if MASK_ALIGN_NATURAL/POWER.
|
|
|
|
set et_natural_alignment_32_saved 1
|
|
|
|
if { ([istarget *-*-darwin*] && [is-effective-target lp64]) } {
|
|
|
|
set et_natural_alignment_32_saved 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_natural_alignment_32: returning $et_natural_alignment_32_saved" 2
|
|
|
|
return $et_natural_alignment_32_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if types of size 64 bit or less are naturally aligned (aligned to their
|
|
|
|
# type-size), 0 otherwise.
|
2007-07-24 11:20:50 +02:00
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
2007-10-21 12:01:16 +02:00
|
|
|
proc check_effective_target_natural_alignment_64 { } {
|
|
|
|
global et_natural_alignment_64
|
2007-07-24 11:20:50 +02:00
|
|
|
|
2007-10-21 12:01:16 +02:00
|
|
|
if [info exists et_natural_alignment_64_saved] {
|
|
|
|
verbose "check_effective_target_natural_alignment_64: using cached result" 2
|
2007-07-24 11:20:50 +02:00
|
|
|
} else {
|
2007-10-21 12:01:16 +02:00
|
|
|
set et_natural_alignment_64_saved 0
|
|
|
|
if { ([is-effective-target lp64] && ![istarget *-*-darwin*])
|
|
|
|
|| [istarget spu-*-*] } {
|
|
|
|
set et_natural_alignment_64_saved 1
|
2007-07-24 11:20:50 +02:00
|
|
|
}
|
|
|
|
}
|
2007-10-21 12:01:16 +02:00
|
|
|
verbose "check_effective_target_natural_alignment_64: returning $et_natural_alignment_64_saved" 2
|
|
|
|
return $et_natural_alignment_64_saved
|
2007-07-24 11:20:50 +02:00
|
|
|
}
|
|
|
|
|
2007-10-21 12:01:16 +02:00
|
|
|
# Return 1 if vector alignment (for types of size 32 bit or less) is reachable, 0 otherwise.
|
2007-07-24 11:20:50 +02:00
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_vector_alignment_reachable { } {
|
|
|
|
global et_vector_alignment_reachable
|
|
|
|
|
|
|
|
if [info exists et_vector_alignment_reachable_saved] {
|
|
|
|
verbose "check_effective_target_vector_alignment_reachable: using cached result" 2
|
|
|
|
} else {
|
|
|
|
if { [check_effective_target_vect_aligned_arrays]
|
2007-10-21 12:01:16 +02:00
|
|
|
|| [check_effective_target_natural_alignment_32] } {
|
2007-07-24 11:20:50 +02:00
|
|
|
set et_vector_alignment_reachable_saved 1
|
|
|
|
} else {
|
|
|
|
set et_vector_alignment_reachable_saved 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_vector_alignment_reachable: returning $et_vector_alignment_reachable_saved" 2
|
|
|
|
return $et_vector_alignment_reachable_saved
|
|
|
|
}
|
|
|
|
|
2007-10-21 12:01:16 +02:00
|
|
|
# Return 1 if vector alignment for 64 bit is reachable, 0 otherwise.
|
2007-08-07 21:13:27 +02:00
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
2007-10-21 12:01:16 +02:00
|
|
|
proc check_effective_target_vector_alignment_reachable_for_64bit { } {
|
|
|
|
global et_vector_alignment_reachable_for_64bit
|
2007-08-07 21:13:27 +02:00
|
|
|
|
2007-10-21 12:01:16 +02:00
|
|
|
if [info exists et_vector_alignment_reachable_for_64bit_saved] {
|
|
|
|
verbose "check_effective_target_vector_alignment_reachable_for_64bit: using cached result" 2
|
2007-08-07 21:13:27 +02:00
|
|
|
} else {
|
2007-10-21 12:01:16 +02:00
|
|
|
if { [check_effective_target_vect_aligned_arrays]
|
|
|
|
|| [check_effective_target_natural_alignment_64] } {
|
|
|
|
set et_vector_alignment_reachable_for_64bit_saved 1
|
2007-08-07 21:13:27 +02:00
|
|
|
} else {
|
2007-10-21 12:01:16 +02:00
|
|
|
set et_vector_alignment_reachable_for_64bit_saved 0
|
2007-08-07 21:13:27 +02:00
|
|
|
}
|
|
|
|
}
|
2007-10-21 12:01:16 +02:00
|
|
|
verbose "check_effective_target_vector_alignment_reachable_for_64bit: returning $et_vector_alignment_reachable_for_64bit_saved" 2
|
|
|
|
return $et_vector_alignment_reachable_for_64bit_saved
|
2007-08-07 21:13:27 +02:00
|
|
|
}
|
|
|
|
|
2005-04-12 03:35:54 +02:00
|
|
|
# Return 1 if the target supports vector conditional operations, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_condition { } {
|
|
|
|
global et_vect_cond_saved
|
|
|
|
|
2005-10-03 07:24:08 +02:00
|
|
|
if [info exists et_vect_cond_saved] {
|
2005-04-12 03:35:54 +02:00
|
|
|
verbose "check_effective_target_vect_cond: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_cond_saved 0
|
2005-04-14 19:46:08 +02:00
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [istarget ia64-*-*]
|
|
|
|
|| [istarget i?86-*-*]
|
config.gcc: Add options for arch and tune on SPU.
2007-07-13 Sa Liu <saliu@de.ibm.com>
* config.gcc: Add options for arch and tune on SPU.
* config/spu/predicates.md: Add constant operands 0 and 1.
* config/spu/spu-builtins.def: Add builtins for double precision
floating point comparison: si_dfceq, si_dfcmeq, si_dfcgt, si_dfcmgt,
si_dftsv, spu_cmpeq_13, spu_cmpabseq_1, spu_cmpgt_13, spu_cmpabsgt_1,
spu_testsv.
* config/spu/spu-c.c: Define __SPU_EDP__ when builtins invoked with
a CELLEDP target.
* config/spu/spu-protos.h: Add new function prototypes.
* config/spu/spu.c (spu_override_options): Check options -march and
-mtune.
(spu_comp_icode): Add comparison code for DFmode and vector mode.
(spu_emit_branch_or_set): Use the new code for DFmode and vector
mode comparison.
(spu_const_from_int): New. Create a vector constant from 4 ints.
(get_vec_cmp_insn): New. Get insn index of vector compare instruction.
(spu_emit_vector_compare): New. Emit vector compare.
(spu_emit_vector_cond_expr): New. Emit vector conditional expression.
* config/spu/spu.h: Add options -march and -mtune. Define processor
types PROCESSOR_CELL and PROCESSOR_CELLEDP. Define macro
CANONICALIZE_COMPARISON.
* config/spu/spu.md: Add new insns for double precision compare
and double precision vector compare. Add vcond and smax/smin patterns
to enable DFmode vector conditional expression.
* config/spu/spu.opt: Add options -march and -mtune.
* config/spu/spu_internals.h: Add builtins for CELLEDP target:
si_dfceq, si_dfcmeq, si_dfcgt, si_dfcmgt, si_dftsv. Add builtin for
both CELL and CELLEDP targets: spu_testsv.
* config/spu/spu_intrinsics.h: Add flag mnemonics for test special
values.
testsuite/
* gcc.dg/vect/fast-math-vect-reduc-7.c: Switch on test
for V2DFmode vector conditional expression.
* gcc.target/spu/dfcmeq.c: New. Test combination of abs
and dfceq patterns.
* gcc.target/spu/dfcmgt.c: New. Test combination of abs
and dfcgt patterns.
* gcc.target/spu/intrinsics-2.c: New. Test intrinsics for
V2DFmode comparison and test special values.
* lib/target-supports.exp: Switch on test for V2DFmode
vector conditional expression.
From-SVN: r126626
2007-07-13 20:31:08 +02:00
|
|
|
|| [istarget spu-*-*]
|
2005-04-14 19:46:08 +02:00
|
|
|
|| [istarget x86_64-*-*] } {
|
2005-04-12 03:35:54 +02:00
|
|
|
set et_vect_cond_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_cond: returning $et_vect_cond_saved" 2
|
|
|
|
return $et_vect_cond_saved
|
|
|
|
}
|
|
|
|
|
2006-02-16 10:59:00 +01:00
|
|
|
# Return 1 if the target supports vector char multiplication, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_char_mult { } {
|
|
|
|
global et_vect_char_mult_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_char_mult_saved] {
|
|
|
|
verbose "check_effective_target_vect_char_mult: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_char_mult_saved 0
|
|
|
|
if { [istarget ia64-*-*]
|
|
|
|
|| [istarget i?86-*-*]
|
|
|
|
|| [istarget x86_64-*-*] } {
|
|
|
|
set et_vect_char_mult_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_char_mult: returning $et_vect_char_mult_saved" 2
|
|
|
|
return $et_vect_char_mult_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target supports vector short multiplication, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_short_mult { } {
|
|
|
|
global et_vect_short_mult_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_short_mult_saved] {
|
|
|
|
verbose "check_effective_target_vect_short_mult: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_short_mult_saved 0
|
|
|
|
if { [istarget ia64-*-*]
|
2008-02-20 08:36:47 +01:00
|
|
|
|| [istarget spu-*-*]
|
2006-02-16 10:59:00 +01:00
|
|
|
|| [istarget i?86-*-*]
|
2008-09-07 10:54:00 +02:00
|
|
|
|| [istarget x86_64-*-*]
|
2009-03-03 08:42:26 +01:00
|
|
|
|| [istarget powerpc*-*-*]
|
|
|
|
|| [check_effective_target_arm32] } {
|
2006-02-16 10:59:00 +01:00
|
|
|
set et_vect_short_mult_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_short_mult: returning $et_vect_short_mult_saved" 2
|
|
|
|
return $et_vect_short_mult_saved
|
|
|
|
}
|
|
|
|
|
2005-04-18 17:50:53 +02:00
|
|
|
# Return 1 if the target supports vector int multiplication, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_int_mult { } {
|
|
|
|
global et_vect_int_mult_saved
|
|
|
|
|
2005-04-20 06:54:11 +02:00
|
|
|
if [info exists et_vect_int_mult_saved] {
|
2005-04-18 17:50:53 +02:00
|
|
|
verbose "check_effective_target_vect_int_mult: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_int_mult_saved 0
|
2007-10-31 18:04:42 +01:00
|
|
|
if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
|
2007-07-12 14:17:03 +02:00
|
|
|
|| [istarget spu-*-*]
|
2005-05-17 06:33:42 +02:00
|
|
|
|| [istarget i?86-*-*]
|
2008-07-02 00:15:47 +02:00
|
|
|
|| [istarget x86_64-*-*]
|
|
|
|
|| [check_effective_target_arm32] } {
|
2005-04-18 17:50:53 +02:00
|
|
|
set et_vect_int_mult_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_int_mult: returning $et_vect_int_mult_saved" 2
|
|
|
|
return $et_vect_int_mult_saved
|
|
|
|
}
|
2005-04-12 03:35:54 +02:00
|
|
|
|
c-tree.texi: Document new tree codes.
* doc/c-tree.texi: Document new tree codes.
* doc/md.texi: Document new optabs.
* tree-pretty-print.c (dump_generic_node): Handle print of new tree
codes.
* optabs.c (optab_for_tree_code, init_optabs): Handle new optabs.
* optabs.h (optab_index): Add new.
(vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): New optabs.
* genopinit.c (vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): Initialize
new optabs.
* expr.c (expand_expr_real_1): Add implementation for new tree codes.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (stmt_vec_info): Add new fields for interleaving
along with macros for their access.
* tree-data-ref.h (first_location_in_loop, data_reference): Update
comment.
* tree-vect-analyze.c (toplev.h): Include.
(vect_determine_vectorization_factor): Fix indentation.
(vect_insert_into_interleaving_chain,
vect_update_interleaving_chain, vect_equal_offsets): New functions.
(vect_analyze_data_ref_dependence): Add argument for interleaving
check. Check for interleaving if it's true.
(vect_check_dependences): New function.
(vect_analyze_data_ref_dependences): Call vect_check_dependences for
every ddr. Call vect_analyze_data_ref_dependence with new argument.
(vect_update_misalignment_for_peel): Update for interleaving.
(vect_verify_datarefs_alignment): Check only first data-ref for
interleaving.
(vect_enhance_data_refs_alignment): Update for interleaving. Check
only first data-ref for interleaving.
(vect_analyze_data_ref_access): Check interleaving, update
interleaving data.
(vect_analyze_data_refs): Call compute_data_dependences_for_loop
with different parameters.
* tree.def (VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR,
VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): New tree codes.
* tree-inline.c (estimate_num_insns_1): Add cases for new codes.
* tree-vect-transform.c (vect_create_addr_base_for_vector_ref):
Update step in case of interleaving.
(vect_strided_store_supported, vect_permute_store_chain): New
functions.
(vectorizable_store): Handle strided stores.
(vect_strided_load_supported, vect_permute_load_chain,
vect_transform_strided_load): New functions.
(vectorizable_load): Handle strided loads.
(vect_transform_stmt): Add argument. Handle strided stores. Check
that vectorized stmt exists for patterns.
(vect_gen_niters_for_prolog_loop): Update calculation for
interleaving.
(vect_transform_loop): Remove stmt_vec_info for strided stores after
whole chain vectorization.
* config/rs6000/altivec.md (UNSPEC_EXTEVEN, UNSPEC_EXTODD,
UNSPEC_INTERHI, UNSPEC_INTERLO): New constants.
(vpkuhum_nomode, vpkuwum_nomode, vec_extract_even<mode>,
vec_extract_odd<mode>, altivec_vmrghsf, altivec_vmrglsf,
vec_interleave_high<mode>, vec_interleave_low<mode>): Implement.
From-SVN: r119088
2006-11-22 09:46:03 +01:00
|
|
|
# Return 1 if the target supports vector even/odd elements extraction, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_extract_even_odd { } {
|
|
|
|
global et_vect_extract_even_odd_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_extract_even_odd_saved] {
|
|
|
|
verbose "check_effective_target_vect_extract_even_odd: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_extract_even_odd_saved 0
|
spu.md (vec_extract_evenv4si, [...]): Implement.S
2008-08-26 Victor Kaplansky <victork@il.ibm.com>
Dorit Nuzman <dorit@il.ibm.com>
* gcc/config/spu/spu.md (vec_extract_evenv4si,
vec_extract_evenv4sf, vec_extract_evenv8hi,
vec_extract_evenv16qi, vec_extract_oddv4si,
vec_extract_oddv4sf, vec_extract_oddv8hi, vec_extract_oddv16qi,
vec_interleave_highv4sf, vec_interleave_lowv4sf,
vec_interleave_highv4si, vec_interleave_lowv4si,
vec_interleave_highv8hi, vec_interleave_lowv8hi,
vec_interleave_highv16qi, vec_interleave_lowv16qi,
vec_pack_trunc_v8hi, vec_pack_trunc_v4si): Implement.S
Testsuite
* gcc.dg/vect/slp-18.c: Require vect_intfloat_cvt.
* gcc.dg/vect/slp-11.c: Likewise.
* gcc.dg/vect/fast-math-pr35982.c: Likewise.
* lib/target-supports.exp:
(check_effective_target_vect_pack_trunc): Add SPU to the list.
(check_effective_target_vect_extract_even_odd): Likewise.
(check_effective_target_vect_extract_even_odd_wide): Likewise.
(check_effective_target_vect_interleave): Likewise.
Co-Authored-By: Dorit Nuzman <dorit@il.ibm.com>
From-SVN: r139589
2008-08-26 11:14:37 +02:00
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [istarget spu-*-*] } {
|
c-tree.texi: Document new tree codes.
* doc/c-tree.texi: Document new tree codes.
* doc/md.texi: Document new optabs.
* tree-pretty-print.c (dump_generic_node): Handle print of new tree
codes.
* optabs.c (optab_for_tree_code, init_optabs): Handle new optabs.
* optabs.h (optab_index): Add new.
(vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): New optabs.
* genopinit.c (vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): Initialize
new optabs.
* expr.c (expand_expr_real_1): Add implementation for new tree codes.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (stmt_vec_info): Add new fields for interleaving
along with macros for their access.
* tree-data-ref.h (first_location_in_loop, data_reference): Update
comment.
* tree-vect-analyze.c (toplev.h): Include.
(vect_determine_vectorization_factor): Fix indentation.
(vect_insert_into_interleaving_chain,
vect_update_interleaving_chain, vect_equal_offsets): New functions.
(vect_analyze_data_ref_dependence): Add argument for interleaving
check. Check for interleaving if it's true.
(vect_check_dependences): New function.
(vect_analyze_data_ref_dependences): Call vect_check_dependences for
every ddr. Call vect_analyze_data_ref_dependence with new argument.
(vect_update_misalignment_for_peel): Update for interleaving.
(vect_verify_datarefs_alignment): Check only first data-ref for
interleaving.
(vect_enhance_data_refs_alignment): Update for interleaving. Check
only first data-ref for interleaving.
(vect_analyze_data_ref_access): Check interleaving, update
interleaving data.
(vect_analyze_data_refs): Call compute_data_dependences_for_loop
with different parameters.
* tree.def (VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR,
VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): New tree codes.
* tree-inline.c (estimate_num_insns_1): Add cases for new codes.
* tree-vect-transform.c (vect_create_addr_base_for_vector_ref):
Update step in case of interleaving.
(vect_strided_store_supported, vect_permute_store_chain): New
functions.
(vectorizable_store): Handle strided stores.
(vect_strided_load_supported, vect_permute_load_chain,
vect_transform_strided_load): New functions.
(vectorizable_load): Handle strided loads.
(vect_transform_stmt): Add argument. Handle strided stores. Check
that vectorized stmt exists for patterns.
(vect_gen_niters_for_prolog_loop): Update calculation for
interleaving.
(vect_transform_loop): Remove stmt_vec_info for strided stores after
whole chain vectorization.
* config/rs6000/altivec.md (UNSPEC_EXTEVEN, UNSPEC_EXTODD,
UNSPEC_INTERHI, UNSPEC_INTERLO): New constants.
(vpkuhum_nomode, vpkuwum_nomode, vec_extract_even<mode>,
vec_extract_odd<mode>, altivec_vmrghsf, altivec_vmrglsf,
vec_interleave_high<mode>, vec_interleave_low<mode>): Implement.
From-SVN: r119088
2006-11-22 09:46:03 +01:00
|
|
|
set et_vect_extract_even_odd_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_extract_even_odd: returning $et_vect_extract_even_odd_saved" 2
|
|
|
|
return $et_vect_extract_even_odd_saved
|
|
|
|
}
|
|
|
|
|
2008-08-02 14:05:47 +02:00
|
|
|
# Return 1 if the target supports vector even/odd elements extraction of
|
|
|
|
# vectors with SImode elements or larger, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_extract_even_odd_wide { } {
|
|
|
|
global et_vect_extract_even_odd_wide_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_extract_even_odd_wide_saved] {
|
|
|
|
verbose "check_effective_target_vect_extract_even_odd_wide: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_extract_even_odd_wide_saved 0
|
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [istarget i?86-*-*]
|
spu.md (vec_extract_evenv4si, [...]): Implement.S
2008-08-26 Victor Kaplansky <victork@il.ibm.com>
Dorit Nuzman <dorit@il.ibm.com>
* gcc/config/spu/spu.md (vec_extract_evenv4si,
vec_extract_evenv4sf, vec_extract_evenv8hi,
vec_extract_evenv16qi, vec_extract_oddv4si,
vec_extract_oddv4sf, vec_extract_oddv8hi, vec_extract_oddv16qi,
vec_interleave_highv4sf, vec_interleave_lowv4sf,
vec_interleave_highv4si, vec_interleave_lowv4si,
vec_interleave_highv8hi, vec_interleave_lowv8hi,
vec_interleave_highv16qi, vec_interleave_lowv16qi,
vec_pack_trunc_v8hi, vec_pack_trunc_v4si): Implement.S
Testsuite
* gcc.dg/vect/slp-18.c: Require vect_intfloat_cvt.
* gcc.dg/vect/slp-11.c: Likewise.
* gcc.dg/vect/fast-math-pr35982.c: Likewise.
* lib/target-supports.exp:
(check_effective_target_vect_pack_trunc): Add SPU to the list.
(check_effective_target_vect_extract_even_odd): Likewise.
(check_effective_target_vect_extract_even_odd_wide): Likewise.
(check_effective_target_vect_interleave): Likewise.
Co-Authored-By: Dorit Nuzman <dorit@il.ibm.com>
From-SVN: r139589
2008-08-26 11:14:37 +02:00
|
|
|
|| [istarget x86_64-*-*]
|
|
|
|
|| [istarget spu-*-*] } {
|
2008-08-02 14:05:47 +02:00
|
|
|
set et_vect_extract_even_odd_wide_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_extract_even_wide_odd: returning $et_vect_extract_even_odd_wide_saved" 2
|
|
|
|
return $et_vect_extract_even_odd_wide_saved
|
|
|
|
}
|
|
|
|
|
c-tree.texi: Document new tree codes.
* doc/c-tree.texi: Document new tree codes.
* doc/md.texi: Document new optabs.
* tree-pretty-print.c (dump_generic_node): Handle print of new tree
codes.
* optabs.c (optab_for_tree_code, init_optabs): Handle new optabs.
* optabs.h (optab_index): Add new.
(vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): New optabs.
* genopinit.c (vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): Initialize
new optabs.
* expr.c (expand_expr_real_1): Add implementation for new tree codes.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (stmt_vec_info): Add new fields for interleaving
along with macros for their access.
* tree-data-ref.h (first_location_in_loop, data_reference): Update
comment.
* tree-vect-analyze.c (toplev.h): Include.
(vect_determine_vectorization_factor): Fix indentation.
(vect_insert_into_interleaving_chain,
vect_update_interleaving_chain, vect_equal_offsets): New functions.
(vect_analyze_data_ref_dependence): Add argument for interleaving
check. Check for interleaving if it's true.
(vect_check_dependences): New function.
(vect_analyze_data_ref_dependences): Call vect_check_dependences for
every ddr. Call vect_analyze_data_ref_dependence with new argument.
(vect_update_misalignment_for_peel): Update for interleaving.
(vect_verify_datarefs_alignment): Check only first data-ref for
interleaving.
(vect_enhance_data_refs_alignment): Update for interleaving. Check
only first data-ref for interleaving.
(vect_analyze_data_ref_access): Check interleaving, update
interleaving data.
(vect_analyze_data_refs): Call compute_data_dependences_for_loop
with different parameters.
* tree.def (VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR,
VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): New tree codes.
* tree-inline.c (estimate_num_insns_1): Add cases for new codes.
* tree-vect-transform.c (vect_create_addr_base_for_vector_ref):
Update step in case of interleaving.
(vect_strided_store_supported, vect_permute_store_chain): New
functions.
(vectorizable_store): Handle strided stores.
(vect_strided_load_supported, vect_permute_load_chain,
vect_transform_strided_load): New functions.
(vectorizable_load): Handle strided loads.
(vect_transform_stmt): Add argument. Handle strided stores. Check
that vectorized stmt exists for patterns.
(vect_gen_niters_for_prolog_loop): Update calculation for
interleaving.
(vect_transform_loop): Remove stmt_vec_info for strided stores after
whole chain vectorization.
* config/rs6000/altivec.md (UNSPEC_EXTEVEN, UNSPEC_EXTODD,
UNSPEC_INTERHI, UNSPEC_INTERLO): New constants.
(vpkuhum_nomode, vpkuwum_nomode, vec_extract_even<mode>,
vec_extract_odd<mode>, altivec_vmrghsf, altivec_vmrglsf,
vec_interleave_high<mode>, vec_interleave_low<mode>): Implement.
From-SVN: r119088
2006-11-22 09:46:03 +01:00
|
|
|
# Return 1 if the target supports vector interleaving, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_vect_interleave { } {
|
|
|
|
global et_vect_interleave_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_interleave_saved] {
|
|
|
|
verbose "check_effective_target_vect_interleave: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_interleave_saved 0
|
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [istarget i?86-*-*]
|
spu.md (vec_extract_evenv4si, [...]): Implement.S
2008-08-26 Victor Kaplansky <victork@il.ibm.com>
Dorit Nuzman <dorit@il.ibm.com>
* gcc/config/spu/spu.md (vec_extract_evenv4si,
vec_extract_evenv4sf, vec_extract_evenv8hi,
vec_extract_evenv16qi, vec_extract_oddv4si,
vec_extract_oddv4sf, vec_extract_oddv8hi, vec_extract_oddv16qi,
vec_interleave_highv4sf, vec_interleave_lowv4sf,
vec_interleave_highv4si, vec_interleave_lowv4si,
vec_interleave_highv8hi, vec_interleave_lowv8hi,
vec_interleave_highv16qi, vec_interleave_lowv16qi,
vec_pack_trunc_v8hi, vec_pack_trunc_v4si): Implement.S
Testsuite
* gcc.dg/vect/slp-18.c: Require vect_intfloat_cvt.
* gcc.dg/vect/slp-11.c: Likewise.
* gcc.dg/vect/fast-math-pr35982.c: Likewise.
* lib/target-supports.exp:
(check_effective_target_vect_pack_trunc): Add SPU to the list.
(check_effective_target_vect_extract_even_odd): Likewise.
(check_effective_target_vect_extract_even_odd_wide): Likewise.
(check_effective_target_vect_interleave): Likewise.
Co-Authored-By: Dorit Nuzman <dorit@il.ibm.com>
From-SVN: r139589
2008-08-26 11:14:37 +02:00
|
|
|
|| [istarget x86_64-*-*]
|
|
|
|
|| [istarget spu-*-*] } {
|
c-tree.texi: Document new tree codes.
* doc/c-tree.texi: Document new tree codes.
* doc/md.texi: Document new optabs.
* tree-pretty-print.c (dump_generic_node): Handle print of new tree
codes.
* optabs.c (optab_for_tree_code, init_optabs): Handle new optabs.
* optabs.h (optab_index): Add new.
(vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): New optabs.
* genopinit.c (vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): Initialize
new optabs.
* expr.c (expand_expr_real_1): Add implementation for new tree codes.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (stmt_vec_info): Add new fields for interleaving
along with macros for their access.
* tree-data-ref.h (first_location_in_loop, data_reference): Update
comment.
* tree-vect-analyze.c (toplev.h): Include.
(vect_determine_vectorization_factor): Fix indentation.
(vect_insert_into_interleaving_chain,
vect_update_interleaving_chain, vect_equal_offsets): New functions.
(vect_analyze_data_ref_dependence): Add argument for interleaving
check. Check for interleaving if it's true.
(vect_check_dependences): New function.
(vect_analyze_data_ref_dependences): Call vect_check_dependences for
every ddr. Call vect_analyze_data_ref_dependence with new argument.
(vect_update_misalignment_for_peel): Update for interleaving.
(vect_verify_datarefs_alignment): Check only first data-ref for
interleaving.
(vect_enhance_data_refs_alignment): Update for interleaving. Check
only first data-ref for interleaving.
(vect_analyze_data_ref_access): Check interleaving, update
interleaving data.
(vect_analyze_data_refs): Call compute_data_dependences_for_loop
with different parameters.
* tree.def (VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR,
VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): New tree codes.
* tree-inline.c (estimate_num_insns_1): Add cases for new codes.
* tree-vect-transform.c (vect_create_addr_base_for_vector_ref):
Update step in case of interleaving.
(vect_strided_store_supported, vect_permute_store_chain): New
functions.
(vectorizable_store): Handle strided stores.
(vect_strided_load_supported, vect_permute_load_chain,
vect_transform_strided_load): New functions.
(vectorizable_load): Handle strided loads.
(vect_transform_stmt): Add argument. Handle strided stores. Check
that vectorized stmt exists for patterns.
(vect_gen_niters_for_prolog_loop): Update calculation for
interleaving.
(vect_transform_loop): Remove stmt_vec_info for strided stores after
whole chain vectorization.
* config/rs6000/altivec.md (UNSPEC_EXTEVEN, UNSPEC_EXTODD,
UNSPEC_INTERHI, UNSPEC_INTERLO): New constants.
(vpkuhum_nomode, vpkuwum_nomode, vec_extract_even<mode>,
vec_extract_odd<mode>, altivec_vmrghsf, altivec_vmrglsf,
vec_interleave_high<mode>, vec_interleave_low<mode>): Implement.
From-SVN: r119088
2006-11-22 09:46:03 +01:00
|
|
|
set et_vect_interleave_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_interleave: returning $et_vect_interleave_saved" 2
|
|
|
|
return $et_vect_interleave_saved
|
|
|
|
}
|
|
|
|
|
tree-vectorizer.h (enum vect_def_type): Start enumeration from 1.
* tree-vectorizer.h (enum vect_def_type): Start enumeration from 1.
(struct _slp_tree, struct _slp_instance): Define new data structures
along macros for their access.
(struct _loop_vec_info): Define new fields: strided_stores,
slp_instances, and slp_unrolling_factor along macros for their access.
(enum slp_vect_type): New.
(struct _stmt_vec_info): Define new field, slp_type, and macros for its
access.
(STMT_VINFO_STRIDED_ACCESS): New macro.
(vect_free_slp_tree): Declare.
(vectorizable_load): Add an argument of type slp_tree.
(vectorizable_store, vectorizable_operation, vectorizable_conversion,
vectorizable_assignment): Likewise.
(vect_model_simple_cost, vect_model_store_cost, vect_model_load_cost):
Declare (make extern).
* tree-vectorizer.c (new_stmt_vec_info): Initiliaze the new field.
(new_loop_vec_info): Likewise.
(destroy_loop_vec_info): Free memory allocated for SLP structures.
* tree-vect-analyze.c: Include recog.h.
(vect_update_slp_costs_according_to_vf): New.
(vect_analyze_operations): Add argument for calls to vectorizable_ ()
functions. For not pure SLP stmts with strided access check that the
group size is power of 2. Update the vectorization factor according to
SLP. Call vect_update_slp_costs_according_to_vf.
(vect_analyze_group_access): New.
(vect_analyze_data_ref_access): Call vect_analyze_group_access.
(vect_free_slp_tree): New functions.
(vect_get_and_check_slp_defs, vect_build_slp_tree, vect_print_slp_tree,
vect_mark_slp_stmts, vect_analyze_slp_instance, vect_analyze_slp,
vect_make_slp_decision, vect_detect_hybrid_slp_stmts,
vect_detect_hybrid_slp): Likewise.
(vect_analyze_loop): Call vect_analyze_slp, vect_make_slp_decision
and vect_detect_hybrid_slp.
* tree-vect-transform.c (vect_estimate_min_profitable_iters): Take
SLP costs into account.
(vect_get_cost_fields): New function.
(vect_model_simple_cost): Make extern, add SLP parameter and handle
SLP.
(vect_model_store_cost, vect_model_load_cost): Likewise.
(vect_get_constant_vectors): New function.
(vect_get_slp_vect_defs, vect_get_slp_defs,
vect_get_vec_defs_for_stmt_copy, vect_get_vec_defs_for_stmt_copy,
vect_get_vec_defs): Likewise.
(vectorizable_reduction): Don't handle SLP for now.
(vectorizable_call): Don't handle SLP for now. Add argument to
vect_model_simple_cost.
(vectorizable_conversion): Handle SLP (call vect_get_vec_defs to
get SLPed and vectorized defs). Fix indentation and spacing.
(vectorizable_assignment): Handle SLP.
(vectorizable_induction): Don't handle SLP for now.
(vectorizable_operation): Likewise.
(vectorizable_type_demotion): Add argument to
vect_model_simple_cost.
(vectorizable_type_promotion): Likewise.
(vectorizable_store, vectorizable_load): Handle SLP.
(vectorizable_condition): Don't handle SLP for now.
(vect_transform_stmt): Add a new argument for SLP. Check that there is
no SLP transformation required for unsupported cases. Add SLP
argument for supported cases.
(vect_remove_stores): New function.
(vect_schedule_slp_instance, vect_schedule_slp): Likewise.
(vect_transform_loop): Schedule SLP instances.
* Makefile.in: (tree-vect-analyze.o): Depend on recog.h.
From-SVN: r128289
2007-09-09 10:46:12 +02:00
|
|
|
# Return 1 if the target supports vector interleaving and extract even/odd, 0 otherwise.
|
|
|
|
proc check_effective_target_vect_strided { } {
|
|
|
|
global et_vect_strided_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_strided_saved] {
|
|
|
|
verbose "check_effective_target_vect_strided: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_strided_saved 0
|
|
|
|
if { [check_effective_target_vect_interleave]
|
|
|
|
&& [check_effective_target_vect_extract_even_odd] } {
|
|
|
|
set et_vect_strided_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_strided: returning $et_vect_strided_saved" 2
|
|
|
|
return $et_vect_strided_saved
|
|
|
|
}
|
|
|
|
|
2008-08-02 14:05:47 +02:00
|
|
|
# Return 1 if the target supports vector interleaving and extract even/odd
|
|
|
|
# for wide element types, 0 otherwise.
|
|
|
|
proc check_effective_target_vect_strided_wide { } {
|
|
|
|
global et_vect_strided_wide_saved
|
|
|
|
|
|
|
|
if [info exists et_vect_strided_wide_saved] {
|
|
|
|
verbose "check_effective_target_vect_strided_wide: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_vect_strided_wide_saved 0
|
|
|
|
if { [check_effective_target_vect_interleave]
|
|
|
|
&& [check_effective_target_vect_extract_even_odd_wide] } {
|
|
|
|
set et_vect_strided_wide_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_vect_strided_wide: returning $et_vect_strided_wide_saved" 2
|
|
|
|
return $et_vect_strided_wide_saved
|
|
|
|
}
|
|
|
|
|
2006-08-03 22:35:05 +02:00
|
|
|
# Return 1 if the target supports section-anchors
|
|
|
|
|
|
|
|
proc check_effective_target_section_anchors { } {
|
|
|
|
global et_section_anchors_saved
|
|
|
|
|
|
|
|
if [info exists et_section_anchors_saved] {
|
|
|
|
verbose "check_effective_target_section_anchors: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_section_anchors_saved 0
|
|
|
|
if { [istarget powerpc*-*-*] } {
|
|
|
|
set et_section_anchors_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_section_anchors: returning $et_section_anchors_saved" 2
|
|
|
|
return $et_section_anchors_saved
|
|
|
|
}
|
|
|
|
|
2005-04-20 06:54:11 +02:00
|
|
|
# Return 1 if the target supports atomic operations on "int" and "long".
|
|
|
|
|
|
|
|
proc check_effective_target_sync_int_long { } {
|
|
|
|
global et_sync_int_long_saved
|
|
|
|
|
|
|
|
if [info exists et_sync_int_long_saved] {
|
|
|
|
verbose "check_effective_target_sync_int_long: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_sync_int_long_saved 0
|
Index: ChangeLog
2005-04-21 Geoffrey Keating <geoffk@apple.com>
* config/rs6000/rs6000-protos.h (rs6000_emit_sync): New.
* config/rs6000/rs6000.c (rs6000_emit_vector_compare): Use
gen_rtx_* not gen_rtx_fmt_*.
(rs6000_emit_vector_select): Likewise.
(rs6000_emit_sync): New.
* config/rs6000/rs6000.md (GPR, INT, INT1): New mode macros.
(larx, stcx, cmp): New mode substitutions.
(UNSPEC_SYNC, UNSPEC_SYNC_OP, UNSPEC_SYNC_SWAP, UNSPEC_LWSYNC,
UNSPEC_ISYNC): New constants.
(rlwinm): Give name.
(memory_barrier, isync, lwsync): New insns.
(sync_compare_and_swap<mode>, sync_lock_test_and_set<mode>): New insn.
(sync_lock_release<mode>): New expander.
(sync_add<mode>, sync_sub<mode>, sync_ior<mode>, sync_and<mode>,
sync_xor<mode>, sync_nand<mode>, sync_old_add<mode>,
sync_old_sub<mode>, sync_old_ior<mode>, sync_old_and<mode>,
sync_old_xor<mode>, sync_old_nand<mode>, sync_new_add<mode>,
sync_new_sub<mode>, sync_new_ior<mode>, sync_new_and<mode>,
sync_new_xor<mode>, sync_new_nand<mode>): New expanders.
(sync_add<mode>_internal, sync_addshort_internal,
sync_sub<mode>_internal, sync_andsi_internal, sync_anddi_internal,
sync_boolsi_internal, sync_booldi_internal, sync_boolc<mode>_internal,
sync_boolc<mode>_internal2, sync_boolcc<mode>_internal): New insns.
* doc/md.texi (Standard Names): sync_compare_and_swap's operand 0
is the memory before, not after, the operation. Clarify
barrier requirements.
Index: testsuite/ChangeLog
2005-04-21 Geoffrey Keating <geoffk@apple.com>
* lib/target-supports.exp (check_effective_target_sync_int_long):
Add powerpc*.
From-SVN: r98527
2005-04-21 23:13:41 +02:00
|
|
|
# This is intentionally powerpc but not rs6000, rs6000 doesn't have the
|
|
|
|
# load-reserved/store-conditional instructions.
|
2005-04-20 06:54:11 +02:00
|
|
|
if { [istarget ia64-*-*]
|
|
|
|
|| [istarget i?86-*-*]
|
|
|
|
|| [istarget x86_64-*-*]
|
Index: ChangeLog
2005-04-21 Geoffrey Keating <geoffk@apple.com>
* config/rs6000/rs6000-protos.h (rs6000_emit_sync): New.
* config/rs6000/rs6000.c (rs6000_emit_vector_compare): Use
gen_rtx_* not gen_rtx_fmt_*.
(rs6000_emit_vector_select): Likewise.
(rs6000_emit_sync): New.
* config/rs6000/rs6000.md (GPR, INT, INT1): New mode macros.
(larx, stcx, cmp): New mode substitutions.
(UNSPEC_SYNC, UNSPEC_SYNC_OP, UNSPEC_SYNC_SWAP, UNSPEC_LWSYNC,
UNSPEC_ISYNC): New constants.
(rlwinm): Give name.
(memory_barrier, isync, lwsync): New insns.
(sync_compare_and_swap<mode>, sync_lock_test_and_set<mode>): New insn.
(sync_lock_release<mode>): New expander.
(sync_add<mode>, sync_sub<mode>, sync_ior<mode>, sync_and<mode>,
sync_xor<mode>, sync_nand<mode>, sync_old_add<mode>,
sync_old_sub<mode>, sync_old_ior<mode>, sync_old_and<mode>,
sync_old_xor<mode>, sync_old_nand<mode>, sync_new_add<mode>,
sync_new_sub<mode>, sync_new_ior<mode>, sync_new_and<mode>,
sync_new_xor<mode>, sync_new_nand<mode>): New expanders.
(sync_add<mode>_internal, sync_addshort_internal,
sync_sub<mode>_internal, sync_andsi_internal, sync_anddi_internal,
sync_boolsi_internal, sync_booldi_internal, sync_boolc<mode>_internal,
sync_boolc<mode>_internal2, sync_boolcc<mode>_internal): New insns.
* doc/md.texi (Standard Names): sync_compare_and_swap's operand 0
is the memory before, not after, the operation. Clarify
barrier requirements.
Index: testsuite/ChangeLog
2005-04-21 Geoffrey Keating <geoffk@apple.com>
* lib/target-supports.exp (check_effective_target_sync_int_long):
Add powerpc*.
From-SVN: r98527
2005-04-21 23:13:41 +02:00
|
|
|
|| [istarget alpha*-*-*]
|
2005-06-07 21:27:01 +02:00
|
|
|
|| [istarget s390*-*-*]
|
2006-01-03 10:06:36 +01:00
|
|
|
|| [istarget powerpc*-*-*]
|
|
|
|
|| [istarget sparc64-*-*]
|
2008-05-08 19:04:12 +02:00
|
|
|
|| [istarget sparcv9-*-*]
|
|
|
|
|| [istarget mips*-*-*] } {
|
2005-04-20 06:54:11 +02:00
|
|
|
set et_sync_int_long_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_sync_int_long: returning $et_sync_int_long_saved" 2
|
|
|
|
return $et_sync_int_long_saved
|
|
|
|
}
|
|
|
|
|
2005-06-02 23:45:57 +02:00
|
|
|
# Return 1 if the target supports atomic operations on "char" and "short".
|
|
|
|
|
|
|
|
proc check_effective_target_sync_char_short { } {
|
|
|
|
global et_sync_char_short_saved
|
|
|
|
|
|
|
|
if [info exists et_sync_char_short_saved] {
|
|
|
|
verbose "check_effective_target_sync_char_short: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_sync_char_short_saved 0
|
|
|
|
# This is intentionally powerpc but not rs6000, rs6000 doesn't have the
|
|
|
|
# load-reserved/store-conditional instructions.
|
|
|
|
if { [istarget ia64-*-*]
|
|
|
|
|| [istarget i?86-*-*]
|
|
|
|
|| [istarget x86_64-*-*]
|
alpha.c (emit_insxl, [...]): New functions.
* config/alpha/alpha.c (emit_insxl, alpha_expand_compare_and_swap_12,
alpha_split_compare_and_swap_12, alpha_expand_lock_test_and_set_12,
alpha_split_lock_test_and_set_12): New functions.
* config/alpha/alpha-protos.h: Update.
* config/alpha/alpha.md (UNSPEC_MB, UNSPEC_ATOMIC,
UNSPEC_CMPXCHG, UNSPEC_XCHG): Rename from UNSPECV_FOO.
* config/alpha/sync.md (I12MODE): New.
(memory_barrier, mb_internal): Use unspec instead of unspec_volatile.
(sync_<fetchop_name><I48MODE>): Likewise.
(sync_nand<I48MODE>): Likewise.
(sync_old_<fetchop_name><I48MODE>): Likewise.
(sync_new_<fetchop_name><I48MODE>): Likewise.
(sync_old_nand<I48MODE>, sync_new_nand<I48MODE>): Likewise.
(sync_compare_and_swap<I48MODE>): Likewise.
(sync_lock_test_and_set<I48MODE>): Likewise.
(sync_compare_and_swap<I12MODE>): New.
(sync_compare_and_swap<I12MODE>_1): New.
(sync_lock_test_and_set<I12MODE>): New.
(sync_lock_test_and_set<I12MODE>_1): New.
* lib/target-supports.exp (check_effective_target_sync_char_short):
Add alpha.
From-SVN: r101833
2005-07-09 20:28:23 +02:00
|
|
|
|| [istarget alpha*-*-*]
|
2005-12-07 20:56:32 +01:00
|
|
|
|| [istarget s390*-*-*]
|
2006-01-03 10:06:36 +01:00
|
|
|
|| [istarget powerpc*-*-*]
|
|
|
|
|| [istarget sparc64-*-*]
|
2008-05-08 19:04:12 +02:00
|
|
|
|| [istarget sparcv9-*-*]
|
|
|
|
|| [istarget mips*-*-*] } {
|
2005-06-02 23:45:57 +02:00
|
|
|
set et_sync_char_short_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_sync_char_short: returning $et_sync_char_short_saved" 2
|
|
|
|
return $et_sync_char_short_saved
|
|
|
|
}
|
|
|
|
|
2007-02-09 14:49:14 +01:00
|
|
|
# Return 1 if the target uses a ColdFire FPU.
|
|
|
|
|
|
|
|
proc check_effective_target_coldfire_fpu { } {
|
|
|
|
return [check_no_compiler_messages coldfire_fpu assembly {
|
|
|
|
#ifndef __mcffpu__
|
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2007-02-09 14:51:23 +01:00
|
|
|
# Return true if this is a uClibc target.
|
|
|
|
|
|
|
|
proc check_effective_target_uclibc {} {
|
|
|
|
return [check_no_compiler_messages uclibc object {
|
|
|
|
#include <features.h>
|
|
|
|
#if !defined (__UCLIBC__)
|
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2007-03-15 22:22:59 +01:00
|
|
|
# Return true if this is a uclibc target and if the uclibc feature
|
|
|
|
# described by __$feature__ is not present.
|
|
|
|
|
|
|
|
proc check_missing_uclibc_feature {feature} {
|
2007-03-16 10:56:18 +01:00
|
|
|
return [check_no_compiler_messages $feature object "
|
|
|
|
#include <features.h>
|
2007-03-16 11:02:02 +01:00
|
|
|
#if !defined (__UCLIBC) || defined (__${feature}__)
|
2007-03-16 10:56:18 +01:00
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
"]
|
2007-03-15 22:22:59 +01:00
|
|
|
}
|
|
|
|
|
2007-02-23 23:08:01 +01:00
|
|
|
# Return true if this is a Newlib target.
|
|
|
|
|
|
|
|
proc check_effective_target_newlib {} {
|
|
|
|
return [check_no_compiler_messages newlib object {
|
|
|
|
#include <newlib.h>
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2007-02-09 14:56:16 +01:00
|
|
|
# Return 1 if
|
|
|
|
# (a) an error of a few ULP is expected in string to floating-point
|
|
|
|
# conversion functions; and
|
|
|
|
# (b) overflow is not always detected correctly by those functions.
|
|
|
|
|
|
|
|
proc check_effective_target_lax_strtofp {} {
|
|
|
|
# By default, assume that all uClibc targets suffer from this.
|
|
|
|
return [check_effective_target_uclibc]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if this is a target for which wcsftime is a dummy
|
|
|
|
# function that always returns 0.
|
|
|
|
|
|
|
|
proc check_effective_target_dummy_wcsftime {} {
|
|
|
|
# By default, assume that all uClibc targets suffer from this.
|
|
|
|
return [check_effective_target_uclibc]
|
|
|
|
}
|
|
|
|
|
2007-02-25 19:47:05 +01:00
|
|
|
# Return 1 if constructors with initialization priority arguments are
|
|
|
|
# supposed on this target.
|
|
|
|
|
|
|
|
proc check_effective_target_init_priority {} {
|
|
|
|
return [check_no_compiler_messages init_priority assembly "
|
|
|
|
void f() __attribute__((constructor (1000)));
|
|
|
|
void f() \{\}
|
|
|
|
"]
|
|
|
|
}
|
|
|
|
|
2004-11-12 02:11:01 +01:00
|
|
|
# Return 1 if the target matches the effective target 'arg', 0 otherwise.
|
|
|
|
# This can be used with any check_* proc that takes no argument and
|
|
|
|
# returns only 1 or 0. It could be used with check_* procs that take
|
|
|
|
# arguments with keywords that pass particular arguments.
|
|
|
|
|
|
|
|
proc is-effective-target { arg } {
|
|
|
|
set selected 0
|
2004-11-30 22:30:27 +01:00
|
|
|
if { [info procs check_effective_target_${arg}] != [list] } {
|
|
|
|
set selected [check_effective_target_${arg}]
|
|
|
|
} else {
|
|
|
|
switch $arg {
|
|
|
|
"vmx_hw" { set selected [check_vmx_hw_available] }
|
|
|
|
"named_sections" { set selected [check_named_sections_available] }
|
|
|
|
"gc_sections" { set selected [check_gc_sections_available] }
|
2006-06-02 01:21:14 +02:00
|
|
|
"cxa_atexit" { set selected [check_cxa_atexit_available] }
|
2004-11-30 22:30:27 +01:00
|
|
|
default { error "unknown effective target keyword `$arg'" }
|
|
|
|
}
|
2004-11-12 02:11:01 +01:00
|
|
|
}
|
|
|
|
verbose "is-effective-target: $arg $selected" 2
|
|
|
|
return $selected
|
|
|
|
}
|
2004-12-02 01:05:15 +01:00
|
|
|
|
|
|
|
# Return 1 if the argument is an effective-target keyword, 0 otherwise.
|
|
|
|
|
|
|
|
proc is-effective-target-keyword { arg } {
|
|
|
|
if { [info procs check_effective_target_${arg}] != [list] } {
|
|
|
|
return 1
|
|
|
|
} else {
|
|
|
|
# These have different names for their check_* procs.
|
|
|
|
switch $arg {
|
|
|
|
"vmx_hw" { return 1 }
|
|
|
|
"named_sections" { return 1 }
|
|
|
|
"gc_sections" { return 1 }
|
2006-06-02 01:21:14 +02:00
|
|
|
"cxa_atexit" { return 1 }
|
2004-12-02 01:05:15 +01:00
|
|
|
default { return 0 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-01-26 05:08:39 +01:00
|
|
|
|
|
|
|
# Return 1 if target default to short enums
|
|
|
|
|
|
|
|
proc check_effective_target_short_enums { } {
|
2006-03-21 00:22:13 +01:00
|
|
|
return [check_no_compiler_messages short_enums assembly {
|
|
|
|
enum foo { bar };
|
|
|
|
int s[sizeof (enum foo) == 1 ? 1 : -1];
|
|
|
|
}]
|
2006-01-26 05:08:39 +01:00
|
|
|
}
|
|
|
|
|
2006-08-02 15:31:56 +02:00
|
|
|
# Return 1 if target supports merging string constants at link time.
|
|
|
|
|
|
|
|
proc check_effective_target_string_merging { } {
|
|
|
|
return [check_no_messages_and_pattern string_merging \
|
|
|
|
"rodata\\.str" assembly {
|
|
|
|
const char *var = "String";
|
|
|
|
} {-O2}]
|
|
|
|
}
|
2006-12-15 22:41:58 +01:00
|
|
|
|
|
|
|
# Return 1 if target has the basic signed and unsigned types in
|
re PR c/448 (<stdint.h>-related issues (C99 issues))
PR c/448
fixincludes:
* inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes.
* fixincl.x: Regenerate.
* tests/base/stdint.h: Update.
gcc:
* Makefile.in (USE_GCC_STDINT): Define.
(stmp-int-hdrs): Install stdint.h if applicable.
* c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE
if known.
(CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known.
(SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE,
UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE,
INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define.
(c_common_nodes_and_builtins): Initialize
underlying_wchar_type_node. Do not initialize
signed_wchar_type_node or unsigned_wchar_type_node. Initialize
nodes for new types.
(c_stddef_cpp_builtins): Define macros for new types.
* c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE):
Remove.
(CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE,
CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE,
CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE,
CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE,
CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE,
CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE,
CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE,
CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE,
CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define.
(signed_wchar_type_node, unsigned_wchar_type_node): Remove.
(underlying_wchar_type_node, sig_atomic_type_node, int8_type_node,
int16_type_node, int32_type_node, int64_type_node,
uint8_type_node, uint16_type_node, c_uint32_type_node,
c_uint64_type_node, int_least8_type_node, int_least16_type_node,
int_least32_type_node, int_least64_type_node,
uint_least8_type_node, uint_least16_type_node,
uint_least32_type_node, uint_least64_type_node,
int_fast8_type_node, int_fast16_type_node, int_fast32_type_node,
int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node,
uint_fast32_type_node, uint_fast64_type_node, intptr_type_node,
uintptr_type_node): Define.
* c-cppbuiltin.c (builtin_define_constants,
builtin_define_type_minmax): New.
(builtin_define_stdint_macros): Define more macros.
(c_cpp_builtins): Define more limit macros.
(type_suffix): New.
(builtin_define_type_max): Define in terms of
builtin_define_type_minmax. Remove is_long parameter. All
callers changed.
* config.gcc (use_gcc_stdint): Define.
(tm_file): Add glibc-stdint.h for targets using glibc or uClibc.
Add newlib-stdint.h for generic targets.
* config/glibc-stdint.h, config/newlib-stdint.h,
ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New.
* config/m32c/m32c.h (UINTPTR_TYPE): Define.
* config/score/score.h (UINTPTR_TYPE): Define.
* config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE,
INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE,
UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define.
* config/spu/spu.h (STDINT_LONG32): Define.
* configure.ac (use_gcc_stdint): Substitute.
* configure: Regenerate.
* doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__,
__INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__,
__UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__,
__INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__,
__INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__,
__UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__,
__INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__,
__UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__,
__UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__,
__WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__,
__SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__,
__INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__,
__UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__,
__INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__,
__UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__,
__INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__,
__INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__,
__UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__,
__UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__,
__INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C,
__UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document.
* doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE,
INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE,
INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document.
gcc/testsuite:
* lib/target-supports.exp (check_effective_target_stdint_types):
Update comment.
(check_effective_target_inttypes_types): New.
* gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c,
gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c,
gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests.
From-SVN: r145372
2009-03-31 22:30:31 +02:00
|
|
|
# <stdint.h>, 0 otherwise. This will be obsolete when GCC ensures a
|
|
|
|
# working <stdint.h> for all targets.
|
2006-12-15 22:41:58 +01:00
|
|
|
|
|
|
|
proc check_effective_target_stdint_types { } {
|
|
|
|
return [check_no_compiler_messages stdint_types assembly {
|
|
|
|
#include <stdint.h>
|
|
|
|
int8_t a; int16_t b; int32_t c; int64_t d;
|
|
|
|
uint8_t e; uint16_t f; uint32_t g; uint64_t h;
|
|
|
|
}]
|
|
|
|
}
|
2007-02-07 11:08:50 +01:00
|
|
|
|
re PR c/448 (<stdint.h>-related issues (C99 issues))
PR c/448
fixincludes:
* inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes.
* fixincl.x: Regenerate.
* tests/base/stdint.h: Update.
gcc:
* Makefile.in (USE_GCC_STDINT): Define.
(stmp-int-hdrs): Install stdint.h if applicable.
* c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE
if known.
(CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known.
(SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE,
UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE,
INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define.
(c_common_nodes_and_builtins): Initialize
underlying_wchar_type_node. Do not initialize
signed_wchar_type_node or unsigned_wchar_type_node. Initialize
nodes for new types.
(c_stddef_cpp_builtins): Define macros for new types.
* c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE):
Remove.
(CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE,
CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE,
CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE,
CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE,
CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE,
CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE,
CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE,
CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE,
CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define.
(signed_wchar_type_node, unsigned_wchar_type_node): Remove.
(underlying_wchar_type_node, sig_atomic_type_node, int8_type_node,
int16_type_node, int32_type_node, int64_type_node,
uint8_type_node, uint16_type_node, c_uint32_type_node,
c_uint64_type_node, int_least8_type_node, int_least16_type_node,
int_least32_type_node, int_least64_type_node,
uint_least8_type_node, uint_least16_type_node,
uint_least32_type_node, uint_least64_type_node,
int_fast8_type_node, int_fast16_type_node, int_fast32_type_node,
int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node,
uint_fast32_type_node, uint_fast64_type_node, intptr_type_node,
uintptr_type_node): Define.
* c-cppbuiltin.c (builtin_define_constants,
builtin_define_type_minmax): New.
(builtin_define_stdint_macros): Define more macros.
(c_cpp_builtins): Define more limit macros.
(type_suffix): New.
(builtin_define_type_max): Define in terms of
builtin_define_type_minmax. Remove is_long parameter. All
callers changed.
* config.gcc (use_gcc_stdint): Define.
(tm_file): Add glibc-stdint.h for targets using glibc or uClibc.
Add newlib-stdint.h for generic targets.
* config/glibc-stdint.h, config/newlib-stdint.h,
ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New.
* config/m32c/m32c.h (UINTPTR_TYPE): Define.
* config/score/score.h (UINTPTR_TYPE): Define.
* config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE,
INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE,
UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define.
* config/spu/spu.h (STDINT_LONG32): Define.
* configure.ac (use_gcc_stdint): Substitute.
* configure: Regenerate.
* doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__,
__INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__,
__UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__,
__INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__,
__INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__,
__UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__,
__INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__,
__UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__,
__UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__,
__WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__,
__SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__,
__INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__,
__UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__,
__INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__,
__UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__,
__INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__,
__INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__,
__UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__,
__UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__,
__INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C,
__UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document.
* doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE,
INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE,
INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document.
gcc/testsuite:
* lib/target-supports.exp (check_effective_target_stdint_types):
Update comment.
(check_effective_target_inttypes_types): New.
* gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c,
gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c,
gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests.
From-SVN: r145372
2009-03-31 22:30:31 +02:00
|
|
|
# Return 1 if target has the basic signed and unsigned types in
|
|
|
|
# <inttypes.h>, 0 otherwise. This is for tests that GCC's notions of
|
|
|
|
# these types agree with those in the header, as some systems have
|
|
|
|
# only <inttypes.h>.
|
|
|
|
|
|
|
|
proc check_effective_target_inttypes_types { } {
|
|
|
|
return [check_no_compiler_messages inttypes_types assembly {
|
|
|
|
#include <inttypes.h>
|
|
|
|
int8_t a; int16_t b; int32_t c; int64_t d;
|
|
|
|
uint8_t e; uint16_t f; uint32_t g; uint64_t h;
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2007-02-07 11:08:50 +01:00
|
|
|
# Return 1 if programs are intended to be run on a simulator
|
|
|
|
# (i.e. slowly) rather than hardware (i.e. fast).
|
|
|
|
|
|
|
|
proc check_effective_target_simulator { } {
|
|
|
|
|
|
|
|
# All "src/sim" simulators set this one.
|
|
|
|
if [board_info target exists is_simulator] {
|
|
|
|
return [board_info target is_simulator]
|
|
|
|
}
|
|
|
|
|
|
|
|
# The "sid" simulators don't set that one, but at least they set
|
|
|
|
# this one.
|
|
|
|
if [board_info target exists slow_simulator] {
|
|
|
|
return [board_info target slow_simulator]
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
2007-03-12 11:44:52 +01:00
|
|
|
|
2008-04-09 11:13:23 +02:00
|
|
|
# Return 1 if the target is a VxWorks kernel.
|
2007-03-12 11:44:52 +01:00
|
|
|
|
|
|
|
proc check_effective_target_vxworks_kernel { } {
|
|
|
|
return [check_no_compiler_messages vxworks_kernel assembly {
|
|
|
|
#if !defined __vxworks || defined __RTP__
|
|
|
|
#error NO
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
}
|
2007-03-15 22:22:59 +01:00
|
|
|
|
2008-04-09 11:13:23 +02:00
|
|
|
# Return 1 if the target is a VxWorks RTP.
|
|
|
|
|
|
|
|
proc check_effective_target_vxworks_rtp { } {
|
|
|
|
return [check_no_compiler_messages vxworks_rtp assembly {
|
|
|
|
#if !defined __vxworks || !defined __RTP__
|
|
|
|
#error NO
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2007-03-15 22:22:59 +01:00
|
|
|
# Return 1 if the target is expected to provide wide character support.
|
|
|
|
|
|
|
|
proc check_effective_target_wchar { } {
|
|
|
|
if {[check_missing_uclibc_feature UCLIBC_HAS_WCHAR]} {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
return [check_no_compiler_messages wchar assembly {
|
|
|
|
#include <wchar.h>
|
|
|
|
}]
|
|
|
|
}
|
2007-09-22 10:25:43 +02:00
|
|
|
|
2008-02-26 01:11:06 +01:00
|
|
|
# Return 1 if the target has <pthread.h>.
|
|
|
|
|
|
|
|
proc check_effective_target_pthread_h { } {
|
|
|
|
return [check_no_compiler_messages pthread_h assembly {
|
|
|
|
#include <pthread.h>
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
re PR libfortran/19872 ([4.0 only] closed and re-opened file not overwriten)
* lib/lib/target-supports.exp (check_effective_target_fd_truncate):
New.
* gfortran.fortran-torture/execute/list_read_1.x,
gfortran.fortran-torture/execute/read_null_string.x,
gfortran.fortran-torture/execute/backspace.x,
gfortran.fortran-torture/execute/seq_io.x,
gfortran.fortran-torture/execute/slash_edit.x,
gfortran.fortran-torture/execute/unopened_unit_1.x,
gfortran.dg/namelist_21.f90, gfortran.dg/advance_5.f90,
gfortran.dg/fmt_t_7.f, gfortran.dg/eor_1.f90,
gfortran.dg/read_x_past.f, gfortran.dg/tl_editing.f90,
gfortran.dg/ftell_2.f90, gfortran.dg/namelist_13.f90,
gfortran.dg/namelist_22.f90, gfortran.dg/advance_6.f90,
gfortran.dg/read_bad_advance.f90, gfortran.dg/func_derived_3.f90,
gfortran.dg/namelist_40.f90, gfortran.dg/x_slash_2.f,
gfortran.dg/namelist_14.f90, gfortran.dg/backspace_1.f,
gfortran.dg/namelist_23.f90, gfortran.dg/pr17285.f90,
gfortran.dg/read_noadvance.f90, gfortran.dg/namelist_use_only.f90,
gfortran.dg/namelist_41.f90, gfortran.dg/namelist_15.f90,
gfortran.dg/backspace_3.f, gfortran.dg/backslash_3.f,
gfortran.dg/namelist_24.f90, gfortran.dg/pr17286.f90,
gfortran.dg/endfile.f90, gfortran.dg/open_access_append_1.f90,
gfortran.dg/fmt_huge.f90, gfortran.dg/namelist_42.f90,
gfortran.dg/pr18392.f90, gfortran.dg/pr19155.f, gfortran.dg/pr12884.f,
gfortran.dg/namelist_16.f90, gfortran.dg/backspace_5.f,
gfortran.dg/open_readonly_1.f90, gfortran.dg/fmt_read.f90,
gfortran.dg/iostat_1.f90, gfortran.dg/namelist_43.f90,
gfortran.dg/read_size_noadvance.f90, gfortran.dg/inquire_5.f90,
gfortran.dg/read_many_1.f, gfortran.dg/namelist_17.f90,
gfortran.dg/list_read_1.f90, gfortran.dg/backspace_10.f90,
gfortran.dg/namelist_26.f90, gfortran.dg/unf_read_corrupted_2.f90,
gfortran.dg/record_marker_1.f90, gfortran.dg/convert_implied_open.f90,
gfortran.dg/iostat_2.f90, gfortran.dg/write_check3.f90,
gfortran.dg/namelist_44.f90, gfortran.dg/namelist_use.f90,
gfortran.dg/rewind_1.f90, gfortran.dg/streamio_11.f90,
gfortran.dg/namelist_18.f90, gfortran.dg/backspace_9.f,
gfortran.dg/dos_eol.f, gfortran.dg/read_eof_1.f90,
gfortran.dg/namelist_27.f90, gfortran.dg/pad_no.f90,
gfortran.dg/endfile.f, gfortran.dg/namelist_11.f,
gfortran.dg/namelist_19.f90, gfortran.dg/eor_handling_1.f90,
gfortran.dg/write_rewind_1.f, gfortran.dg/comma.f,
gfortran.dg/read_eof_2.f90, gfortran.dg/namelist_28.f90,
gfortran.dg/record_marker_3.f90, gfortran.dg/complex_read.f90,
gfortran.dg/namelist_37.f90, gfortran.dg/error_recovery_5.f90,
gfortran.dg/namelist_char_only.f90, gfortran.dg/pr18122.f90,
gfortran.dg/list_read_4.f90, gfortran.dg/eor_handling_2.f90,
gfortran.dg/read_eof_3.f90, gfortran.dg/dollar_edit_descriptor_1.f,
gfortran.dg/pr19467.f90, gfortran.dg/namelist_38.f90,
gfortran.dg/inquire_9.f90, gfortran.dg/list_read_5.f90,
gfortran.dg/noadv_size.f90, gfortran.dg/backslash_1.f90,
gfortran.dg/eor_handling_3.f90, gfortran.dg/read_eof_4.f90,
gfortran.dg/runtime_warning_1.f90, gfortran.dg/x_slash_1.f,
gfortran.dg/namelist_39.f90, gfortran.dg/streamio_3.f90,
gfortran.dg/read_comma.f, gfortran.dg/pr19657.f,
gfortran.dg/streamio_15.f90, gfortran.dg/list_read_6.f90,
gfortran.dg/eor_handling_4.f90, gfortran.dg/backslash_2.f90,
gfortran.dg/pr19216.f, gfortran.dg/PR19872.f,
gfortran.dg/backspace_2.f, gfortran.dg/empty_format_1.f90,
gfortran.dg/streamio_4.f90, gfortran.dg/append_1.f90,
gfortran.dg/fgetc_1.f90, gfortran.dg/complex_write.f90,
gfortran.dg/list_read_7.f90, gfortran.dg/eor_handling_5.f90,
gfortran.dg/fmt_t_1.f90, gfortran.dg/pr17090.f90,
gfortran.dg/backspace_4.f, gfortran.dg/shape_3.f90,
gfortran.dg/unf_io_convert_1.f90, gfortran.dg/fgetc_2.f90,
gfortran.dg/vector_subscript_3.f90, gfortran.dg/list_read_8.f90,
gfortran.dg/flush_1.f90, gfortran.dg/advance_1.f90,
gfortran.dg/fmt_t_2.f90, gfortran.dg/backspace_6.f,
gfortran.dg/slash_1.f90, gfortran.dg/stat_1.f90,
gfortran.dg/unformatted_recl_1.f90, gfortran.dg/record_marker_2.f,
gfortran.dg/overwrite_1.f, gfortran.dg/unf_io_convert_2.f90,
gfortran.dg/fmt_t_3.f90, gfortran.dg/backspace_8.f,
gfortran.dg/stat_2.f90, gfortran.dg/pr18210.f90,
gfortran.dg/unformatted_subrecord_1.f90, gfortran.dg/pr20257.f90,
gfortran.dg/eof_1.f90, gfortran.dg/fmt_t_4.f90,
gfortran.dg/unf_short_record_1.f90, gfortran.dg/fmt_exhaust.f90,
gfortran.dg/namelist_20.f90, gfortran.dg/advance_4.f90,
gfortran.dg/fmt_t_5.f90, gfortran.dg/namelist_12.f,
gfortran.dg/backspace_7.f90, gfortran.dg/write_rewind_2.f,
gfortran.dg/ftell_1.f90, gfortran.dg/fseek.f90,
gfortran.dg/write_back.f: Gate test on effective_target
fd_truncate.
From-SVN: r132885
2008-03-05 01:59:34 +01:00
|
|
|
# Return 1 if the target can truncate a file from a file-descriptor,
|
|
|
|
# as used by libgfortran/io/unix.c:fd_truncate; i.e. ftruncate or
|
|
|
|
# chsize. We test for a trivially functional truncation; no stubs.
|
|
|
|
# As libgfortran uses _FILE_OFFSET_BITS 64, we do too; it'll cause a
|
|
|
|
# different function to be used.
|
|
|
|
|
|
|
|
proc check_effective_target_fd_truncate { } {
|
|
|
|
set prog {
|
|
|
|
#define _FILE_OFFSET_BITS 64
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
int main ()
|
|
|
|
{
|
|
|
|
FILE *f = fopen ("tst.tmp", "wb");
|
|
|
|
int fd;
|
|
|
|
const char t[] = "test writing more than ten characters";
|
|
|
|
char s[11];
|
|
|
|
fd = fileno (f);
|
|
|
|
write (fd, t, sizeof (t) - 1);
|
|
|
|
lseek (fd, 0, 0);
|
|
|
|
if (ftruncate (fd, 10) != 0)
|
|
|
|
exit (1);
|
|
|
|
close (fd);
|
|
|
|
f = fopen ("tst.tmp", "rb");
|
|
|
|
if (fread (s, 1, sizeof (s), f) != 10 || strncmp (s, t, 10) != 0)
|
|
|
|
exit (1);
|
|
|
|
exit (0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if { [check_runtime ftruncate $prog] } {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
regsub "ftruncate" $prog "chsize" prog
|
|
|
|
return [check_runtime chsize $prog]
|
|
|
|
}
|
|
|
|
|
2007-09-22 10:25:43 +02:00
|
|
|
# Add to FLAGS all the target-specific flags needed to access the c99 runtime.
|
|
|
|
|
|
|
|
proc add_options_for_c99_runtime { flags } {
|
|
|
|
if { [istarget *-*-solaris2*] } {
|
|
|
|
return "$flags -std=c99"
|
|
|
|
}
|
|
|
|
if { [istarget powerpc-*-darwin*] } {
|
|
|
|
return "$flags -mmacosx-version-min=10.3"
|
|
|
|
}
|
|
|
|
return $flags
|
|
|
|
}
|
2007-09-22 10:26:50 +02:00
|
|
|
|
|
|
|
# Return 1 if the target provides a full C99 runtime.
|
|
|
|
|
|
|
|
proc check_effective_target_c99_runtime { } {
|
|
|
|
return [check_cached_effective_target c99_runtime {
|
|
|
|
global srcdir
|
|
|
|
|
|
|
|
set file [open "$srcdir/gcc.dg/builtins-config.h"]
|
|
|
|
set contents [read $file]
|
|
|
|
close $file
|
|
|
|
append contents {
|
|
|
|
#ifndef HAVE_C99_RUNTIME
|
|
|
|
#error FOO
|
|
|
|
#endif
|
|
|
|
}
|
2007-12-04 11:16:17 +01:00
|
|
|
check_no_compiler_messages_nocache c99_runtime assembly \
|
|
|
|
$contents [add_options_for_c99_runtime ""]
|
2007-09-22 10:26:50 +02:00
|
|
|
}]
|
|
|
|
}
|
2008-05-06 04:59:12 +02:00
|
|
|
|
|
|
|
# Return 1 if target wchar_t is at least 4 bytes.
|
|
|
|
|
|
|
|
proc check_effective_target_4byte_wchar_t { } {
|
|
|
|
return [check_no_compiler_messages 4byte_wchar_t object {
|
2008-05-06 20:37:03 +02:00
|
|
|
int dummy[sizeof (__WCHAR_TYPE__) >= 4 ? 1 : -1];
|
2008-05-06 04:59:12 +02:00
|
|
|
}]
|
|
|
|
}
|
2008-07-30 21:24:02 +02:00
|
|
|
|
|
|
|
# Return 1 if the target supports automatic stack alignment.
|
|
|
|
|
|
|
|
proc check_effective_target_automatic_stack_alignment { } {
|
|
|
|
if { [istarget i?86*-*-*]
|
|
|
|
|| [istarget x86_64-*-*] } then {
|
|
|
|
return 1
|
|
|
|
} else {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
2008-08-28 21:36:58 +02:00
|
|
|
|
|
|
|
# Return 1 if avx instructions can be compiled.
|
|
|
|
|
|
|
|
proc check_effective_target_avx { } {
|
|
|
|
return [check_no_compiler_messages avx object {
|
|
|
|
void _mm256_zeroall (void)
|
|
|
|
{
|
|
|
|
__builtin_ia32_vzeroall ();
|
|
|
|
}
|
|
|
|
} "-O2 -mavx" ]
|
|
|
|
}
|
2008-09-17 18:05:11 +02:00
|
|
|
|
|
|
|
# Return 1 if C wchar_t type is compatible with char16_t.
|
|
|
|
|
|
|
|
proc check_effective_target_wchar_t_char16_t_compatible { } {
|
|
|
|
return [check_no_compiler_messages wchar_t_char16_t object {
|
|
|
|
__WCHAR_TYPE__ wc;
|
|
|
|
__CHAR16_TYPE__ *p16 = &wc;
|
|
|
|
char t[(((__CHAR16_TYPE__) -1) < 0 == ((__WCHAR_TYPE__) -1) < 0) ? 1 : -1];
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if C wchar_t type is compatible with char32_t.
|
|
|
|
|
|
|
|
proc check_effective_target_wchar_t_char32_t_compatible { } {
|
|
|
|
return [check_no_compiler_messages wchar_t_char32_t object {
|
|
|
|
__WCHAR_TYPE__ wc;
|
|
|
|
__CHAR32_TYPE__ *p32 = &wc;
|
|
|
|
char t[(((__CHAR32_TYPE__) -1) < 0 == ((__WCHAR_TYPE__) -1) < 0) ? 1 : -1];
|
|
|
|
}]
|
|
|
|
}
|
2008-09-23 23:27:17 +02:00
|
|
|
|
|
|
|
# Return 1 if pow10 function exists.
|
|
|
|
|
|
|
|
proc check_effective_target_pow10 { } {
|
|
|
|
return [check_runtime pow10 {
|
|
|
|
#include <math.h>
|
|
|
|
int main () {
|
|
|
|
double x;
|
|
|
|
x = pow10 (1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
} "-lm" ]
|
|
|
|
}
|
2008-12-05 22:05:53 +01:00
|
|
|
|
|
|
|
# Return 1 if current options generate DFP instructions, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_hard_dfp {} {
|
|
|
|
return [check_no_messages_and_pattern hard_dfp "!adddd3" assembly {
|
|
|
|
_Decimal64 x, y, z;
|
|
|
|
void foo (void) { z = x + y; }
|
|
|
|
}]
|
|
|
|
}
|
2009-02-02 12:27:50 +01:00
|
|
|
|
|
|
|
# Return 1 if string.h and wchar.h headers provide C++ requires overloads
|
|
|
|
# for strchr etc. functions.
|
|
|
|
|
|
|
|
proc check_effective_target_correct_iso_cpp_string_wchar_protos { } {
|
|
|
|
return [check_no_compiler_messages correct_iso_cpp_string_wchar_protos assembly {
|
|
|
|
#include <string.h>
|
|
|
|
#include <wchar.h>
|
|
|
|
#if !defined(__cplusplus) \
|
|
|
|
|| !defined(__CORRECT_ISO_CPP_STRING_H_PROTO) \
|
|
|
|
|| !defined(__CORRECT_ISO_CPP_WCHAR_H_PROTO)
|
|
|
|
ISO C++ correct string.h and wchar.h protos not supported.
|
|
|
|
#else
|
|
|
|
int i;
|
|
|
|
#endif
|
|
|
|
}]
|
|
|
|
}
|
2009-05-15 20:15:14 +02:00
|
|
|
|
|
|
|
# Return 1 if the MPC library is integrated with GCC, 0 otherwise.
|
|
|
|
|
|
|
|
proc check_effective_target_mpc { } {
|
|
|
|
return [check_no_compiler_messages mpc executable {
|
|
|
|
extern void link_error(void);
|
|
|
|
int main ()
|
|
|
|
{
|
|
|
|
if (__builtin_csin(0) != 0)
|
|
|
|
link_error();
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
}
|