2007-01-01 13:56:08 +01:00
|
|
|
# Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007
|
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.
|
|
|
|
|
2006-08-02 15:31:56 +02:00
|
|
|
# Try to compile some code and return the messages printed by the compiler,
|
|
|
|
# and optionally the contents for assembly files. Either a string or
|
|
|
|
# a list of two strings are returned, depending on WANT_OUTPUT.
|
2004-11-12 02:11:01 +01:00
|
|
|
#
|
|
|
|
# BASENAME is a basename to use for temporary files.
|
2006-08-02 15:31:56 +02:00
|
|
|
# WANT_OUTPUT is a flag which is 0 to request returning just the
|
|
|
|
# compiler messages, or 1 to return the messages and the contents
|
|
|
|
# of the assembly file. TYPE should be "assembly" if WANT_OUTPUT
|
|
|
|
# is set.
|
2004-11-12 02:11:01 +01:00
|
|
|
# TYPE is the type of compilation to perform (see target_compile).
|
|
|
|
# CONTENTS gives the contents of the input file.
|
2005-04-07 01:27:11 +02:00
|
|
|
# The rest is optional:
|
|
|
|
# OPTIONS: additional compiler options to use.
|
2006-08-02 15:31:56 +02:00
|
|
|
proc get_compiler_messages {basename want_output 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 ""
|
|
|
|
}
|
|
|
|
|
2004-11-12 02:11:01 +01:00
|
|
|
set src ${basename}[pid].c
|
|
|
|
switch $type {
|
|
|
|
assembly { set output ${basename}[pid].s }
|
|
|
|
object { set output ${basename}[pid].o }
|
|
|
|
}
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f $contents
|
|
|
|
close $f
|
2005-04-07 01:27:11 +02:00
|
|
|
set lines [${tool}_target_compile $src $output $type "$options"]
|
2004-11-12 02:11:01 +01:00
|
|
|
file delete $src
|
|
|
|
|
2006-08-02 15:31:56 +02:00
|
|
|
if { $want_output } {
|
|
|
|
if { $type != "assembly" } {
|
|
|
|
error "WANT_OUTPUT can only be used with assembly output"
|
|
|
|
} elseif { ![string match "" $lines] } {
|
|
|
|
# An error occurred.
|
|
|
|
set result [list $lines ""]
|
|
|
|
} else {
|
|
|
|
set text ""
|
|
|
|
set chan [open "$output"]
|
|
|
|
while {[gets $chan line] >= 0} {
|
|
|
|
append text "$line\n"
|
|
|
|
}
|
|
|
|
close $chan
|
|
|
|
set result [list $lines $text]
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
set result $lines
|
|
|
|
}
|
|
|
|
|
|
|
|
remote_file build delete $output
|
|
|
|
return $result
|
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-09-22 10:26:50 +02:00
|
|
|
# Implement an effective-target check for property PROP by invoking
|
|
|
|
# the compiler and seeing if it prints any messages. Assume that the
|
|
|
|
# property holds if the compiler doesn't print anything. The other
|
|
|
|
# arguments are as for get_compiler_messages, starting with TYPE.
|
|
|
|
proc check_no_compiler_messages {prop args} {
|
|
|
|
return [check_cached_effective_target $prop {
|
|
|
|
string match "" [eval get_compiler_messages $prop 0 $args]
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
2006-08-02 15:31:56 +02:00
|
|
|
# Similar to check_no_compiler_messages, but also verify that the regular
|
|
|
|
# expression PATTERN matches the compiler's output.
|
|
|
|
proc check_no_messages_and_pattern {prop pattern args} {
|
2007-09-22 10:26:50 +02:00
|
|
|
return [check_cached_effective_target $prop {
|
2006-08-02 15:31:56 +02:00
|
|
|
set results [eval get_compiler_messages $prop 1 $args]
|
2007-09-22 10:26:50 +02:00
|
|
|
expr { [string match "" [lindex $results 0]]
|
|
|
|
&& [regexp $pattern [lindex $results 1]] }
|
|
|
|
}]
|
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 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
|
|
# 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
|
|
|
|
}
|
|
|
|
|
2006-01-10 08:18:15 +01:00
|
|
|
# At present, there is no profiling support on NetWare.
|
|
|
|
if { [istarget *-*-netware*] } {
|
|
|
|
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*]
|
2003-12-24 00:55:06 +01:00
|
|
|
|| [istarget arm*-*-elf]
|
2004-08-20 00:29:11 +02:00
|
|
|
|| [istarget arm*-*-symbianelf*]
|
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 strongarm*-*-elf]
|
|
|
|
|| [istarget xscale*-*-elf]
|
|
|
|
|| [istarget cris-*-*]
|
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*]
|
2007-09-18 01:44:00 +02:00
|
|
|
|| [istarget mips*-*-elf*]
|
2005-04-29 02:06:26 +02:00
|
|
|
|| [istarget xtensa-*-elf]
|
2007-03-12 11:44:52 +01:00
|
|
|
|| [istarget *-*-vxworks*]
|
2003-12-24 00:55:06 +01:00
|
|
|
|| [istarget *-*-windiss] } {
|
|
|
|
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
|
|
|
|
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
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_tls {} {
|
|
|
|
global et_tls_saved
|
2006-09-19 00:40:59 +02:00
|
|
|
global tool
|
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
|
|
|
|
|
|
|
if [info exists et_tls_saved] {
|
|
|
|
verbose "check_effective_target_tls: using cached result" 2
|
|
|
|
} else {
|
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
|
|
|
set et_tls_saved 0
|
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
|
|
|
|
|
|
|
set src tls[pid].c
|
|
|
|
set asm tls[pid].S
|
|
|
|
verbose "check_effective_target_tls: compiling testfile $src" 2
|
|
|
|
set f [open $src "w"]
|
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
|
|
|
# Compile a small test program. Make sure that we test accesses
|
|
|
|
# as well as declarations.
|
|
|
|
puts $f "__thread int i;\n"
|
|
|
|
puts $f "int f (void) { return i; }\n"
|
|
|
|
puts $f "void g (int j) { i = j; }\n"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
# Test for thread-local data supported by the platform.
|
|
|
|
set comp_output \
|
|
|
|
[${tool}_target_compile $src $asm assembly ""]
|
|
|
|
file delete $src
|
|
|
|
if { [string match "" $comp_output] } {
|
|
|
|
# No error messages, everything is OK.
|
|
|
|
set et_tls_saved 1
|
|
|
|
}
|
|
|
|
remove-build-file $asm
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_tls: returning $et_tls_saved" 2
|
|
|
|
return $et_tls_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if *native* thread local storage (TLS) is supported, 0 otherwise.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_tls_native {} {
|
|
|
|
global et_tls_native_saved
|
|
|
|
global tool
|
|
|
|
|
|
|
|
if [info exists et_tls_saved] {
|
|
|
|
verbose "check_effective_target_tls_native: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_tls_native_saved 0
|
|
|
|
|
|
|
|
set src tls[pid].c
|
|
|
|
set asm tls[pid].S
|
|
|
|
verbose "check_effective_target_tls_native: compiling testfile $src" 2
|
|
|
|
set f [open $src "w"]
|
|
|
|
# Compile a small test program. Make sure that we test accesses
|
|
|
|
# as well as declarations.
|
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
|
|
|
puts $f "__thread int i;\n"
|
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
|
|
|
puts $f "int f (void) { return i; }\n"
|
|
|
|
puts $f "void g (int j) { i = j; }\n"
|
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
|
|
|
close $f
|
|
|
|
|
|
|
|
# Test for thread-local data supported by the platform.
|
Makefile.in (libgcc-support, [...]): Add emutls.c.
gcc/ChangeLog:
* Makefile.in (libgcc-support, libgcc.mvars): Add emutls.c.
* builtin-types.def (BT_WORD): Make unsigned.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
* builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS): New.
(BUILT_IN_EMUTLS_REGISTER_COMMON): New.
* c-decl.c (grokdeclarator): Don't error if !have_tls.
* c-parser.c (c_parser_omp_threadprivate): Likewise.
* dwarf2out.c (loc_descriptor_from_tree_1): Don't do anything for
emulated tls.
* expr.c (emutls_var_address): New.
(expand_expr_real_1): Expand emulated tls.
(expand_expr_addr_expr_1): Likewise.
* libgcc-std.ver: Add __emutls_get_address, __emutls_register_common.
* output.h (emutls_finish): Declare.
* toplev.c (compile_file): Call it.
* tree-ssa-address.c (gen_addr_rtx): Check for const-ness of the
address before wrapping in CONST.
* varasm.c (emutls_htab, emutls_object_type): New.
(EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): New.
(get_emutls_object_name, get_emutls_object_type): New.
(get_emutls_init_templ_addr, emutls_decl): New.
(emutls_common_1, emutls_finish): New.
(assemble_variable): When emulating tls, swap decls; generate
constructor for the emutls objects.
(do_assemble_alias): When emulating tls, swap decl and target name.
(default_encode_section_info): Don't add SYMBOL_FLAG_TLS_SHIFT
for emulated tls.
* varpool.c (decide_is_variable_needed): Look at force_output.
Recurse for emulated tls.
(cgraph_varpool_remove_unreferenced_decls): Remove checks redundant
with decide_is_variable_needed.
* emutls.c: New file.
* config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Only emit
tls_object for real tls.
gcc/cp/ChangeLog:
* decl.c (grokvardecl): Don't error if !have_tls.
(grokdeclarator): Likewise.
* parser.c (cp_parser_omp_threadprivate): Likewise.
gcc/fortran/ChangeLog:
* f95-lang.c (gfc_init_builtin_functions): Add __emutls_get_address
and __emutls_register_common.
* openmp.c (gfc_match_omp_threadprivate): Don't error if !have_tls.
* trans-common.c (build_common_decl): Don't check have_tls.
* trans-decl.c (gfc_finish_var_decl): Likewise.
* types.def (BT_WORD, BT_FN_PTR_PTR): New.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
gcc/testsuite/ChangeLog:
* 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.
From-SVN: r121800
2007-02-10 20:19:10 +01:00
|
|
|
set comp_output [${tool}_target_compile $src $asm assembly ""]
|
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
|
|
|
file delete $src
|
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
|
|
|
if { [string match "" $comp_output] } {
|
|
|
|
# No error messages, everything is OK.
|
Makefile.in (libgcc-support, [...]): Add emutls.c.
gcc/ChangeLog:
* Makefile.in (libgcc-support, libgcc.mvars): Add emutls.c.
* builtin-types.def (BT_WORD): Make unsigned.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
* builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS): New.
(BUILT_IN_EMUTLS_REGISTER_COMMON): New.
* c-decl.c (grokdeclarator): Don't error if !have_tls.
* c-parser.c (c_parser_omp_threadprivate): Likewise.
* dwarf2out.c (loc_descriptor_from_tree_1): Don't do anything for
emulated tls.
* expr.c (emutls_var_address): New.
(expand_expr_real_1): Expand emulated tls.
(expand_expr_addr_expr_1): Likewise.
* libgcc-std.ver: Add __emutls_get_address, __emutls_register_common.
* output.h (emutls_finish): Declare.
* toplev.c (compile_file): Call it.
* tree-ssa-address.c (gen_addr_rtx): Check for const-ness of the
address before wrapping in CONST.
* varasm.c (emutls_htab, emutls_object_type): New.
(EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): New.
(get_emutls_object_name, get_emutls_object_type): New.
(get_emutls_init_templ_addr, emutls_decl): New.
(emutls_common_1, emutls_finish): New.
(assemble_variable): When emulating tls, swap decls; generate
constructor for the emutls objects.
(do_assemble_alias): When emulating tls, swap decl and target name.
(default_encode_section_info): Don't add SYMBOL_FLAG_TLS_SHIFT
for emulated tls.
* varpool.c (decide_is_variable_needed): Look at force_output.
Recurse for emulated tls.
(cgraph_varpool_remove_unreferenced_decls): Remove checks redundant
with decide_is_variable_needed.
* emutls.c: New file.
* config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Only emit
tls_object for real tls.
gcc/cp/ChangeLog:
* decl.c (grokvardecl): Don't error if !have_tls.
(grokdeclarator): Likewise.
* parser.c (cp_parser_omp_threadprivate): Likewise.
gcc/fortran/ChangeLog:
* f95-lang.c (gfc_init_builtin_functions): Add __emutls_get_address
and __emutls_register_common.
* openmp.c (gfc_match_omp_threadprivate): Don't error if !have_tls.
* trans-common.c (build_common_decl): Don't check have_tls.
* trans-decl.c (gfc_finish_var_decl): Likewise.
* types.def (BT_WORD, BT_FN_PTR_PTR): New.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
gcc/testsuite/ChangeLog:
* 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.
From-SVN: r121800
2007-02-10 20:19:10 +01:00
|
|
|
set fd [open $asm r]
|
|
|
|
set text [read $fd]
|
|
|
|
close $fd
|
|
|
|
if { [string match "*emutls*" $text]} {
|
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
|
|
|
set et_tls_native_saved 0
|
Makefile.in (libgcc-support, [...]): Add emutls.c.
gcc/ChangeLog:
* Makefile.in (libgcc-support, libgcc.mvars): Add emutls.c.
* builtin-types.def (BT_WORD): Make unsigned.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
* builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS): New.
(BUILT_IN_EMUTLS_REGISTER_COMMON): New.
* c-decl.c (grokdeclarator): Don't error if !have_tls.
* c-parser.c (c_parser_omp_threadprivate): Likewise.
* dwarf2out.c (loc_descriptor_from_tree_1): Don't do anything for
emulated tls.
* expr.c (emutls_var_address): New.
(expand_expr_real_1): Expand emulated tls.
(expand_expr_addr_expr_1): Likewise.
* libgcc-std.ver: Add __emutls_get_address, __emutls_register_common.
* output.h (emutls_finish): Declare.
* toplev.c (compile_file): Call it.
* tree-ssa-address.c (gen_addr_rtx): Check for const-ness of the
address before wrapping in CONST.
* varasm.c (emutls_htab, emutls_object_type): New.
(EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): New.
(get_emutls_object_name, get_emutls_object_type): New.
(get_emutls_init_templ_addr, emutls_decl): New.
(emutls_common_1, emutls_finish): New.
(assemble_variable): When emulating tls, swap decls; generate
constructor for the emutls objects.
(do_assemble_alias): When emulating tls, swap decl and target name.
(default_encode_section_info): Don't add SYMBOL_FLAG_TLS_SHIFT
for emulated tls.
* varpool.c (decide_is_variable_needed): Look at force_output.
Recurse for emulated tls.
(cgraph_varpool_remove_unreferenced_decls): Remove checks redundant
with decide_is_variable_needed.
* emutls.c: New file.
* config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Only emit
tls_object for real tls.
gcc/cp/ChangeLog:
* decl.c (grokvardecl): Don't error if !have_tls.
(grokdeclarator): Likewise.
* parser.c (cp_parser_omp_threadprivate): Likewise.
gcc/fortran/ChangeLog:
* f95-lang.c (gfc_init_builtin_functions): Add __emutls_get_address
and __emutls_register_common.
* openmp.c (gfc_match_omp_threadprivate): Don't error if !have_tls.
* trans-common.c (build_common_decl): Don't check have_tls.
* trans-decl.c (gfc_finish_var_decl): Likewise.
* types.def (BT_WORD, BT_FN_PTR_PTR): New.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
gcc/testsuite/ChangeLog:
* 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.
From-SVN: r121800
2007-02-10 20:19:10 +01:00
|
|
|
} else {
|
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
|
|
|
set et_tls_native_saved 1
|
Makefile.in (libgcc-support, [...]): Add emutls.c.
gcc/ChangeLog:
* Makefile.in (libgcc-support, libgcc.mvars): Add emutls.c.
* builtin-types.def (BT_WORD): Make unsigned.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
* builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS): New.
(BUILT_IN_EMUTLS_REGISTER_COMMON): New.
* c-decl.c (grokdeclarator): Don't error if !have_tls.
* c-parser.c (c_parser_omp_threadprivate): Likewise.
* dwarf2out.c (loc_descriptor_from_tree_1): Don't do anything for
emulated tls.
* expr.c (emutls_var_address): New.
(expand_expr_real_1): Expand emulated tls.
(expand_expr_addr_expr_1): Likewise.
* libgcc-std.ver: Add __emutls_get_address, __emutls_register_common.
* output.h (emutls_finish): Declare.
* toplev.c (compile_file): Call it.
* tree-ssa-address.c (gen_addr_rtx): Check for const-ness of the
address before wrapping in CONST.
* varasm.c (emutls_htab, emutls_object_type): New.
(EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): New.
(get_emutls_object_name, get_emutls_object_type): New.
(get_emutls_init_templ_addr, emutls_decl): New.
(emutls_common_1, emutls_finish): New.
(assemble_variable): When emulating tls, swap decls; generate
constructor for the emutls objects.
(do_assemble_alias): When emulating tls, swap decl and target name.
(default_encode_section_info): Don't add SYMBOL_FLAG_TLS_SHIFT
for emulated tls.
* varpool.c (decide_is_variable_needed): Look at force_output.
Recurse for emulated tls.
(cgraph_varpool_remove_unreferenced_decls): Remove checks redundant
with decide_is_variable_needed.
* emutls.c: New file.
* config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Only emit
tls_object for real tls.
gcc/cp/ChangeLog:
* decl.c (grokvardecl): Don't error if !have_tls.
(grokdeclarator): Likewise.
* parser.c (cp_parser_omp_threadprivate): Likewise.
gcc/fortran/ChangeLog:
* f95-lang.c (gfc_init_builtin_functions): Add __emutls_get_address
and __emutls_register_common.
* openmp.c (gfc_match_omp_threadprivate): Don't error if !have_tls.
* trans-common.c (build_common_decl): Don't check have_tls.
* trans-decl.c (gfc_finish_var_decl): Likewise.
* types.def (BT_WORD, BT_FN_PTR_PTR): New.
(BT_FN_VOID_PTR_WORD_WORD_PTR): New.
gcc/testsuite/ChangeLog:
* 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.
From-SVN: r121800
2007-02-10 20:19:10 +01:00
|
|
|
}
|
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
|
|
|
}
|
|
|
|
remove-build-file $asm
|
|
|
|
}
|
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
|
|
|
verbose "check_effective_target_tls_native: returning $et_tls_native_saved" 2
|
|
|
|
return $et_tls_native_saved
|
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.
|
|
|
|
#
|
|
|
|
# This won't change for different subtargets so cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_tls_runtime {} {
|
|
|
|
global et_tls_runtime_saved
|
2006-09-19 00:40:59 +02:00
|
|
|
global tool
|
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
|
|
|
|
|
|
|
if [info exists et_tls_runtime_saved] {
|
|
|
|
verbose "check_effective_target_tls_runtime: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_tls_runtime_saved 0
|
|
|
|
|
|
|
|
set src tls_runtime[pid].c
|
|
|
|
set exe tls_runtime[pid].x
|
|
|
|
verbose "check_effective_target_tls_runtime: compiling testfile $src" 2
|
|
|
|
set f [open $src "w"]
|
|
|
|
# Compile a small test program.
|
|
|
|
puts $f "__thread int thr = 0;\n"
|
|
|
|
puts $f "int main(void)\n {\n return thr;\n}"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
set comp_output \
|
2006-09-19 00:40:59 +02:00
|
|
|
[${tool}_target_compile $src $exe executable ""]
|
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
|
|
|
file delete $src
|
|
|
|
|
|
|
|
if [string match "" $comp_output] then {
|
|
|
|
# No error messages, everything is OK.
|
|
|
|
|
|
|
|
set result [remote_load target "./$exe" "" ""]
|
|
|
|
set status [lindex $result 0]
|
|
|
|
remote_file build delete $exe
|
|
|
|
|
|
|
|
verbose "check_effective_target_tls_runtime status is <$status>" 2
|
|
|
|
|
|
|
|
if { $status == "pass" } {
|
|
|
|
set et_tls_runtime_saved 1
|
|
|
|
}
|
|
|
|
|
|
|
|
verbose "check_effective_target_tls_runtime: returning $et_tls_runtime_saved" 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $et_tls_runtime_saved
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2007-03-29 01:08:26 +02:00
|
|
|
# Return 1 if the target supports -fstack-protector
|
|
|
|
proc check_effective_target_fstack_protector {} {
|
2007-04-11 01:00:00 +02:00
|
|
|
global tool
|
|
|
|
set result ""
|
|
|
|
|
|
|
|
set src stack_prot[pid].c
|
|
|
|
set exe stack_prot[pid].x
|
|
|
|
|
|
|
|
verbose "check_effective_target_fstack_protector compiling testfile $src" 2
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
# Compile a small test program.
|
|
|
|
puts $f "int main (void)\n { return 0; }\n"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
set opts "additional_flags=-fstack-protector"
|
|
|
|
set lines [${tool}_target_compile $src $exe executable "$opts" ]
|
|
|
|
file delete $src
|
|
|
|
|
|
|
|
if [string match "" $lines] then {
|
|
|
|
# No error messages, everything is OK.
|
|
|
|
set result [${tool}_load "./$exe" "" ""]
|
|
|
|
set status [lindex $result 0]
|
|
|
|
remote_file build delete $exe
|
|
|
|
verbose "check_iconv_available status is <$status>" 2
|
|
|
|
|
|
|
|
if { $status == "pass" } then {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0
|
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-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 } {
|
|
|
|
return "$flags -mno-abicalls -fno-pic"
|
|
|
|
}
|
|
|
|
|
|
|
|
# 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 } {
|
|
|
|
global tool
|
2004-03-09 02:53:28 +01:00
|
|
|
global libiconv
|
2004-02-27 03:01:10 +01:00
|
|
|
|
|
|
|
set result ""
|
|
|
|
|
2004-05-29 00:28:22 +02:00
|
|
|
set src iconv[pid].c
|
|
|
|
set exe iconv[pid].x
|
|
|
|
verbose "check_iconv_available compiling testfile $src" 2
|
|
|
|
set f [open $src "w"]
|
2004-02-27 03:01:10 +01:00
|
|
|
# Compile a small test program.
|
|
|
|
puts $f "#include <iconv.h>\n"
|
|
|
|
puts $f "int main (void)\n {\n iconv_t cd; \n"
|
|
|
|
puts $f "cd = iconv_open (\"[lindex $test_what 1]\", \"UTF-8\");\n"
|
|
|
|
puts $f "if (cd == (iconv_t) -1)\n return 1;\n"
|
|
|
|
puts $f "return 0;\n}"
|
|
|
|
close $f
|
|
|
|
|
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"
|
|
|
|
}
|
2004-05-29 00:28:22 +02:00
|
|
|
set lines [${tool}_target_compile $src $exe executable "libs=$libiconv" ]
|
|
|
|
file delete $src
|
2004-02-27 03:01:10 +01:00
|
|
|
|
2004-03-09 02:53:28 +01:00
|
|
|
if [string match "" $lines] then {
|
|
|
|
# No error messages, everything is OK.
|
2004-02-27 03:01:10 +01:00
|
|
|
|
2004-05-30 19:51:46 +02:00
|
|
|
set result [${tool}_load "./$exe" "" ""]
|
2005-03-08 23:10:34 +01:00
|
|
|
set status [lindex $result 0]
|
2004-05-30 19:51:46 +02:00
|
|
|
remote_file build delete $exe
|
2004-02-27 03:01:10 +01:00
|
|
|
|
2004-05-29 00:28:22 +02:00
|
|
|
verbose "check_iconv_available status is <$status>" 2
|
2004-03-09 02:53:28 +01:00
|
|
|
|
|
|
|
if { $status == "pass" } then {
|
|
|
|
return 1
|
|
|
|
}
|
2004-02-27 03:01:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
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 { } {
|
|
|
|
global et_fortran_large_real_saved
|
2005-10-04 23:45:50 +02:00
|
|
|
global et_fortran_large_real_target_name
|
2005-06-23 20:50:25 +02:00
|
|
|
global tool
|
|
|
|
|
2005-10-04 23:45:50 +02:00
|
|
|
if { ![info exists et_fortran_large_real_target_name] } {
|
|
|
|
set et_fortran_large_real_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_fortran_large_real_target_name } {
|
|
|
|
verbose "check_effective_target_fortran_large_real: `$et_fortran_large_real_target_name' `$current_target'" 2
|
|
|
|
set et_fortran_large_real_target_name $current_target
|
|
|
|
if [info exists et_fortran_large_real_saved] {
|
|
|
|
verbose "check_effective_target_fortran_large_real: removing cached result" 2
|
|
|
|
unset et_fortran_large_real_saved
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-06-23 20:50:25 +02:00
|
|
|
if [info exists et_fortran_large_real_saved] {
|
|
|
|
verbose "check_effective_target_fortran_large_real returning saved $et_fortran_large_real_saved" 2
|
|
|
|
} else {
|
|
|
|
set et_fortran_large_real_saved 0
|
|
|
|
|
|
|
|
# Set up, compile, and execute a test program using large real
|
|
|
|
# kinds. Include the current process ID in the file names to
|
|
|
|
# prevent conflicts with invocations for multiple testsuites.
|
|
|
|
set src real[pid].f90
|
|
|
|
set exe real[pid].x
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f "integer,parameter :: k = &"
|
|
|
|
puts $f " selected_real_kind (precision (0.0_8) + 1)"
|
|
|
|
puts $f "real(kind=k) :: x"
|
2005-11-21 21:52:25 +01:00
|
|
|
puts $f "x = cos (x);"
|
2005-06-23 20:50:25 +02:00
|
|
|
puts $f "end"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
verbose "check_effective_target_fortran_large_real compiling testfile $src" 2
|
|
|
|
set lines [${tool}_target_compile $src $exe executable ""]
|
|
|
|
file delete $src
|
|
|
|
|
|
|
|
if [string match "" $lines] then {
|
|
|
|
# No error message, compilation succeeded.
|
2007-03-27 09:00:13 +02:00
|
|
|
remote_file build delete $exe
|
2005-06-23 20:50:25 +02:00
|
|
|
set et_fortran_large_real_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $et_fortran_large_real_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# 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 { } {
|
|
|
|
global et_fortran_large_int_saved
|
2005-10-04 23:45:50 +02:00
|
|
|
global et_fortran_large_int_target_name
|
2005-06-23 20:50:25 +02:00
|
|
|
global tool
|
|
|
|
|
2005-10-04 23:45:50 +02:00
|
|
|
if { ![info exists et_fortran_large_int_target_name] } {
|
|
|
|
set et_fortran_large_int_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_fortran_large_int_target_name } {
|
|
|
|
verbose "check_effective_target_fortran_large_int: `$et_fortran_large_int_target_name' `$current_target'" 2
|
|
|
|
set et_fortran_large_int_target_name $current_target
|
|
|
|
if [info exists et_fortran_large_int_saved] {
|
|
|
|
verbose "check_effective_target_fortran_large_int: removing cached result" 2
|
|
|
|
unset et_fortran_large_int_saved
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-06-23 20:50:25 +02:00
|
|
|
if [info exists et_fortran_large_int_saved] {
|
|
|
|
verbose "check_effective_target_fortran_large_int returning saved $et_fortran_large_int_saved" 2
|
|
|
|
} else {
|
|
|
|
set et_fortran_large_int_saved 0
|
|
|
|
|
|
|
|
# Set up, compile, and execute a test program using large integer
|
|
|
|
# kinds. Include the current process ID in the file names to
|
|
|
|
# prevent conflicts with invocations for multiple testsuites.
|
|
|
|
set src int[pid].f90
|
|
|
|
set exe int[pid].x
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f "integer,parameter :: k = &"
|
|
|
|
puts $f " selected_int_kind (range (0_8) + 1)"
|
|
|
|
puts $f "integer(kind=k) :: i"
|
|
|
|
puts $f "end"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
verbose "check_effective_target_fortran_large_int compiling testfile $src" 2
|
|
|
|
set lines [${tool}_target_compile $src $exe executable ""]
|
|
|
|
file delete $src
|
|
|
|
|
|
|
|
if [string match "" $lines] then {
|
|
|
|
# No error message, compilation succeeded.
|
2007-03-27 09:00:13 +02:00
|
|
|
remote_file build delete $exe
|
2005-06-23 20:50:25 +02:00
|
|
|
set et_fortran_large_int_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $et_fortran_large_int_saved
|
|
|
|
}
|
|
|
|
|
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 { } {
|
|
|
|
global et_static_libgfortran
|
|
|
|
global et_static_libgfortran_target_name
|
|
|
|
global tool
|
|
|
|
|
|
|
|
if { ![info exists et_static_libgfortran_target_name] } {
|
|
|
|
set et_static_libgfortran_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_static_libgfortran_target_name } {
|
|
|
|
verbose "check_effective_target_static_libgfortran: `$et_static_libgfortran_target_name' `$current_target'" 2
|
|
|
|
set et_static_libgfortran_target_name $current_target
|
|
|
|
if [info exists et_static_libgfortran_saved] {
|
|
|
|
verbose "check_effective_target_static_libgfortran: removing cached result" 2
|
|
|
|
unset et_static_libgfortran_saved
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if [info exists et_static_libgfortran_saved] {
|
|
|
|
verbose "check_effective_target_static_libgfortran returning saved $et_static_libgfortran_saved" 2
|
|
|
|
} else {
|
|
|
|
set et_static_libgfortran_saved 0
|
|
|
|
|
|
|
|
# Set up, compile, and execute a test program using static linking.
|
|
|
|
# Include the current process ID in the file names to prevent
|
|
|
|
# conflicts with invocations for multiple testsuites.
|
2005-11-11 22:41:55 +01:00
|
|
|
set opts "additional_flags=-static"
|
2005-11-04 09:44:29 +01:00
|
|
|
set src static[pid].f
|
2005-11-11 22:41:55 +01:00
|
|
|
set exe static[pid].x
|
2005-11-04 09:44:29 +01:00
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f " print *, 'test'"
|
|
|
|
puts $f " end"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
verbose "check_effective_target_static_libgfortran compiling testfile $src" 2
|
2005-11-11 22:41:55 +01:00
|
|
|
set lines [${tool}_target_compile $src $exe executable "$opts"]
|
2005-11-04 09:44:29 +01:00
|
|
|
file delete $src
|
|
|
|
|
|
|
|
if [string match "" $lines] then {
|
|
|
|
# No error message, compilation succeeded.
|
2007-03-27 09:00:13 +02:00
|
|
|
remote_file build delete $exe
|
2005-11-04 09:44:29 +01:00
|
|
|
set et_static_libgfortran_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $et_static_libgfortran_saved
|
|
|
|
}
|
|
|
|
|
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 { } {
|
|
|
|
global vmx_hw_available_saved
|
|
|
|
global tool
|
|
|
|
|
|
|
|
if [info exists vmx_hw_available_saved] {
|
|
|
|
verbose "check_hw_available returning saved $vmx_hw_available_saved" 2
|
|
|
|
} else {
|
|
|
|
set vmx_hw_available_saved 0
|
|
|
|
|
|
|
|
# Some simulators are known to not support VMX instructions.
|
|
|
|
if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] } {
|
|
|
|
verbose "check_hw_available returning 0" 2
|
|
|
|
return $vmx_hw_available_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set up, compile, and execute a test program containing VMX
|
|
|
|
# instructions. Include the current process ID in the file
|
|
|
|
# names to prevent conflicts with invocations for multiple
|
|
|
|
# testsuites.
|
|
|
|
set src vmx[pid].c
|
|
|
|
set exe vmx[pid].x
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f "int main() {"
|
|
|
|
puts $f "#ifdef __MACH__"
|
|
|
|
puts $f " asm volatile (\"vor v0,v0,v0\");"
|
|
|
|
puts $f "#else"
|
|
|
|
puts $f " asm volatile (\"vor 0,0,0\");"
|
|
|
|
puts $f "#endif"
|
|
|
|
puts $f " return 0; }"
|
|
|
|
close $f
|
|
|
|
|
2005-03-15 19:41:19 +01:00
|
|
|
# Most targets don't require special flags for this test case, but
|
|
|
|
# Darwin does.
|
2007-10-15 17:00:49 +02:00
|
|
|
if { [istarget *-*-darwin*]
|
|
|
|
|| [istarget *-*-aix*] } {
|
2005-03-15 19:41:19 +01:00
|
|
|
set opts "additional_flags=-maltivec"
|
|
|
|
} else {
|
|
|
|
set opts ""
|
|
|
|
}
|
|
|
|
|
2004-05-29 00:31:44 +02:00
|
|
|
verbose "check_vmx_hw_available compiling testfile $src" 2
|
2005-03-15 19:41:19 +01:00
|
|
|
set lines [${tool}_target_compile $src $exe executable "$opts"]
|
2004-05-29 00:31:44 +02:00
|
|
|
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_vmx_hw_available testfile status is <$status>" 2
|
|
|
|
|
|
|
|
if { $status == "pass" } then {
|
|
|
|
set vmx_hw_available_saved 1
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
verbose "check_vmx_hw_availalble testfile compilation failed" 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $vmx_hw_available_saved
|
|
|
|
}
|
2004-11-12 02:11:01 +01:00
|
|
|
|
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 { } {
|
|
|
|
global et_broken_cplxf_arg_saved
|
|
|
|
global et_broken_cplxf_arg_target_name
|
|
|
|
global tool
|
|
|
|
|
|
|
|
# Skip the work for targets known not to be affected.
|
|
|
|
if { ![istarget powerpc64-*-linux*] } {
|
|
|
|
return 0
|
|
|
|
} elseif { [is-effective-target ilp32] } {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
if { ![info exists et_broken_cplxf_arg_target_name] } {
|
|
|
|
set et_broken_cplxf_arg_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_broken_cplxf_arg_target_name } {
|
|
|
|
verbose "check_effective_target_broken_cplxf_arg: `$et_broken_cplxf_arg_target_name'" 2
|
|
|
|
set et_broken_cplxf_arg_target_name $current_target
|
|
|
|
if [info exists et_broken_cplxf_arg_saved] {
|
|
|
|
verbose "check_effective_target_broken_cplxf_arg: removing cached result" 2
|
|
|
|
unset et_broken_cplxf_arg_saved
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if [info exists et_broken_cplxf_arg_saved] {
|
|
|
|
verbose "check_effective_target_broken_cplxf_arg: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_broken_cplxf_arg_saved 0
|
|
|
|
# This is only known to affect one target.
|
|
|
|
if { ![istarget powerpc64-*-linux*] || ![is-effective-target lp64] } {
|
|
|
|
set et_broken_cplxf_arg_saved 0
|
|
|
|
verbose "check_effective_target_broken_cplxf_arg: caching 0" 2
|
|
|
|
return $et_broken_cplxf_arg_saved
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set up, compile, and execute a C test program that calls cabsf.
|
|
|
|
set src cabsf[pid].c
|
|
|
|
set exe cabsf[pid].x
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f "#include <complex.h>"
|
|
|
|
puts $f "extern void abort (void);"
|
|
|
|
puts $f "float fabsf (float);"
|
|
|
|
puts $f "float cabsf (_Complex float);"
|
|
|
|
puts $f "int main ()"
|
|
|
|
puts $f "{"
|
|
|
|
puts $f " _Complex float cf;"
|
|
|
|
puts $f " float f;"
|
|
|
|
puts $f " cf = 3 + 4.0fi;"
|
|
|
|
puts $f " f = cabsf (cf);"
|
|
|
|
puts $f " if (fabsf (f - 5.0) > 0.0001) abort ();"
|
|
|
|
puts $f " return 0;"
|
|
|
|
puts $f "}"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
set lines [${tool}_target_compile $src $exe executable "-lm"]
|
|
|
|
file delete $src
|
|
|
|
|
|
|
|
if [string match "" $lines] {
|
|
|
|
# No error message, compilation succeeded.
|
|
|
|
set result [${tool}_load "./$exe" "" ""]
|
|
|
|
set status [lindex $result 0]
|
|
|
|
remote_file build delete $exe
|
|
|
|
|
|
|
|
verbose "check_effective_target_broken_cplxf_arg: status is <$status>" 2
|
|
|
|
|
|
|
|
if { $status != "pass" } {
|
|
|
|
set et_broken_cplxf_arg_saved 1
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
verbose "check_effective_target_broken_cplxf_arg: compilation failed" 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $et_broken_cplxf_arg_saved
|
|
|
|
}
|
|
|
|
|
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 { } {
|
|
|
|
global alpha_max_hw_available_saved
|
|
|
|
global tool
|
|
|
|
|
|
|
|
if [info exists alpha_max_hw_available_saved] {
|
|
|
|
verbose "check_alpha_max_hw_available returning saved $alpha_max_hw_available_saved" 2
|
|
|
|
} else {
|
|
|
|
set alpha_max_hw_available_saved 0
|
|
|
|
|
|
|
|
# Set up, compile, and execute a test program probing bit 8 of the
|
|
|
|
# architecture mask, which indicates presence of MAX instructions.
|
|
|
|
set src max[pid].c
|
|
|
|
set exe max[pid].x
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f "int main() { return __builtin_alpha_amask(1<<8) != 0; }"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
verbose "check_alpha_max_hw_available compiling testfile $src" 2
|
|
|
|
set lines [${tool}_target_compile $src $exe executable ""]
|
|
|
|
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_alpha_max_hw_available testfile status is <$status>" 2
|
|
|
|
|
|
|
|
if { $status == "pass" } then {
|
|
|
|
set alpha_max_hw_available_saved 1
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
verbose "check_alpha_max_hw_availalble testfile compilation failed" 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $alpha_max_hw_available_saved
|
|
|
|
}
|
|
|
|
|
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 } {
|
|
|
|
set var "${function}_available_saved"
|
|
|
|
global $var
|
|
|
|
global tool
|
|
|
|
|
|
|
|
if {![info exists $var]} {
|
|
|
|
# Assume it exists.
|
|
|
|
set $var 1
|
|
|
|
# Check to make sure.
|
|
|
|
set src "function[pid].c"
|
|
|
|
set exe "function[pid].exe"
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
2006-10-30 15:03:05 +01:00
|
|
|
puts $f "#ifdef __cplusplus\nextern \"C\"\n#endif\n"
|
|
|
|
puts $f "char $function ();\n"
|
2005-05-06 19:03:10 +02:00
|
|
|
puts $f "int main () { $function (); }"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
set lines [${tool}_target_compile $src $exe executable ""]
|
|
|
|
file delete $src
|
|
|
|
file delete $exe
|
|
|
|
|
|
|
|
if {![string match "" $lines]} then {
|
|
|
|
set $var 0
|
|
|
|
verbose -log "$function is not available"
|
|
|
|
} else {
|
|
|
|
verbose -log "$function is available"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
eval return \$$var
|
|
|
|
}
|
|
|
|
|
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 { } {
|
|
|
|
global et_cxa_atexit
|
|
|
|
global et_cxa_atexit_target_name
|
|
|
|
global tool
|
|
|
|
|
|
|
|
if { ![info exists et_cxa_atexit_target_name] } {
|
|
|
|
set et_cxa_atexit_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_cxa_atexit_target_name } {
|
|
|
|
verbose "check_cxa_atexit_available: `$et_cxa_atexit_target_name'" 2
|
|
|
|
set et_cxa_atexit_target_name $current_target
|
|
|
|
if [info exists et_cxa_atexit] {
|
|
|
|
verbose "check_cxa_atexit_available: removing cached result" 2
|
|
|
|
unset et_cxa_atexit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if [info exists et_cxa_atexit] {
|
|
|
|
verbose "check_cxa_atexit_available: using cached result" 2
|
2006-12-14 17:13:59 +01:00
|
|
|
} elseif { [istarget "hppa*-*-hpux10*"] } {
|
2006-12-13 19:47:04 +01:00
|
|
|
# HP-UX 10 doesn't have __cxa_atexit but subsequent test passes.
|
|
|
|
set et_cxa_atexit 0
|
2006-05-10 23:55:34 +02:00
|
|
|
} else {
|
|
|
|
set et_cxa_atexit 0
|
|
|
|
|
|
|
|
# Set up, compile, and execute a C++ test program that depends
|
|
|
|
# on correct ordering of static object destructors. This is
|
|
|
|
# indicative of the presence and use of __cxa_atexit.
|
|
|
|
set src cxaatexit[pid].cc
|
|
|
|
set exe cxaatexit[pid].x
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f "#include <stdlib.h>"
|
|
|
|
puts $f "static unsigned int count;"
|
|
|
|
puts $f "struct X"
|
|
|
|
puts $f "{"
|
|
|
|
puts $f " X() { count = 1; }"
|
|
|
|
puts $f " ~X()"
|
|
|
|
puts $f " {"
|
|
|
|
puts $f " if (count != 3)"
|
|
|
|
puts $f " exit(1);"
|
|
|
|
puts $f " count = 4;"
|
|
|
|
puts $f " }"
|
|
|
|
puts $f "};"
|
|
|
|
puts $f "void f()"
|
|
|
|
puts $f "{"
|
|
|
|
puts $f " static X x;"
|
|
|
|
puts $f "}"
|
|
|
|
puts $f "struct Y"
|
|
|
|
puts $f "{"
|
|
|
|
puts $f " Y() { f(); count = 2; }"
|
|
|
|
puts $f " ~Y()"
|
|
|
|
puts $f " {"
|
|
|
|
puts $f " if (count != 2)"
|
|
|
|
puts $f " exit(1);"
|
|
|
|
puts $f " count = 3;"
|
|
|
|
puts $f " }"
|
|
|
|
puts $f "};"
|
|
|
|
puts $f "Y y;"
|
|
|
|
puts $f "int main()"
|
|
|
|
puts $f "{ return 0; }"
|
|
|
|
close $f
|
|
|
|
|
2006-05-12 21:52:34 +02:00
|
|
|
set lines [${tool}_target_compile $src $exe executable ""]
|
2006-05-10 23:55:34 +02:00
|
|
|
file delete $src
|
|
|
|
|
|
|
|
if [string match "" $lines] {
|
|
|
|
# No error message, compilation succeeded.
|
|
|
|
set result [${tool}_load "./$exe" "" ""]
|
|
|
|
set status [lindex $result 0]
|
|
|
|
remote_file build delete $exe
|
|
|
|
|
|
|
|
verbose "check_cxa_atexit_available: status is <$status>" 2
|
|
|
|
|
|
|
|
if { $status == "pass" } {
|
|
|
|
set et_cxa_atexit 1
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
verbose "check_cxa_atexit_available: compilation failed" 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $et_cxa_atexit
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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];
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
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
|
2006-08-02 15:31:56 +02:00
|
|
|
set ret [string match "" [get_compiler_messages dfp 0 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;
|
|
|
|
}]]
|
|
|
|
verbose "check_effective_target_dfp_nocache: returning $ret" 2
|
|
|
|
return $ret
|
|
|
|
}
|
|
|
|
|
|
|
|
proc check_effective_target_dfprt_nocache { } {
|
|
|
|
global tool
|
|
|
|
|
|
|
|
set ret 0
|
|
|
|
|
|
|
|
verbose "check_effective_target_dfprt_nocache: compiling source" 2
|
|
|
|
# Set up, compile, and execute a test program containing decimal
|
|
|
|
# float operations.
|
|
|
|
set src dfprt[pid].c
|
|
|
|
set exe dfprt[pid].x
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f "_Decimal32 x = 1.2df; _Decimal64 y = 2.3dd; _Decimal128 z;"
|
|
|
|
puts $f "int main () { z = x + y; return 0; }"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
verbose "check_effective_target_dfprt_nocache: compiling testfile $src" 2
|
|
|
|
set lines [${tool}_target_compile $src $exe executable ""]
|
|
|
|
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_dfprt_nocache: testfile status is <$status>" 2
|
|
|
|
if { $status == "pass" } then {
|
|
|
|
set ret 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $ret
|
|
|
|
verbose "check_effective_target_dfprt_nocache: returning $ret" 2
|
|
|
|
}
|
|
|
|
|
|
|
|
# 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 { } {
|
|
|
|
global et_dfp_saved
|
|
|
|
|
|
|
|
if [info exists et_dfp_saved] {
|
|
|
|
verbose "check_effective_target_dfp: using cached result" 2
|
|
|
|
} else {
|
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
|
|
|
set et_dfp_saved [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
|
|
|
}
|
|
|
|
verbose "check_effective_target_dfp: returning $et_dfp_saved" 2
|
|
|
|
return $et_dfp_saved
|
|
|
|
}
|
|
|
|
|
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 { } {
|
|
|
|
global et_dfprt_saved
|
|
|
|
global tool
|
|
|
|
|
|
|
|
if [info exists et_dfprt_saved] {
|
|
|
|
verbose "check_effective_target_dfprt: using cached result" 2
|
|
|
|
} else {
|
|
|
|
set et_dfprt_saved [check_effective_target_dfprt_nocache]
|
|
|
|
}
|
|
|
|
verbose "check_effective_target_dfprt: returning $et_dfprt_saved" 2
|
|
|
|
return $et_dfprt_saved
|
|
|
|
}
|
|
|
|
|
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]
|
|
|
|
|| [check_effective_target_powerpc_altivec]))} {
|
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-*-*]
|
|
|
|
|| [istarget powerpc*-*-*]
|
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*-*-*]
|
|
|
|
|| [istarget ia64-*-*] } {
|
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
|
|
|
|
}
|
|
|
|
|
2007-05-03 14:54:45 +02:00
|
|
|
# Return 1 if the target supports int->float conversion
|
|
|
|
#
|
|
|
|
|
|
|
|
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-*-*]
|
|
|
|
|| [istarget powerpc*-*-*]
|
|
|
|
|| [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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Return 1 if the target supports float->int conversion
|
|
|
|
#
|
|
|
|
|
|
|
|
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-*-*]
|
|
|
|
|| [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
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if the target supports executing NEON instructions, 0
|
|
|
|
# otherwise. Cache the result.
|
|
|
|
|
|
|
|
proc check_effective_target_arm_neon_hw { } {
|
|
|
|
global arm_neon_hw_available_saved
|
|
|
|
global tool
|
|
|
|
|
|
|
|
if [info exists arm_neon_hw_available_saved] {
|
|
|
|
verbose "check_arm_neon_hw_available returning saved $arm_neon_hw_avail
|
|
|
|
able_saved" 2
|
|
|
|
} else {
|
|
|
|
set arm_neon_hw_available_saved 0
|
|
|
|
|
|
|
|
# Set up, compile, and execute a test program containing NEON
|
|
|
|
# instructions. Include the current process ID in the file
|
|
|
|
# names to prevent conflicts with invocations for multiple
|
|
|
|
# testsuites.
|
|
|
|
set src neon[pid].c
|
|
|
|
set exe neon[pid].x
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f "int main() {"
|
|
|
|
puts $f " long long a = 0, b = 1;"
|
|
|
|
puts $f " asm (\"vorr %P0, %P1, %P2\""
|
|
|
|
puts $f " : \"=w\" (a)"
|
|
|
|
puts $f " : \"0\" (a), \"w\" (b));"
|
|
|
|
puts $f " return (a != 1);"
|
|
|
|
puts $f "}"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
set opts "additional_flags=-mfpu=neon additional_flags=-mfloat-abi=softfp"
|
|
|
|
|
|
|
|
verbose "check_arm_neon_hw_available 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_arm_neon_hw_available testfile status is <$status>" 2
|
|
|
|
|
|
|
|
if { $status == "pass" } then {
|
|
|
|
set arm_neon_hw_available_saved 1
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
verbose "check_arm_neon_hw_available testfile compilation failed" 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $arm_neon_hw_available_saved
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Return 1 if this is a PowerPC target supporting -maltivec.
|
|
|
|
|
|
|
|
proc check_effective_target_powerpc_altivec_ok { } {
|
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 { } {
|
|
|
|
global et_ultrasparc_hw_saved
|
|
|
|
global tool
|
|
|
|
|
|
|
|
if [info exists et_ultrasparc_hw_saved] {
|
|
|
|
verbose "check_ultrasparc_hw_available returning saved $et_ultrasparc_hw_saved" 2
|
|
|
|
} else {
|
|
|
|
set et_ultrasparc_hw_saved 0
|
|
|
|
|
|
|
|
# Set up, compile, and execute a simple test program. The
|
|
|
|
# program will be compiled with -mcpu=ultrasparc to instruct the
|
|
|
|
# assembler to produce EM_SPARC32PLUS executables.
|
|
|
|
set src svect[pid].c
|
|
|
|
set exe svect[pid].x
|
|
|
|
|
|
|
|
set f [open $src "w"]
|
|
|
|
puts $f "int main() { return 0; }"
|
|
|
|
close $f
|
|
|
|
|
|
|
|
verbose "check_ultrasparc_hw_available compiling testfile $src" 2
|
|
|
|
set lines [${tool}_target_compile $src $exe executable "additional_flags=-mcpu=ultrasparc"]
|
|
|
|
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_ultrasparc_hw_available testfile status is <$status>" 2
|
|
|
|
|
|
|
|
if { $status == "pass" } then {
|
|
|
|
set et_ultrasparc_hw_saved 1
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
verbose "check_ultrasparc_hw_available testfile compilation failed" 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $et_ultrasparc_hw_saved
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [istarget ia64-*-*]
|
|
|
|
|| [istarget i?86-*-*]
|
|
|
|
|| [istarget x86_64-*-*] } {
|
|
|
|
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-*-*]
|
|
|
|
|| ([istarget powerpc*-*-*] && [check_effective_target_ilp32])
|
|
|
|
|| [istarget x86_64-*-*]
|
|
|
|
|| ([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-*-*]
|
|
|
|
|| [istarget ia64-*-*] } {
|
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
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [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
|
|
|
|
if { [istarget powerpc*-*-*] } {
|
|
|
|
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
|
[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*-*-*]
|
|
|
|
|| [istarget i?86-*-*]
|
|
|
|
|| [istarget x86_64-*-*] } {
|
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
|
|
|
|
if { [istarget powerpc*-*-*]
|
|
|
|
|| [istarget i?86-*-*]
|
|
|
|
|| [istarget x86_64-*-*] } {
|
|
|
|
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
|
|
|
|
if { ( [istarget i?86-*-*] || [istarget x86_64-*-*] )
|
|
|
|
&& (! [istarget *-*-darwin*] ) } {
|
|
|
|
set et_unaligned_stack_saved 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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*-*-*]
|
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
|
|
|
|| [istarget ia64-*-*] } {
|
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
|
|
|
|
}
|
|
|
|
|
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-*-*]
|
|
|
|
|| [istarget i?86-*-*]
|
|
|
|
|| [istarget x86_64-*-*] } {
|
|
|
|
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
|
2005-05-17 06:33:42 +02:00
|
|
|
if { [istarget powerpc*-*-*]
|
2007-07-12 14:17:03 +02:00
|
|
|
|| [istarget spu-*-*]
|
2005-05-17 06:33:42 +02:00
|
|
|
|| [istarget i?86-*-*]
|
|
|
|
|| [istarget x86_64-*-*] } {
|
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
|
|
|
|
if { [istarget powerpc*-*-*] } {
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
# 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-*-*]
|
|
|
|
|| [istarget x86_64-*-*] } {
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
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-*-*]
|
2007-09-12 19:57:05 +02:00
|
|
|
|| [istarget sparcv9-*-*] } {
|
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-*-*]
|
2007-09-12 19:57:05 +02:00
|
|
|
|| [istarget sparcv9-*-*] } {
|
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
|
|
|
|
# <stdint.h>, 0 otherwise.
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
# Return 1 if the target is a VxWorks RTP.
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
# 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
|
|
|
|
}
|
|
|
|
string match "" [get_compiler_messages c99_runtime 0 assembly \
|
|
|
|
$contents [add_options_for_c99_runtime ""]]
|
|
|
|
}]
|
|
|
|
}
|