gcc/gcc/testsuite/lib/target-supports.exp

2679 lines
81 KiB
Plaintext
Raw Normal View History

# 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.
# 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
# (at your option) any later version.
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +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.
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +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/>.
# 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.
# 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.
#
# BASENAME is a basename to use for temporary files.
# 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.
# TYPE is the type of compilation to perform (see target_compile).
# CONTENTS gives the contents of the input file.
# The rest is optional:
# OPTIONS: additional compiler options to use.
proc get_compiler_messages {basename want_output type contents args} {
global tool
if { [llength $args] > 0 } {
set options [list "additional_flags=[lindex $args 0]"]
} else {
set options ""
}
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
set lines [${tool}_target_compile $src $output $type "$options"]
file delete $src
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
}
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
}
# Implement an effective-target check for property PROP by invoking
# the Tcl command ARGS and seeing if it returns true.
proc check_cached_effective_target { prop args } {
global et_cache
set target [current_target_name]
if {![info exists et_cache($prop,target)]
|| $et_cache($prop,target) != $target} {
verbose "check_cached_effective_target $prop: checking $target" 2
set et_cache($prop,target) $target
set et_cache($prop,value) [uplevel eval $args]
}
set value $et_cache($prop,value)
verbose "check_cached_effective_target $prop: returning $value for $target" 2
return $value
}
# 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]
}]
}
# 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} {
return [check_cached_effective_target $prop {
set results [eval get_compiler_messages $prop 1 $args]
expr { [string match "" [lindex $results 0]]
&& [regexp $pattern [lindex $results 1]] }
}]
}
###############################
# 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 { } {
global target_triplet
global target_cpu
# All mips targets should support it
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
if { [ string first "mips" $target_cpu ] >= 0 } {
return 1
}
# All solaris2 targets should support it
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
if { [regexp ".*-solaris2.*" $target_triplet] } {
return 1
}
# DEC OSF/1/Digital UNIX/Tru64 UNIX supports it
if { [regexp "alpha.*osf.*" $target_triplet] } {
return 1
}
# Windows targets Cygwin and MingW32 support it
if { [regexp ".*mingw32|.*cygwin" $target_triplet] } {
return 1
}
# HP-UX 10.X doesn't support it
if { [istarget "hppa*-*-hpux10*"] } {
return 0
}
# 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 }
mach-o { return 1 }
som { return 1 }
unknown { return -1 }
default { return 0 }
}
}
###############################
# proc check_visibility_available { what_kind }
###############################
# The visibility attribute is only support in some object formats
# This proc returns 1 if it is supported, 0 if not.
# The argument is the kind of visibility, default/protected/hidden/internal.
proc check_visibility_available { what_kind } {
global tool
global target_triplet
configure.in: Remove target-libstdc++-v3 from noconfigdirs for *-*-netware... / * configure.in: Remove target-libstdc++-v3 from noconfigdirs for *-*-netware, but add target-libmudflap. Consolidate *-*-netware targets (of which really only i?86 exists) into a single entry. * configure: Likewise. gcc/ * config.gcc: Resurrect NetWare as a target. Handle special case of Novell linker to be used (specified through --with-ld=) and threading model of either Posix (default) or NKS. * config/i386/i386.c (ix86_return_pops_args): Conditionalize popping of incoming hidden argument on KEEP_AGGREGATE_RETURN_POINTER. * config/i386/i386.h (KEEP_AGGREGATE_RETURN_POINTER): New. * config/i386/netware.c, config/i386/netware.h: New. * config/i386/nwld.c, config/i386/nwld.h: New. * config/i386/netware-crt0.c: New. * config/i386/netware-libgcc.c: New. * config/i386/netware-libgcc.def: New. * config/i386/netware-libgcc.exp: New. * config/i386/t-netware, config/i386/t-nwld: New. * gthr-nks.h: New. * doc/install.texi: Document NKS threading model. gcc/cp/ * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather than "-lm". gcc/testsuite/ * g++.dg/abi/bitfield5.C: Use -mno-ms-bitfields. * g++.old-deja/g++.jason/thunk2.C: xfail for NetWare. * g++.old-deja/g++.law/profile1.C: xfail for NetWare. * g++.old-deja/g++.other/store-expr1.C: xfail for NetWare. * gcc.c-torture/compile/20001109-1.c: xfail for NetWare. * gcc.c-torture/compile/20001109-2.c: xfail for NetWare. * gcc.c-torture/execute/multi-ix.c: Use __builtin_bzero rather than the non-portable bzero. * gcc.dg/20010912-1.c: xfail for NetWare. * gcc.dg/20020426-2.c: xfail for NetWare. * gcc.dg/20021014-1.c: xfail for NetWare. * gcc.dg/20021018-1.c: xfail for NetWare. * gcc.dg/20030213-1.c: xfail for NetWare. * gcc.dg/20030225-1.c: xfail for NetWare. * gcc.dg/20030708-1.c: xfail for NetWare. * gcc.dg/builtins-config.h: Also exclude NetWare. * gcc.dg/format/format.h: Define restrict only if not already defined. * gcc.dg/nest.c: xfail for NetWare. * gcc.dg/special/gcsec-1.c: Don't pass -static for NetWare. * lib/target-supports.exp (check_visibility_available): Exclude NetWare. fixincludes/ * inclhack.def: Suppress exception_structure and math_exception for NetWare headers. * fixincl.x: Regenerate. libstdc++-v3/ * crossconfig.m4: Add NetWare as a target. * configure: Regenerate. From-SVN: r87040
2004-09-03 20:10:08 +02:00
# On NetWare, support makes no sense.
if { [istarget *-*-netware*] } {
configure.in: Remove target-libstdc++-v3 from noconfigdirs for *-*-netware... / * configure.in: Remove target-libstdc++-v3 from noconfigdirs for *-*-netware, but add target-libmudflap. Consolidate *-*-netware targets (of which really only i?86 exists) into a single entry. * configure: Likewise. gcc/ * config.gcc: Resurrect NetWare as a target. Handle special case of Novell linker to be used (specified through --with-ld=) and threading model of either Posix (default) or NKS. * config/i386/i386.c (ix86_return_pops_args): Conditionalize popping of incoming hidden argument on KEEP_AGGREGATE_RETURN_POINTER. * config/i386/i386.h (KEEP_AGGREGATE_RETURN_POINTER): New. * config/i386/netware.c, config/i386/netware.h: New. * config/i386/nwld.c, config/i386/nwld.h: New. * config/i386/netware-crt0.c: New. * config/i386/netware-libgcc.c: New. * config/i386/netware-libgcc.def: New. * config/i386/netware-libgcc.exp: New. * config/i386/t-netware, config/i386/t-nwld: New. * gthr-nks.h: New. * doc/install.texi: Document NKS threading model. gcc/cp/ * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather than "-lm". gcc/testsuite/ * g++.dg/abi/bitfield5.C: Use -mno-ms-bitfields. * g++.old-deja/g++.jason/thunk2.C: xfail for NetWare. * g++.old-deja/g++.law/profile1.C: xfail for NetWare. * g++.old-deja/g++.other/store-expr1.C: xfail for NetWare. * gcc.c-torture/compile/20001109-1.c: xfail for NetWare. * gcc.c-torture/compile/20001109-2.c: xfail for NetWare. * gcc.c-torture/execute/multi-ix.c: Use __builtin_bzero rather than the non-portable bzero. * gcc.dg/20010912-1.c: xfail for NetWare. * gcc.dg/20020426-2.c: xfail for NetWare. * gcc.dg/20021014-1.c: xfail for NetWare. * gcc.dg/20021018-1.c: xfail for NetWare. * gcc.dg/20030213-1.c: xfail for NetWare. * gcc.dg/20030225-1.c: xfail for NetWare. * gcc.dg/20030708-1.c: xfail for NetWare. * gcc.dg/builtins-config.h: Also exclude NetWare. * gcc.dg/format/format.h: Define restrict only if not already defined. * gcc.dg/nest.c: xfail for NetWare. * gcc.dg/special/gcsec-1.c: Don't pass -static for NetWare. * lib/target-supports.exp (check_visibility_available): Exclude NetWare. fixincludes/ * inclhack.def: Suppress exception_structure and math_exception for NetWare headers. * fixincl.x: Regenerate. libstdc++-v3/ * crossconfig.m4: Add NetWare as a target. * configure: Regenerate. From-SVN: r87040
2004-09-03 20:10:08 +02:00
return 0
}
if [string match "" $what_kind] { set what_kind "hidden" }
return [check_no_compiler_messages visibility_available_$what_kind object "
void f() __attribute__((visibility(\"$what_kind\")));
void f() {}
"]
}
###############################
# proc check_alias_available { }
###############################
# Determine if the target toolchain supports the alias attribute.
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
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 { } {
global alias_available_saved
global tool
if [info exists alias_available_saved] {
verbose "check_alias_available returning saved $alias_available_saved" 2
} else {
set src alias[pid].c
set obj alias[pid].o
verbose "check_alias_available compiling testfile $src" 2
set f [open $src "w"]
# Compile a small test program. The definition of "g" is
# necessary to keep the Solaris assembler from complaining
# about the program.
puts $f "#ifdef __cplusplus\nextern \"C\"\n#endif\n"
puts $f "void g() {} void f() __attribute__((alias(\"g\")));"
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
2003-06-06 00:18:55 +02:00
close $f
set lines [${tool}_target_compile $src $obj object ""]
file delete $src
remote_file build delete $obj
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
2003-06-06 00:18:55 +02:00
if [string match "" $lines] then {
# No error messages, everything is OK.
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
2003-06-06 00:18:55 +02:00
set alias_available_saved 2
} 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
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
2003-06-06 00:18:55 +02:00
set alias_available_saved -1
} else {
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
2003-06-06 00:18:55 +02:00
set alias_available_saved 0
}
} else {
if [regexp "only weak aliases are supported" $lines] {
verbose "check_alias_available target supports only weak aliases" 2
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
2003-06-06 00:18:55 +02:00
set alias_available_saved 1
} else {
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
2003-06-06 00:18:55 +02:00
set alias_available_saved -1
}
}
}
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
verbose "check_alias_available returning $alias_available_saved" 2
}
return $alias_available_saved
}
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
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
global tool
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
2003-06-06 00:18:55 +02:00
if {![info exists gc_sections_available_saved]} {
# 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
}
# 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
}
# 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
}
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
2003-06-06 00:18:55 +02:00
# Check if the ld used by gcc supports --gc-sections.
configure.in: Remove target-libstdc++-v3 from noconfigdirs for *-*-netware... / * configure.in: Remove target-libstdc++-v3 from noconfigdirs for *-*-netware, but add target-libmudflap. Consolidate *-*-netware targets (of which really only i?86 exists) into a single entry. * configure: Likewise. gcc/ * config.gcc: Resurrect NetWare as a target. Handle special case of Novell linker to be used (specified through --with-ld=) and threading model of either Posix (default) or NKS. * config/i386/i386.c (ix86_return_pops_args): Conditionalize popping of incoming hidden argument on KEEP_AGGREGATE_RETURN_POINTER. * config/i386/i386.h (KEEP_AGGREGATE_RETURN_POINTER): New. * config/i386/netware.c, config/i386/netware.h: New. * config/i386/nwld.c, config/i386/nwld.h: New. * config/i386/netware-crt0.c: New. * config/i386/netware-libgcc.c: New. * config/i386/netware-libgcc.def: New. * config/i386/netware-libgcc.exp: New. * config/i386/t-netware, config/i386/t-nwld: New. * gthr-nks.h: New. * doc/install.texi: Document NKS threading model. gcc/cp/ * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather than "-lm". gcc/testsuite/ * g++.dg/abi/bitfield5.C: Use -mno-ms-bitfields. * g++.old-deja/g++.jason/thunk2.C: xfail for NetWare. * g++.old-deja/g++.law/profile1.C: xfail for NetWare. * g++.old-deja/g++.other/store-expr1.C: xfail for NetWare. * gcc.c-torture/compile/20001109-1.c: xfail for NetWare. * gcc.c-torture/compile/20001109-2.c: xfail for NetWare. * gcc.c-torture/execute/multi-ix.c: Use __builtin_bzero rather than the non-portable bzero. * gcc.dg/20010912-1.c: xfail for NetWare. * gcc.dg/20020426-2.c: xfail for NetWare. * gcc.dg/20021014-1.c: xfail for NetWare. * gcc.dg/20021018-1.c: xfail for NetWare. * gcc.dg/20030213-1.c: xfail for NetWare. * gcc.dg/20030225-1.c: xfail for NetWare. * gcc.dg/20030708-1.c: xfail for NetWare. * gcc.dg/builtins-config.h: Also exclude NetWare. * gcc.dg/format/format.h: Define restrict only if not already defined. * gcc.dg/nest.c: xfail for NetWare. * gcc.dg/special/gcsec-1.c: Don't pass -static for NetWare. * lib/target-supports.exp (check_visibility_available): Exclude NetWare. fixincludes/ * inclhack.def: Suppress exception_structure and math_exception for NetWare headers. * fixincl.x: Regenerate. libstdc++-v3/ * crossconfig.m4: Add NetWare as a target. * configure: Regenerate. From-SVN: r87040
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]
gcc-defs.exp (additional_sources): New variable. * lib/gcc-defs.exp (additional_sources): New variable. (dg-additional-sources): New function. (additional_files): New variable. (dg-additional-files): New function. (dg-additional-files-options): Likewise. * lib/gcc-dg.exp (dg-require-weak): New function. (dg-require-alias): Likewise. (dg-require-gc-sections): Likewise. * lib/target-supports.exp (check_alias_available): Remove testfile parameter. (check_gc_sections_available): New function. * lib/g++-dg.exp (dg-gpp-additional-sources): Remove. (dg-gpp-additional-files): Likewise. * lib/g++.exp (additional_sources): Remove. (additional_files): Likewise. (g++_target_compile): Use dg-additional-files-options. * gcc.dg/special/special.exp: Add "ecos" tests. Remove complex Tcl logic. * gcc.dg/special/ecos.exp: Remove. * gcc.dg/special/20000419-2.c: Use dg-require-*. * gcc.dg/special/alias-1.c: Likewise. * gcc.dg/special/alias-2.c: Likewise. * gcc.dg/special/gcsec-1.c: Likewise. * gcc.dg/special/weak-1.c: Likewise. * gcc.dg/special/weak-2.c: Likewise. * gcc.dg/special/wkali-1.c: Likewise. * gcc.dg/special/wkali-2.c: Likewise. * g++.dg/special/conpr-2.C: Use dg-additional-*, not dg-gpp-additional-*. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.old-deja/g++.abi/vtable3a.C: Likewise. * g++.old-deja/g++.abi/vtable3b.C: Likewise. * g++.old-deja/g++.abi/vtable3c.C: Likewise. * g++.old-deja/g++.abi/vtable3d.C: Likewise. * g++.old-deja/g++.abi/vtable3e.C: Likewise. * g++.old-deja/g++.abi/vtable3f.C: Likewise. * g++.old-deja/g++.abi/vtable3g.C: Likewise. * g++.old-deja/g++.abi/vtable3h.C: Likewise. * g++.old-deja/g++.abi/vtable3i.C: Likewise. * g++.old-deja/g++.abi/vtable3j.C: Likewise. * g++.old-deja/g++.oliva/linkage1.C: Likewise. * g++.old-deja/g++.other/comdat1.C: Likewise. * g++.old-deja/g++.other/comdat2.C: Likewise. * g++.old-deja/g++.other/comdat3.C: Likewise. * g++.old-deja/g++.other/ctor1.C: Likewise. * g++.old-deja/g++.pt/instantiate5.C: Likewise. From-SVN: r67514
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
}
# Return true if profiling is supported on the target.
proc check_profiling_available { test_what } {
global profiling_available_saved
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
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
if { [istarget mips*-*-irix*]
&& ([lindex $test_what 1] == "-p" || [lindex $test_what 1] == "-pg") } {
return 0
}
# At present, there is no profiling support on NetWare.
if { [istarget *-*-netware*] } {
return 0
}
# uClibc does not have gcrt1.o.
if { [check_effective_target_uclibc]
&& ([lindex $test_what 1] == "-p"
|| [lindex $test_what 1] == "-pg") } {
return 0
}
# Now examine the cache variable.
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-*-*]
|| [istarget arm*-*-eabi*]
|| [istarget arm*-*-elf]
|| [istarget arm*-*-symbianelf*]
|| [istarget bfin-*-*]
|| [istarget powerpc-*-eabi*]
|| [istarget strongarm*-*-elf]
|| [istarget xscale*-*-elf]
|| [istarget cris-*-*]
|| [istarget fido-*-elf]
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
|| [istarget h8300-*-*]
target-supports.exp (check_effective_target_int32plus): New. * lib/target-supports.exp (check_effective_target_int32plus): New. (check_effective_target_ptr32plus): New. (check_effective_target_size32plus): New. (check_effective_target_int16): New. (check_profiling_available): Add m32c to the list of unsupported targets. * gcc.c-torture/compile/20000804-1.c: Skip m32c also. * gcc.c-torture/compile/20001226-1.c: Skip m32c due to small memory size. * gcc.c-torture/compile/20010327-1.c: Skip m32c due to non-SI pointers. * gcc.c-torture/compile/20020604-1.c: Skip m32c due to small size_t. * gcc.c-torture/compile/20050303-1.c: Require >=32 bit integers and size_t. * gcc.c-torture/compile/980506-1.c: Require >=32 bit size_t. * gcc.c-torture/execute/20020404-1.x: Check for any 16 bit target, not just xstormy16. Skip m32c due to weird pointer size. * gcc.c-torture/execute/20021024-1.x: Check for any 16 bit target, not just xstormy16. * gcc.c-torture/execute/shiftdi.x: Check for any 16 bit target, not just xstormy16. * gcc.dg/20020312-2.c: Add m32c support. * gcc.dg/20040622-2.c: Require >=32 bit pointers. * gcc.dg/20050321-1.c: XFail m32c due to incorrect malloc prototype in test. * gcc.dg/20050321-2.c: Require >=32 bit integers. * gcc.dg/asm-1.c: Skip if int and short are the same size. * gcc.dg/fold-mod-1.c: Require >=32 bit integers. * gcc.dg/fold-overflow-1.c: Skip m32c due to small const types in asm. * gcc.dg/format/bitfld-1.c: Require >=32 bit integers due to printf formats * gcc.dg/init-string-2.c: Require >=32 bit integers. * gcc.dg/max-1.c: Skip m32c in r8c or m16c mode due to small pointers. * gcc.dg/noncompile/920923-1.c: Skip small-int message for int16 hosts. * gcc.dg/pch/struct-1.c: Require >= 32 bit integers. * gcc.dg/pr14796-2.c: Require >=32 bit integers. * gcc.dg/pr17112-1.c: Require >=32 bit integers. * gcc.dg/pr18241-1.c: XFail m32c due to incorrect memset prototype in test. * gcc.dg/pr18241-2.c: XFail m32c due to incorrect memset prototype in test. * gcc.dg/pr19340.c: Skip m32c due to lack of scheduling. * gcc.dg/pr23049.c: Require >=32 bit integers. * gcc.dg/torture/pr26565.c: Skip m32c as everything is already packed. * gcc.dg/torture/pr26587.c: Require >=32 bit integers. * gcc.dg/torture/pr26630.c: Require >=32 bit integers. * gcc.dg/tree-ssa/loop-10.c: Require >=32 bit integers. * gcc.dg/tree-ssa/loop-2.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/loop-4.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/ltrans-1.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/ltrans-2.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/ltrans-3.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/ltrans-4.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/pr14341.c: Require >=32 bit integers. * gcc.dg/tree-ssa/pr23382.c: XFail m32c due to incorrect malloc prototype in test. * gcc.dg/tree-ssa/pr24627.c: Require >=32 bit integers. * gcc.dg/tree-ssa/pr26180.c: Require >=32 bit integers. * gcc.dg/tree-ssa/vrp14.c: Require >=32 bit integers. * gcc.dg/tree-ssa/vrp21.c: Require >=32 bit integers. * gcc.dg/tree-ssa/vrp22.c: Require >=32 bit integers. * gcc.c-torture/execute/20040629-1.x: New. Require >16 bit integers. * gcc.c-torture/execute/20040703-1.x: Likewise. * gcc.c-torture/execute/20040705-1.x: Likewise. * gcc.c-torture/execute/20040705-2.x: Likewise. * gcc.c-torture/execute/20040709-1.x: Likewise. * gcc.c-torture/execute/20040709-2.x: Likewise. * gcc.c-torture/execute/20040811-1.x: Likewise. * gcc.c-torture/execute/20050316-1.x: Likewise. * gcc.c-torture/execute/bitfld-4.x: Likewise. * gcc.c-torture/execute/pr19689.x: Likewise. * gcc.c-torture/execute/pr7284-1.x: Likewise. * gcc.c-torture/execute/usmul.x: Likewise. * gcc.c-torture/execute/vrp-5.x: Likewise. * gcc.c-torture/execute/vrp-6.x: Likewise. * gcc.dg/debug/20041023-1.s: Likewise. From-SVN: r112934
2006-04-14 01:14:25 +02:00
|| [istarget m32c-*-elf]
|| [istarget m68k-*-elf]
|| [istarget m68k-*-uclinux*]
|| [istarget mips*-*-elf*]
|| [istarget xtensa-*-elf]
|| [istarget *-*-vxworks*]
|| [istarget *-*-windiss] } {
set profiling_available_saved 0
} else {
set profiling_available_saved 1
}
}
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
return $profiling_available_saved
}
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +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 { } {
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];
}]
}
# 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 { } {
# 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];
}]
}
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.
#
# This won't change for different subtargets so cache the result.
proc check_effective_target_tls {} {
global et_tls_saved
global tool
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
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.
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"
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 ""]
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
}
}
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
}
# 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
global tool
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 \
[${tool}_target_compile $src $exe executable ""]
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
}
# Return 1 if compilation with -fopenmp is error-free for trivial
# code, 0 otherwise.
proc check_effective_target_fopenmp {} {
return [check_no_compiler_messages fopenmp object {
void foo (void) { }
} "-fopenmp"]
}
# Return 1 if the target supports -fstack-protector
proc check_effective_target_fstack_protector {} {
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
}
# Return 1 if compilation with -freorder-blocks-and-partition is error-free
# for trivial code, 0 otherwise.
proc check_effective_target_freorder {} {
return [check_no_compiler_messages freorder object {
void foo (void) { }
} "-freorder-blocks-and-partition"]
}
# 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 { } {
# 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 {
extern int foo (void); extern int bar;
int baz (void) { return foo () + bar; }
} "-$arg"] {
return 1
}
}
return 0
}
# Return true if the target supports -mpaired-single (as used on MIPS).
proc check_effective_target_mpaired_single { } {
return [check_no_compiler_messages mpaired_single object {
void foo (void) { }
} "-mpaired-single"]
}
# 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
}]
}
sourcebuild.texi: Document dg-add-options mips16_attribute. gcc/ * doc/sourcebuild.texi: Document dg-add-options mips16_attribute. gcc/testsuite/ * lib/target-supports.exp (add_options_for_mips16_attribute) (check_effective_target_mips16_attribute): New functions. * gcc.target/mips/mips.exp: Define MIPS16 and NOMIPS16 on the command line. (dg-mips-options) Remove -mno-mips16 handling. Add options to extra_test_flags. * gcc.target/mips/asm-1.c (NOMIPS16): Delete. * gcc.target/mips/atomic-memory-1.c (NOMIPS16): Likewise. * gcc.target/mips/atomic-memory-2.c (NOMIPS16): Likewise. * gcc.target/mips/branch-1.c (NOMIPS16): Likewise. * gcc.target/mips/dspr2-MULT.c (NOMIPS16): Likewise. * gcc.target/mips/dspr2-MULTU.c (NOMIPS16): Likewise. * gcc.target/mips/fpcmp-1.c (NOMIPS16): Likewise. * gcc.target/mips/fpcmp-2.c (NOMIPS16): Likewise. * gcc.target/mips/ins-1.c (NOMIPS16): Likewise. * gcc.target/mips/madd-3.c (NOMIPS16): Likewise. * gcc.target/mips/maddu-3.c (NOMIPS16): Likewise. * gcc.target/mips/mips32-dsp-run.c (NOMIPS16): Likewise. * gcc.target/mips/mips32-dspr2-type.c (NOMIPS16): Likewise. * gcc.target/mips/msub-3.c (NOMIPS16): Likewise. * gcc.target/mips/msubu-3.c (NOMIPS16): Likewise. * gcc.target/mips/near-far-3.c (NOMIPS16): Likewise. * gcc.target/mips/near-far-4.c (NOMIPS16): Likewise. * gcc.target/mips/neg-abs-1.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-lwxs.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-1.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-2.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-3.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-4.c (NOMIPS16): Likewise. * gcc.target/mips/pr26765.c: Use dg-mips-options instead of dg-options. (NOMIPS16): Delete. * gcc.target/mips/20020620-1.c: Use dg-mips-options instead of dg-options. * gcc.target/mips/call-saved-1.c: Remove -mips16 and -mno-abicalls options. Require { target mips16_attribute } and use dg-add-options to add the associated options. (foo): Use MIPS16. * gcc.target/mips/call-saved-2.c: As for call-saved-1.c. * gcc.target/mips/call-saved-3.c: Likewise. * gcc.target/mips/code-readable-1.c: Require { target mips16_attribute } and use dg-add-options to add the associated options. Remove trailing whitespace. (NOMIPS16): Delete. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. * gcc.target/mips/mips16-attributes-2.c: Likewise. * gcc.target/mips/mips16e-extends.c: Remove -mips16 option. Require { target mips16_attribute } and use dg-add-options to add the associated options. (cksum16, cksum8): Use MIPS16. * gcc.target/mips/save-restore-1.c: Remove -mips16 option. Require { target mips16_attribute } and use dg-add-options to add the associated options. (foo): Use MIPS16. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. * gcc.target/mips/save-restore-5.c: Likewise. Also remove -mno-abicalls. * gcc.target/mips/mips-sched-madd.c: Remove -mno-mips16. (foo): Use NOMIPS16. From-SVN: r128674
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.
# We don't support MIPS16 PIC, and only support MIPS16 -mhard-float
# for o32 and o64.
sourcebuild.texi: Document dg-add-options mips16_attribute. gcc/ * doc/sourcebuild.texi: Document dg-add-options mips16_attribute. gcc/testsuite/ * lib/target-supports.exp (add_options_for_mips16_attribute) (check_effective_target_mips16_attribute): New functions. * gcc.target/mips/mips.exp: Define MIPS16 and NOMIPS16 on the command line. (dg-mips-options) Remove -mno-mips16 handling. Add options to extra_test_flags. * gcc.target/mips/asm-1.c (NOMIPS16): Delete. * gcc.target/mips/atomic-memory-1.c (NOMIPS16): Likewise. * gcc.target/mips/atomic-memory-2.c (NOMIPS16): Likewise. * gcc.target/mips/branch-1.c (NOMIPS16): Likewise. * gcc.target/mips/dspr2-MULT.c (NOMIPS16): Likewise. * gcc.target/mips/dspr2-MULTU.c (NOMIPS16): Likewise. * gcc.target/mips/fpcmp-1.c (NOMIPS16): Likewise. * gcc.target/mips/fpcmp-2.c (NOMIPS16): Likewise. * gcc.target/mips/ins-1.c (NOMIPS16): Likewise. * gcc.target/mips/madd-3.c (NOMIPS16): Likewise. * gcc.target/mips/maddu-3.c (NOMIPS16): Likewise. * gcc.target/mips/mips32-dsp-run.c (NOMIPS16): Likewise. * gcc.target/mips/mips32-dspr2-type.c (NOMIPS16): Likewise. * gcc.target/mips/msub-3.c (NOMIPS16): Likewise. * gcc.target/mips/msubu-3.c (NOMIPS16): Likewise. * gcc.target/mips/near-far-3.c (NOMIPS16): Likewise. * gcc.target/mips/near-far-4.c (NOMIPS16): Likewise. * gcc.target/mips/neg-abs-1.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-lwxs.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-1.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-2.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-3.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-4.c (NOMIPS16): Likewise. * gcc.target/mips/pr26765.c: Use dg-mips-options instead of dg-options. (NOMIPS16): Delete. * gcc.target/mips/20020620-1.c: Use dg-mips-options instead of dg-options. * gcc.target/mips/call-saved-1.c: Remove -mips16 and -mno-abicalls options. Require { target mips16_attribute } and use dg-add-options to add the associated options. (foo): Use MIPS16. * gcc.target/mips/call-saved-2.c: As for call-saved-1.c. * gcc.target/mips/call-saved-3.c: Likewise. * gcc.target/mips/code-readable-1.c: Require { target mips16_attribute } and use dg-add-options to add the associated options. Remove trailing whitespace. (NOMIPS16): Delete. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. * gcc.target/mips/mips16-attributes-2.c: Likewise. * gcc.target/mips/mips16e-extends.c: Remove -mips16 option. Require { target mips16_attribute } and use dg-add-options to add the associated options. (cksum16, cksum8): Use MIPS16. * gcc.target/mips/save-restore-1.c: Remove -mips16 option. Require { target mips16_attribute } and use dg-add-options to add the associated options. (foo): Use MIPS16. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. * gcc.target/mips/save-restore-5.c: Likewise. Also remove -mno-abicalls. * gcc.target/mips/mips-sched-madd.c: Remove -mno-mips16. (foo): Use NOMIPS16. From-SVN: r128674
2007-09-22 22:10:52 +02:00
proc check_effective_target_mips16_attribute { } {
return [check_no_compiler_messages mips16_attribute assembly {
#ifdef PIC
#error FOO
#endif
#if defined __mips_hard_float \
&& (!defined _ABIO32 || _MIPS_SIM != _ABIO32) \
&& (!defined _ABIO64 || _MIPS_SIM != _ABIO64)
sourcebuild.texi: Document dg-add-options mips16_attribute. gcc/ * doc/sourcebuild.texi: Document dg-add-options mips16_attribute. gcc/testsuite/ * lib/target-supports.exp (add_options_for_mips16_attribute) (check_effective_target_mips16_attribute): New functions. * gcc.target/mips/mips.exp: Define MIPS16 and NOMIPS16 on the command line. (dg-mips-options) Remove -mno-mips16 handling. Add options to extra_test_flags. * gcc.target/mips/asm-1.c (NOMIPS16): Delete. * gcc.target/mips/atomic-memory-1.c (NOMIPS16): Likewise. * gcc.target/mips/atomic-memory-2.c (NOMIPS16): Likewise. * gcc.target/mips/branch-1.c (NOMIPS16): Likewise. * gcc.target/mips/dspr2-MULT.c (NOMIPS16): Likewise. * gcc.target/mips/dspr2-MULTU.c (NOMIPS16): Likewise. * gcc.target/mips/fpcmp-1.c (NOMIPS16): Likewise. * gcc.target/mips/fpcmp-2.c (NOMIPS16): Likewise. * gcc.target/mips/ins-1.c (NOMIPS16): Likewise. * gcc.target/mips/madd-3.c (NOMIPS16): Likewise. * gcc.target/mips/maddu-3.c (NOMIPS16): Likewise. * gcc.target/mips/mips32-dsp-run.c (NOMIPS16): Likewise. * gcc.target/mips/mips32-dspr2-type.c (NOMIPS16): Likewise. * gcc.target/mips/msub-3.c (NOMIPS16): Likewise. * gcc.target/mips/msubu-3.c (NOMIPS16): Likewise. * gcc.target/mips/near-far-3.c (NOMIPS16): Likewise. * gcc.target/mips/near-far-4.c (NOMIPS16): Likewise. * gcc.target/mips/neg-abs-1.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-lwxs.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-1.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-2.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-3.c (NOMIPS16): Likewise. * gcc.target/mips/smartmips-ror-4.c (NOMIPS16): Likewise. * gcc.target/mips/pr26765.c: Use dg-mips-options instead of dg-options. (NOMIPS16): Delete. * gcc.target/mips/20020620-1.c: Use dg-mips-options instead of dg-options. * gcc.target/mips/call-saved-1.c: Remove -mips16 and -mno-abicalls options. Require { target mips16_attribute } and use dg-add-options to add the associated options. (foo): Use MIPS16. * gcc.target/mips/call-saved-2.c: As for call-saved-1.c. * gcc.target/mips/call-saved-3.c: Likewise. * gcc.target/mips/code-readable-1.c: Require { target mips16_attribute } and use dg-add-options to add the associated options. Remove trailing whitespace. (NOMIPS16): Delete. * gcc.target/mips/code-readable-2.c: Likewise. * gcc.target/mips/code-readable-3.c: Likewise. * gcc.target/mips/mips16-attributes-2.c: Likewise. * gcc.target/mips/mips16e-extends.c: Remove -mips16 option. Require { target mips16_attribute } and use dg-add-options to add the associated options. (cksum16, cksum8): Use MIPS16. * gcc.target/mips/save-restore-1.c: Remove -mips16 option. Require { target mips16_attribute } and use dg-add-options to add the associated options. (foo): Use MIPS16. * gcc.target/mips/save-restore-2.c: Likewise. * gcc.target/mips/save-restore-3.c: Likewise. * gcc.target/mips/save-restore-4.c: Likewise. * gcc.target/mips/save-restore-5.c: Likewise. Also remove -mno-abicalls. * gcc.target/mips/mips-sched-madd.c: Remove -mno-mips16. (foo): Use NOMIPS16. From-SVN: r128674
2007-09-22 22:10:52 +02:00
#error FOO
#endif
} [add_options_for_mips16_attribute ""]]
}
# 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
}]
}
# 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
}
# Return true if iconv is supported on the target. In particular IBM1047.
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
proc check_iconv_available { test_what } {
global tool
global libiconv
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
set result ""
set src iconv[pid].c
set exe iconv[pid].x
verbose "check_iconv_available compiling testfile $src" 2
set f [open $src "w"]
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
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
# If the tool configuration file has not set libiconv, try "-liconv"
if { ![info exists libiconv] } {
set libiconv "-liconv"
}
set lines [${tool}_target_compile $src $exe executable "libs=$libiconv" ]
file delete $src
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
if [string match "" $lines] then {
# No error messages, everything is OK.
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
set result [${tool}_load "./$exe" "" ""]
set status [lindex $result 0]
remote_file build delete $exe
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
verbose "check_iconv_available status is <$status>" 2
if { $status == "pass" } then {
return 1
}
target-supports.exp (check-iconv-available): New function. 2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
2004-02-27 03:01:10 +01:00
}
return 0
}
# Return true if named sections are supported on this target.
proc check_named_sections_available { } {
return [check_no_compiler_messages named_sections assembly {
int __attribute__ ((section("whatever"))) foo;
}]
}
c99_functions.c (log10l): New log10l function for systems where this is not available. * intrinsics/c99_functions.c (log10l): New log10l function for systems where this is not available. * c99_protos.h: Prototype for log10l function. * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*, GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update prototypes for gfc_itoa and xtoa. * io/io.h: Update prototypes for set_integer and max_value. * io/list_read.c (convert_integer): Use new GFC_(INTEGER|REAL)_LARGEST type. * io/read.c (set_integer): Likewise. (max_value): Likewise. (convert_real): Likewise. (real_l): Likewise. (next_char): Likewise. (read_decimal): Likewise. (read_radix): Likewise. (read_f): Likewise. * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type. (extract_real): Use new GFC_REAL_LARGEST type. (calculate_exp): Likewise. (calculate_G_format): Likewise. (output_float): Likewise. Use log10l for long double values. Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT. (write_l): Use new GFC_INTEGER_LARGEST type. (write_float): Use new GFC_REAL_LARGEST type. (write_int): Remove useless special case for (len < 8). (write_decimal): Use GFC_INTEGER_LARGEST. (otoa): Use GFC_UINTEGER_LARGEST as argument. (btoa): Use GFC_UINTEGER_LARGEST as argument. * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as argument. (xtoa): Use GFC_UINTEGER_LARGEST as argument. * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h with all Fortran kinds available. * configure.ac: Check for strtold and log10l. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * mk-kinds-h.sh: Configuration script for available integer and real kinds. * lib/target-supports.exp: Add check_effective_target_fortran_large_real and check_effective_target_fortran_large_int to check for corresponding effective targets. * gfortran.dg/large_integer_kind_1.f90: New test. * gfortran.dg/large_real_kind_1.f90: New test. From-SVN: r101274
2005-06-23 20:50:25 +02:00
# Return 1 if the target supports Fortran real kinds larger than real(8),
# 0 otherwise.
#
# When the target name changes, replace the cached result.
c99_functions.c (log10l): New log10l function for systems where this is not available. * intrinsics/c99_functions.c (log10l): New log10l function for systems where this is not available. * c99_protos.h: Prototype for log10l function. * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*, GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update prototypes for gfc_itoa and xtoa. * io/io.h: Update prototypes for set_integer and max_value. * io/list_read.c (convert_integer): Use new GFC_(INTEGER|REAL)_LARGEST type. * io/read.c (set_integer): Likewise. (max_value): Likewise. (convert_real): Likewise. (real_l): Likewise. (next_char): Likewise. (read_decimal): Likewise. (read_radix): Likewise. (read_f): Likewise. * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type. (extract_real): Use new GFC_REAL_LARGEST type. (calculate_exp): Likewise. (calculate_G_format): Likewise. (output_float): Likewise. Use log10l for long double values. Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT. (write_l): Use new GFC_INTEGER_LARGEST type. (write_float): Use new GFC_REAL_LARGEST type. (write_int): Remove useless special case for (len < 8). (write_decimal): Use GFC_INTEGER_LARGEST. (otoa): Use GFC_UINTEGER_LARGEST as argument. (btoa): Use GFC_UINTEGER_LARGEST as argument. * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as argument. (xtoa): Use GFC_UINTEGER_LARGEST as argument. * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h with all Fortran kinds available. * configure.ac: Check for strtold and log10l. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * mk-kinds-h.sh: Configuration script for available integer and real kinds. * lib/target-supports.exp: Add check_effective_target_fortran_large_real and check_effective_target_fortran_large_int to check for corresponding effective targets. * gfortran.dg/large_integer_kind_1.f90: New test. * gfortran.dg/large_real_kind_1.f90: New test. From-SVN: r101274
2005-06-23 20:50:25 +02:00
proc check_effective_target_fortran_large_real { } {
global et_fortran_large_real_saved
global et_fortran_large_real_target_name
c99_functions.c (log10l): New log10l function for systems where this is not available. * intrinsics/c99_functions.c (log10l): New log10l function for systems where this is not available. * c99_protos.h: Prototype for log10l function. * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*, GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update prototypes for gfc_itoa and xtoa. * io/io.h: Update prototypes for set_integer and max_value. * io/list_read.c (convert_integer): Use new GFC_(INTEGER|REAL)_LARGEST type. * io/read.c (set_integer): Likewise. (max_value): Likewise. (convert_real): Likewise. (real_l): Likewise. (next_char): Likewise. (read_decimal): Likewise. (read_radix): Likewise. (read_f): Likewise. * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type. (extract_real): Use new GFC_REAL_LARGEST type. (calculate_exp): Likewise. (calculate_G_format): Likewise. (output_float): Likewise. Use log10l for long double values. Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT. (write_l): Use new GFC_INTEGER_LARGEST type. (write_float): Use new GFC_REAL_LARGEST type. (write_int): Remove useless special case for (len < 8). (write_decimal): Use GFC_INTEGER_LARGEST. (otoa): Use GFC_UINTEGER_LARGEST as argument. (btoa): Use GFC_UINTEGER_LARGEST as argument. * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as argument. (xtoa): Use GFC_UINTEGER_LARGEST as argument. * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h with all Fortran kinds available. * configure.ac: Check for strtold and log10l. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * mk-kinds-h.sh: Configuration script for available integer and real kinds. * lib/target-supports.exp: Add check_effective_target_fortran_large_real and check_effective_target_fortran_large_int to check for corresponding effective targets. * gfortran.dg/large_integer_kind_1.f90: New test. * gfortran.dg/large_real_kind_1.f90: New test. From-SVN: r101274
2005-06-23 20:50:25 +02:00
global tool
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
}
}
c99_functions.c (log10l): New log10l function for systems where this is not available. * intrinsics/c99_functions.c (log10l): New log10l function for systems where this is not available. * c99_protos.h: Prototype for log10l function. * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*, GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update prototypes for gfc_itoa and xtoa. * io/io.h: Update prototypes for set_integer and max_value. * io/list_read.c (convert_integer): Use new GFC_(INTEGER|REAL)_LARGEST type. * io/read.c (set_integer): Likewise. (max_value): Likewise. (convert_real): Likewise. (real_l): Likewise. (next_char): Likewise. (read_decimal): Likewise. (read_radix): Likewise. (read_f): Likewise. * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type. (extract_real): Use new GFC_REAL_LARGEST type. (calculate_exp): Likewise. (calculate_G_format): Likewise. (output_float): Likewise. Use log10l for long double values. Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT. (write_l): Use new GFC_INTEGER_LARGEST type. (write_float): Use new GFC_REAL_LARGEST type. (write_int): Remove useless special case for (len < 8). (write_decimal): Use GFC_INTEGER_LARGEST. (otoa): Use GFC_UINTEGER_LARGEST as argument. (btoa): Use GFC_UINTEGER_LARGEST as argument. * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as argument. (xtoa): Use GFC_UINTEGER_LARGEST as argument. * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h with all Fortran kinds available. * configure.ac: Check for strtold and log10l. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * mk-kinds-h.sh: Configuration script for available integer and real kinds. * lib/target-supports.exp: Add check_effective_target_fortran_large_real and check_effective_target_fortran_large_int to check for corresponding effective targets. * gfortran.dg/large_integer_kind_1.f90: New test. * gfortran.dg/large_real_kind_1.f90: New test. From-SVN: r101274
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"
puts $f "x = cos (x);"
c99_functions.c (log10l): New log10l function for systems where this is not available. * intrinsics/c99_functions.c (log10l): New log10l function for systems where this is not available. * c99_protos.h: Prototype for log10l function. * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*, GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update prototypes for gfc_itoa and xtoa. * io/io.h: Update prototypes for set_integer and max_value. * io/list_read.c (convert_integer): Use new GFC_(INTEGER|REAL)_LARGEST type. * io/read.c (set_integer): Likewise. (max_value): Likewise. (convert_real): Likewise. (real_l): Likewise. (next_char): Likewise. (read_decimal): Likewise. (read_radix): Likewise. (read_f): Likewise. * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type. (extract_real): Use new GFC_REAL_LARGEST type. (calculate_exp): Likewise. (calculate_G_format): Likewise. (output_float): Likewise. Use log10l for long double values. Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT. (write_l): Use new GFC_INTEGER_LARGEST type. (write_float): Use new GFC_REAL_LARGEST type. (write_int): Remove useless special case for (len < 8). (write_decimal): Use GFC_INTEGER_LARGEST. (otoa): Use GFC_UINTEGER_LARGEST as argument. (btoa): Use GFC_UINTEGER_LARGEST as argument. * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as argument. (xtoa): Use GFC_UINTEGER_LARGEST as argument. * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h with all Fortran kinds available. * configure.ac: Check for strtold and log10l. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * mk-kinds-h.sh: Configuration script for available integer and real kinds. * lib/target-supports.exp: Add check_effective_target_fortran_large_real and check_effective_target_fortran_large_int to check for corresponding effective targets. * gfortran.dg/large_integer_kind_1.f90: New test. * gfortran.dg/large_real_kind_1.f90: New test. From-SVN: r101274
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.
remote_file build delete $exe
c99_functions.c (log10l): New log10l function for systems where this is not available. * intrinsics/c99_functions.c (log10l): New log10l function for systems where this is not available. * c99_protos.h: Prototype for log10l function. * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*, GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update prototypes for gfc_itoa and xtoa. * io/io.h: Update prototypes for set_integer and max_value. * io/list_read.c (convert_integer): Use new GFC_(INTEGER|REAL)_LARGEST type. * io/read.c (set_integer): Likewise. (max_value): Likewise. (convert_real): Likewise. (real_l): Likewise. (next_char): Likewise. (read_decimal): Likewise. (read_radix): Likewise. (read_f): Likewise. * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type. (extract_real): Use new GFC_REAL_LARGEST type. (calculate_exp): Likewise. (calculate_G_format): Likewise. (output_float): Likewise. Use log10l for long double values. Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT. (write_l): Use new GFC_INTEGER_LARGEST type. (write_float): Use new GFC_REAL_LARGEST type. (write_int): Remove useless special case for (len < 8). (write_decimal): Use GFC_INTEGER_LARGEST. (otoa): Use GFC_UINTEGER_LARGEST as argument. (btoa): Use GFC_UINTEGER_LARGEST as argument. * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as argument. (xtoa): Use GFC_UINTEGER_LARGEST as argument. * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h with all Fortran kinds available. * configure.ac: Check for strtold and log10l. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * mk-kinds-h.sh: Configuration script for available integer and real kinds. * lib/target-supports.exp: Add check_effective_target_fortran_large_real and check_effective_target_fortran_large_int to check for corresponding effective targets. * gfortran.dg/large_integer_kind_1.f90: New test. * gfortran.dg/large_real_kind_1.f90: New test. From-SVN: r101274
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
# integer(8), 0 otherwise.
#
# When the target name changes, replace the cached result.
c99_functions.c (log10l): New log10l function for systems where this is not available. * intrinsics/c99_functions.c (log10l): New log10l function for systems where this is not available. * c99_protos.h: Prototype for log10l function. * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*, GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update prototypes for gfc_itoa and xtoa. * io/io.h: Update prototypes for set_integer and max_value. * io/list_read.c (convert_integer): Use new GFC_(INTEGER|REAL)_LARGEST type. * io/read.c (set_integer): Likewise. (max_value): Likewise. (convert_real): Likewise. (real_l): Likewise. (next_char): Likewise. (read_decimal): Likewise. (read_radix): Likewise. (read_f): Likewise. * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type. (extract_real): Use new GFC_REAL_LARGEST type. (calculate_exp): Likewise. (calculate_G_format): Likewise. (output_float): Likewise. Use log10l for long double values. Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT. (write_l): Use new GFC_INTEGER_LARGEST type. (write_float): Use new GFC_REAL_LARGEST type. (write_int): Remove useless special case for (len < 8). (write_decimal): Use GFC_INTEGER_LARGEST. (otoa): Use GFC_UINTEGER_LARGEST as argument. (btoa): Use GFC_UINTEGER_LARGEST as argument. * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as argument. (xtoa): Use GFC_UINTEGER_LARGEST as argument. * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h with all Fortran kinds available. * configure.ac: Check for strtold and log10l. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * mk-kinds-h.sh: Configuration script for available integer and real kinds. * lib/target-supports.exp: Add check_effective_target_fortran_large_real and check_effective_target_fortran_large_int to check for corresponding effective targets. * gfortran.dg/large_integer_kind_1.f90: New test. * gfortran.dg/large_real_kind_1.f90: New test. From-SVN: r101274
2005-06-23 20:50:25 +02:00
proc check_effective_target_fortran_large_int { } {
global et_fortran_large_int_saved
global et_fortran_large_int_target_name
c99_functions.c (log10l): New log10l function for systems where this is not available. * intrinsics/c99_functions.c (log10l): New log10l function for systems where this is not available. * c99_protos.h: Prototype for log10l function. * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*, GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update prototypes for gfc_itoa and xtoa. * io/io.h: Update prototypes for set_integer and max_value. * io/list_read.c (convert_integer): Use new GFC_(INTEGER|REAL)_LARGEST type. * io/read.c (set_integer): Likewise. (max_value): Likewise. (convert_real): Likewise. (real_l): Likewise. (next_char): Likewise. (read_decimal): Likewise. (read_radix): Likewise. (read_f): Likewise. * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type. (extract_real): Use new GFC_REAL_LARGEST type. (calculate_exp): Likewise. (calculate_G_format): Likewise. (output_float): Likewise. Use log10l for long double values. Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT. (write_l): Use new GFC_INTEGER_LARGEST type. (write_float): Use new GFC_REAL_LARGEST type. (write_int): Remove useless special case for (len < 8). (write_decimal): Use GFC_INTEGER_LARGEST. (otoa): Use GFC_UINTEGER_LARGEST as argument. (btoa): Use GFC_UINTEGER_LARGEST as argument. * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as argument. (xtoa): Use GFC_UINTEGER_LARGEST as argument. * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h with all Fortran kinds available. * configure.ac: Check for strtold and log10l. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * mk-kinds-h.sh: Configuration script for available integer and real kinds. * lib/target-supports.exp: Add check_effective_target_fortran_large_real and check_effective_target_fortran_large_int to check for corresponding effective targets. * gfortran.dg/large_integer_kind_1.f90: New test. * gfortran.dg/large_real_kind_1.f90: New test. From-SVN: r101274
2005-06-23 20:50:25 +02:00
global tool
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
}
}
c99_functions.c (log10l): New log10l function for systems where this is not available. * intrinsics/c99_functions.c (log10l): New log10l function for systems where this is not available. * c99_protos.h: Prototype for log10l function. * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*, GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update prototypes for gfc_itoa and xtoa. * io/io.h: Update prototypes for set_integer and max_value. * io/list_read.c (convert_integer): Use new GFC_(INTEGER|REAL)_LARGEST type. * io/read.c (set_integer): Likewise. (max_value): Likewise. (convert_real): Likewise. (real_l): Likewise. (next_char): Likewise. (read_decimal): Likewise. (read_radix): Likewise. (read_f): Likewise. * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type. (extract_real): Use new GFC_REAL_LARGEST type. (calculate_exp): Likewise. (calculate_G_format): Likewise. (output_float): Likewise. Use log10l for long double values. Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT. (write_l): Use new GFC_INTEGER_LARGEST type. (write_float): Use new GFC_REAL_LARGEST type. (write_int): Remove useless special case for (len < 8). (write_decimal): Use GFC_INTEGER_LARGEST. (otoa): Use GFC_UINTEGER_LARGEST as argument. (btoa): Use GFC_UINTEGER_LARGEST as argument. * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as argument. (xtoa): Use GFC_UINTEGER_LARGEST as argument. * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h with all Fortran kinds available. * configure.ac: Check for strtold and log10l. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * mk-kinds-h.sh: Configuration script for available integer and real kinds. * lib/target-supports.exp: Add check_effective_target_fortran_large_real and check_effective_target_fortran_large_int to check for corresponding effective targets. * gfortran.dg/large_integer_kind_1.f90: New test. * gfortran.dg/large_real_kind_1.f90: New test. From-SVN: r101274
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.
remote_file build delete $exe
c99_functions.c (log10l): New log10l function for systems where this is not available. * intrinsics/c99_functions.c (log10l): New log10l function for systems where this is not available. * c99_protos.h: Prototype for log10l function. * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*, GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update prototypes for gfc_itoa and xtoa. * io/io.h: Update prototypes for set_integer and max_value. * io/list_read.c (convert_integer): Use new GFC_(INTEGER|REAL)_LARGEST type. * io/read.c (set_integer): Likewise. (max_value): Likewise. (convert_real): Likewise. (real_l): Likewise. (next_char): Likewise. (read_decimal): Likewise. (read_radix): Likewise. (read_f): Likewise. * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type. (extract_real): Use new GFC_REAL_LARGEST type. (calculate_exp): Likewise. (calculate_G_format): Likewise. (output_float): Likewise. Use log10l for long double values. Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT. (write_l): Use new GFC_INTEGER_LARGEST type. (write_float): Use new GFC_REAL_LARGEST type. (write_int): Remove useless special case for (len < 8). (write_decimal): Use GFC_INTEGER_LARGEST. (otoa): Use GFC_UINTEGER_LARGEST as argument. (btoa): Use GFC_UINTEGER_LARGEST as argument. * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as argument. (xtoa): Use GFC_UINTEGER_LARGEST as argument. * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h with all Fortran kinds available. * configure.ac: Check for strtold and log10l. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * mk-kinds-h.sh: Configuration script for available integer and real kinds. * lib/target-supports.exp: Add check_effective_target_fortran_large_real and check_effective_target_fortran_large_int to check for corresponding effective targets. * gfortran.dg/large_integer_kind_1.f90: New test. * gfortran.dg/large_real_kind_1.f90: New test. From-SVN: r101274
2005-06-23 20:50:25 +02:00
set et_fortran_large_int_saved 1
}
}
return $et_fortran_large_int_saved
}
# 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.
set opts "additional_flags=-static"
set src static[pid].f
set exe static[pid].x
set f [open $src "w"]
puts $f " print *, 'test'"
puts $f " end"
close $f
verbose "check_effective_target_static_libgfortran 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.
remote_file build delete $exe
set et_static_libgfortran_saved 1
}
}
return $et_static_libgfortran_saved
}
# 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
# Most targets don't require special flags for this test case, but
# Darwin does.
if { [istarget *-*-darwin*]
|| [istarget *-*-aix*] } {
set opts "additional_flags=-maltivec"
} else {
set opts ""
}
verbose "check_vmx_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_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
}
# 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
}
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
}
# 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"]
puts $f "#ifdef __cplusplus\nextern \"C\"\n#endif\n"
puts $f "char $function ();\n"
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
}
# Returns true iff "fork" is available on the target system.
proc check_fork_available {} {
return [check_function_available "fork"]
}
# Returns true iff "mkfifo" is available on the target system.
proc check_mkfifo_available {} {
if {[istarget *-*-cygwin*]} {
# Cygwin has mkfifo, but support is incomplete.
return 0
}
return [check_function_available "mkfifo"]
}
# 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
} elseif { [istarget "hppa*-*-hpux10*"] } {
# HP-UX 10 doesn't have __cxa_atexit but subsequent test passes.
set et_cxa_atexit 0
} 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
set lines [${tool}_target_compile $src $exe executable ""]
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
}
# Return 1 if we're generating 32-bit code using default options, 0
# otherwise.
proc check_effective_target_ilp32 { } {
return [check_no_compiler_messages ilp32 object {
int dummy[sizeof (int) == 4
&& sizeof (void *) == 4
&& sizeof (long) == 4 ? 1 : -1];
}]
}
target-supports.exp (check_effective_target_int32plus): New. * lib/target-supports.exp (check_effective_target_int32plus): New. (check_effective_target_ptr32plus): New. (check_effective_target_size32plus): New. (check_effective_target_int16): New. (check_profiling_available): Add m32c to the list of unsupported targets. * gcc.c-torture/compile/20000804-1.c: Skip m32c also. * gcc.c-torture/compile/20001226-1.c: Skip m32c due to small memory size. * gcc.c-torture/compile/20010327-1.c: Skip m32c due to non-SI pointers. * gcc.c-torture/compile/20020604-1.c: Skip m32c due to small size_t. * gcc.c-torture/compile/20050303-1.c: Require >=32 bit integers and size_t. * gcc.c-torture/compile/980506-1.c: Require >=32 bit size_t. * gcc.c-torture/execute/20020404-1.x: Check for any 16 bit target, not just xstormy16. Skip m32c due to weird pointer size. * gcc.c-torture/execute/20021024-1.x: Check for any 16 bit target, not just xstormy16. * gcc.c-torture/execute/shiftdi.x: Check for any 16 bit target, not just xstormy16. * gcc.dg/20020312-2.c: Add m32c support. * gcc.dg/20040622-2.c: Require >=32 bit pointers. * gcc.dg/20050321-1.c: XFail m32c due to incorrect malloc prototype in test. * gcc.dg/20050321-2.c: Require >=32 bit integers. * gcc.dg/asm-1.c: Skip if int and short are the same size. * gcc.dg/fold-mod-1.c: Require >=32 bit integers. * gcc.dg/fold-overflow-1.c: Skip m32c due to small const types in asm. * gcc.dg/format/bitfld-1.c: Require >=32 bit integers due to printf formats * gcc.dg/init-string-2.c: Require >=32 bit integers. * gcc.dg/max-1.c: Skip m32c in r8c or m16c mode due to small pointers. * gcc.dg/noncompile/920923-1.c: Skip small-int message for int16 hosts. * gcc.dg/pch/struct-1.c: Require >= 32 bit integers. * gcc.dg/pr14796-2.c: Require >=32 bit integers. * gcc.dg/pr17112-1.c: Require >=32 bit integers. * gcc.dg/pr18241-1.c: XFail m32c due to incorrect memset prototype in test. * gcc.dg/pr18241-2.c: XFail m32c due to incorrect memset prototype in test. * gcc.dg/pr19340.c: Skip m32c due to lack of scheduling. * gcc.dg/pr23049.c: Require >=32 bit integers. * gcc.dg/torture/pr26565.c: Skip m32c as everything is already packed. * gcc.dg/torture/pr26587.c: Require >=32 bit integers. * gcc.dg/torture/pr26630.c: Require >=32 bit integers. * gcc.dg/tree-ssa/loop-10.c: Require >=32 bit integers. * gcc.dg/tree-ssa/loop-2.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/loop-4.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/ltrans-1.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/ltrans-2.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/ltrans-3.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/ltrans-4.c: Require >=32 bit size_t. * gcc.dg/tree-ssa/pr14341.c: Require >=32 bit integers. * gcc.dg/tree-ssa/pr23382.c: XFail m32c due to incorrect malloc prototype in test. * gcc.dg/tree-ssa/pr24627.c: Require >=32 bit integers. * gcc.dg/tree-ssa/pr26180.c: Require >=32 bit integers. * gcc.dg/tree-ssa/vrp14.c: Require >=32 bit integers. * gcc.dg/tree-ssa/vrp21.c: Require >=32 bit integers. * gcc.dg/tree-ssa/vrp22.c: Require >=32 bit integers. * gcc.c-torture/execute/20040629-1.x: New. Require >16 bit integers. * gcc.c-torture/execute/20040703-1.x: Likewise. * gcc.c-torture/execute/20040705-1.x: Likewise. * gcc.c-torture/execute/20040705-2.x: Likewise. * gcc.c-torture/execute/20040709-1.x: Likewise. * gcc.c-torture/execute/20040709-2.x: Likewise. * gcc.c-torture/execute/20040811-1.x: Likewise. * gcc.c-torture/execute/20050316-1.x: Likewise. * gcc.c-torture/execute/bitfld-4.x: Likewise. * gcc.c-torture/execute/pr19689.x: Likewise. * gcc.c-torture/execute/pr7284-1.x: Likewise. * gcc.c-torture/execute/usmul.x: Likewise. * gcc.c-torture/execute/vrp-5.x: Likewise. * gcc.c-torture/execute/vrp-6.x: Likewise. * gcc.dg/debug/20041023-1.s: Likewise. From-SVN: r112934
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];
}]
}
# Return 1 if we're generating 64-bit code using default options, 0
# otherwise.
proc check_effective_target_lp64 { } {
return [check_no_compiler_messages lp64 object {
int dummy[sizeof (int) == 4
&& sizeof (void *) == 8
&& sizeof (long) == 8 ? 1 : -1];
}]
}
# 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;
}]
}
# 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
set ret [string match "" [get_compiler_messages dfp 0 object {
_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 {
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
}
# 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
}
# 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
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
}
}
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-*-*]
|| (([istarget x86_64-*-*] || [istarget i?86-*-*])
&& [check_effective_target_lp64])
|| ([istarget powerpc*-*-*]
&& ([check_effective_target_powerpc_spe]
|| [check_effective_target_powerpc_altivec]))} {
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
}
target-supports.exp (check_effective_target_vect_int): New * lib/target-supports.exp (check_effective_target_vect_int): New (check_effective_target_vect_float): New (check_effective_target_vect_double): New. (is-effective-target): Support new effective targets keywords. * gcc.dg/vect/vect.exp: Set target-dependent vector flags and default action for dg-do. * gcc.dg/vect/pr16105.c: Use new support. * gcc.dg/vect/pr18400.c: Ditto. * gcc.dg/vect/pr18425.c: Ditto. * gcc.dg/vect/vect-1.c: Ditto. * gcc.dg/vect/vect-10.c: Ditto. * gcc.dg/vect/vect-11.c: Ditto. * gcc.dg/vect/vect-12.c: Ditto. * gcc.dg/vect/vect-13.c: Ditto. * gcc.dg/vect/vect-14.c: Ditto. * gcc.dg/vect/vect-15.c: Ditto. * gcc.dg/vect/vect-16.c: Ditto. * gcc.dg/vect/vect-17.c: Ditto. * gcc.dg/vect/vect-18.c: Ditto. * gcc.dg/vect/vect-19.c: Ditto. * gcc.dg/vect/vect-2.c: Ditto. * gcc.dg/vect/vect-20.c: Ditto. * gcc.dg/vect/vect-21.c: Ditto. * gcc.dg/vect/vect-22.c: Ditto. * gcc.dg/vect/vect-23.c: Ditto. * gcc.dg/vect/vect-24.c: Ditto. * gcc.dg/vect/vect-25.c: Ditto. * gcc.dg/vect/vect-26.c: Ditto. * gcc.dg/vect/vect-27.c: Ditto. * gcc.dg/vect/vect-27a.c: Ditto. * gcc.dg/vect/vect-28.c: Ditto. * gcc.dg/vect/vect-29.c: Ditto. * gcc.dg/vect/vect-29a.c: Ditto. * gcc.dg/vect/vect-3.c: Ditto. * gcc.dg/vect/vect-30.c: Ditto. * gcc.dg/vect/vect-31.c: Ditto. * gcc.dg/vect/vect-32.c: Ditto. * gcc.dg/vect/vect-33.c: Ditto. * gcc.dg/vect/vect-34.c: Ditto. * gcc.dg/vect/vect-35.c: Ditto. * gcc.dg/vect/vect-36.c: Ditto. * gcc.dg/vect/vect-37.c: Ditto. * gcc.dg/vect/vect-38.c: Ditto. * gcc.dg/vect/vect-4.c: Ditto. * gcc.dg/vect/vect-40.c: Ditto. * gcc.dg/vect/vect-41.c: Ditto. * gcc.dg/vect/vect-42.c: Ditto. * gcc.dg/vect/vect-43.c: Ditto. * gcc.dg/vect/vect-44.c: Ditto. * gcc.dg/vect/vect-45.c: Ditto. * gcc.dg/vect/vect-46.c: Ditto. * gcc.dg/vect/vect-47.c: Ditto. * gcc.dg/vect/vect-48.c: Ditto. * gcc.dg/vect/vect-48a.c: Ditto. * gcc.dg/vect/vect-49.c: Ditto. * gcc.dg/vect/vect-5.c: Ditto. * gcc.dg/vect/vect-50.c: Ditto. * gcc.dg/vect/vect-51.c: Ditto. * gcc.dg/vect/vect-52.c: Ditto. * gcc.dg/vect/vect-53.c: Ditto. * gcc.dg/vect/vect-54.c: Ditto. * gcc.dg/vect/vect-55.c: Ditto. * gcc.dg/vect/vect-56.c: Ditto. * gcc.dg/vect/vect-56a.c: Ditto. * gcc.dg/vect/vect-57.c: Ditto. * gcc.dg/vect/vect-58.c: Ditto. * gcc.dg/vect/vect-59.c: Ditto. * gcc.dg/vect/vect-6.c: Ditto. * gcc.dg/vect/vect-60.c: Ditto. * gcc.dg/vect/vect-61.c: Ditto. * gcc.dg/vect/vect-62.c: Ditto. * gcc.dg/vect/vect-63.c: Ditto. * gcc.dg/vect/vect-64.c: Ditto. * gcc.dg/vect/vect-65.c: Ditto. * gcc.dg/vect/vect-66.c: Ditto. * gcc.dg/vect/vect-67.c: Ditto. * gcc.dg/vect/vect-68.c: Ditto. * gcc.dg/vect/vect-69.c: Ditto. * gcc.dg/vect/vect-7.c: Ditto. * gcc.dg/vect/vect-72.c: Ditto. * gcc.dg/vect/vect-72a.c: Ditto. * gcc.dg/vect/vect-73.c: Ditto. * gcc.dg/vect/vect-74.c: Ditto. * gcc.dg/vect/vect-75.c: Ditto. * gcc.dg/vect/vect-76.c: Ditto. * gcc.dg/vect/vect-77.c: Ditto. * gcc.dg/vect/vect-77a.c: Ditto. * gcc.dg/vect/vect-78.c: Ditto. * gcc.dg/vect/vect-79.c: Ditto. * gcc.dg/vect/vect-8.c: Ditto. * gcc.dg/vect/vect-80.c: Ditto. * gcc.dg/vect/vect-82.c: Ditto. * gcc.dg/vect/vect-82_64.c: Ditto. * gcc.dg/vect/vect-83.c: Ditto. * gcc.dg/vect/vect-83_64.c: Ditto. * gcc.dg/vect/vect-9.c: Ditto. * gcc.dg/vect/vect-all.c: Ditto. * gcc.dg/vect/vect-none.c: Ditto. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r90831
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*-*-*]
|| [istarget spu-*-*]
target-supports.exp (check_effective_target_vect_int): New * lib/target-supports.exp (check_effective_target_vect_int): New (check_effective_target_vect_float): New (check_effective_target_vect_double): New. (is-effective-target): Support new effective targets keywords. * gcc.dg/vect/vect.exp: Set target-dependent vector flags and default action for dg-do. * gcc.dg/vect/pr16105.c: Use new support. * gcc.dg/vect/pr18400.c: Ditto. * gcc.dg/vect/pr18425.c: Ditto. * gcc.dg/vect/vect-1.c: Ditto. * gcc.dg/vect/vect-10.c: Ditto. * gcc.dg/vect/vect-11.c: Ditto. * gcc.dg/vect/vect-12.c: Ditto. * gcc.dg/vect/vect-13.c: Ditto. * gcc.dg/vect/vect-14.c: Ditto. * gcc.dg/vect/vect-15.c: Ditto. * gcc.dg/vect/vect-16.c: Ditto. * gcc.dg/vect/vect-17.c: Ditto. * gcc.dg/vect/vect-18.c: Ditto. * gcc.dg/vect/vect-19.c: Ditto. * gcc.dg/vect/vect-2.c: Ditto. * gcc.dg/vect/vect-20.c: Ditto. * gcc.dg/vect/vect-21.c: Ditto. * gcc.dg/vect/vect-22.c: Ditto. * gcc.dg/vect/vect-23.c: Ditto. * gcc.dg/vect/vect-24.c: Ditto. * gcc.dg/vect/vect-25.c: Ditto. * gcc.dg/vect/vect-26.c: Ditto. * gcc.dg/vect/vect-27.c: Ditto. * gcc.dg/vect/vect-27a.c: Ditto. * gcc.dg/vect/vect-28.c: Ditto. * gcc.dg/vect/vect-29.c: Ditto. * gcc.dg/vect/vect-29a.c: Ditto. * gcc.dg/vect/vect-3.c: Ditto. * gcc.dg/vect/vect-30.c: Ditto. * gcc.dg/vect/vect-31.c: Ditto. * gcc.dg/vect/vect-32.c: Ditto. * gcc.dg/vect/vect-33.c: Ditto. * gcc.dg/vect/vect-34.c: Ditto. * gcc.dg/vect/vect-35.c: Ditto. * gcc.dg/vect/vect-36.c: Ditto. * gcc.dg/vect/vect-37.c: Ditto. * gcc.dg/vect/vect-38.c: Ditto. * gcc.dg/vect/vect-4.c: Ditto. * gcc.dg/vect/vect-40.c: Ditto. * gcc.dg/vect/vect-41.c: Ditto. * gcc.dg/vect/vect-42.c: Ditto. * gcc.dg/vect/vect-43.c: Ditto. * gcc.dg/vect/vect-44.c: Ditto. * gcc.dg/vect/vect-45.c: Ditto. * gcc.dg/vect/vect-46.c: Ditto. * gcc.dg/vect/vect-47.c: Ditto. * gcc.dg/vect/vect-48.c: Ditto. * gcc.dg/vect/vect-48a.c: Ditto. * gcc.dg/vect/vect-49.c: Ditto. * gcc.dg/vect/vect-5.c: Ditto. * gcc.dg/vect/vect-50.c: Ditto. * gcc.dg/vect/vect-51.c: Ditto. * gcc.dg/vect/vect-52.c: Ditto. * gcc.dg/vect/vect-53.c: Ditto. * gcc.dg/vect/vect-54.c: Ditto. * gcc.dg/vect/vect-55.c: Ditto. * gcc.dg/vect/vect-56.c: Ditto. * gcc.dg/vect/vect-56a.c: Ditto. * gcc.dg/vect/vect-57.c: Ditto. * gcc.dg/vect/vect-58.c: Ditto. * gcc.dg/vect/vect-59.c: Ditto. * gcc.dg/vect/vect-6.c: Ditto. * gcc.dg/vect/vect-60.c: Ditto. * gcc.dg/vect/vect-61.c: Ditto. * gcc.dg/vect/vect-62.c: Ditto. * gcc.dg/vect/vect-63.c: Ditto. * gcc.dg/vect/vect-64.c: Ditto. * gcc.dg/vect/vect-65.c: Ditto. * gcc.dg/vect/vect-66.c: Ditto. * gcc.dg/vect/vect-67.c: Ditto. * gcc.dg/vect/vect-68.c: Ditto. * gcc.dg/vect/vect-69.c: Ditto. * gcc.dg/vect/vect-7.c: Ditto. * gcc.dg/vect/vect-72.c: Ditto. * gcc.dg/vect/vect-72a.c: Ditto. * gcc.dg/vect/vect-73.c: Ditto. * gcc.dg/vect/vect-74.c: Ditto. * gcc.dg/vect/vect-75.c: Ditto. * gcc.dg/vect/vect-76.c: Ditto. * gcc.dg/vect/vect-77.c: Ditto. * gcc.dg/vect/vect-77a.c: Ditto. * gcc.dg/vect/vect-78.c: Ditto. * gcc.dg/vect/vect-79.c: Ditto. * gcc.dg/vect/vect-8.c: Ditto. * gcc.dg/vect/vect-80.c: Ditto. * gcc.dg/vect/vect-82.c: Ditto. * gcc.dg/vect/vect-82_64.c: Ditto. * gcc.dg/vect/vect-83.c: Ditto. * gcc.dg/vect/vect-83_64.c: Ditto. * gcc.dg/vect/vect-9.c: Ditto. * gcc.dg/vect/vect-all.c: Ditto. * gcc.dg/vect/vect-none.c: Ditto. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r90831
2004-11-18 00:47:21 +01:00
|| [istarget x86_64-*-*]
|| [istarget sparc*-*-*]
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
|| [istarget alpha*-*-*]
|| [istarget ia64-*-*] } {
target-supports.exp (check_effective_target_vect_int): New * lib/target-supports.exp (check_effective_target_vect_int): New (check_effective_target_vect_float): New (check_effective_target_vect_double): New. (is-effective-target): Support new effective targets keywords. * gcc.dg/vect/vect.exp: Set target-dependent vector flags and default action for dg-do. * gcc.dg/vect/pr16105.c: Use new support. * gcc.dg/vect/pr18400.c: Ditto. * gcc.dg/vect/pr18425.c: Ditto. * gcc.dg/vect/vect-1.c: Ditto. * gcc.dg/vect/vect-10.c: Ditto. * gcc.dg/vect/vect-11.c: Ditto. * gcc.dg/vect/vect-12.c: Ditto. * gcc.dg/vect/vect-13.c: Ditto. * gcc.dg/vect/vect-14.c: Ditto. * gcc.dg/vect/vect-15.c: Ditto. * gcc.dg/vect/vect-16.c: Ditto. * gcc.dg/vect/vect-17.c: Ditto. * gcc.dg/vect/vect-18.c: Ditto. * gcc.dg/vect/vect-19.c: Ditto. * gcc.dg/vect/vect-2.c: Ditto. * gcc.dg/vect/vect-20.c: Ditto. * gcc.dg/vect/vect-21.c: Ditto. * gcc.dg/vect/vect-22.c: Ditto. * gcc.dg/vect/vect-23.c: Ditto. * gcc.dg/vect/vect-24.c: Ditto. * gcc.dg/vect/vect-25.c: Ditto. * gcc.dg/vect/vect-26.c: Ditto. * gcc.dg/vect/vect-27.c: Ditto. * gcc.dg/vect/vect-27a.c: Ditto. * gcc.dg/vect/vect-28.c: Ditto. * gcc.dg/vect/vect-29.c: Ditto. * gcc.dg/vect/vect-29a.c: Ditto. * gcc.dg/vect/vect-3.c: Ditto. * gcc.dg/vect/vect-30.c: Ditto. * gcc.dg/vect/vect-31.c: Ditto. * gcc.dg/vect/vect-32.c: Ditto. * gcc.dg/vect/vect-33.c: Ditto. * gcc.dg/vect/vect-34.c: Ditto. * gcc.dg/vect/vect-35.c: Ditto. * gcc.dg/vect/vect-36.c: Ditto. * gcc.dg/vect/vect-37.c: Ditto. * gcc.dg/vect/vect-38.c: Ditto. * gcc.dg/vect/vect-4.c: Ditto. * gcc.dg/vect/vect-40.c: Ditto. * gcc.dg/vect/vect-41.c: Ditto. * gcc.dg/vect/vect-42.c: Ditto. * gcc.dg/vect/vect-43.c: Ditto. * gcc.dg/vect/vect-44.c: Ditto. * gcc.dg/vect/vect-45.c: Ditto. * gcc.dg/vect/vect-46.c: Ditto. * gcc.dg/vect/vect-47.c: Ditto. * gcc.dg/vect/vect-48.c: Ditto. * gcc.dg/vect/vect-48a.c: Ditto. * gcc.dg/vect/vect-49.c: Ditto. * gcc.dg/vect/vect-5.c: Ditto. * gcc.dg/vect/vect-50.c: Ditto. * gcc.dg/vect/vect-51.c: Ditto. * gcc.dg/vect/vect-52.c: Ditto. * gcc.dg/vect/vect-53.c: Ditto. * gcc.dg/vect/vect-54.c: Ditto. * gcc.dg/vect/vect-55.c: Ditto. * gcc.dg/vect/vect-56.c: Ditto. * gcc.dg/vect/vect-56a.c: Ditto. * gcc.dg/vect/vect-57.c: Ditto. * gcc.dg/vect/vect-58.c: Ditto. * gcc.dg/vect/vect-59.c: Ditto. * gcc.dg/vect/vect-6.c: Ditto. * gcc.dg/vect/vect-60.c: Ditto. * gcc.dg/vect/vect-61.c: Ditto. * gcc.dg/vect/vect-62.c: Ditto. * gcc.dg/vect/vect-63.c: Ditto. * gcc.dg/vect/vect-64.c: Ditto. * gcc.dg/vect/vect-65.c: Ditto. * gcc.dg/vect/vect-66.c: Ditto. * gcc.dg/vect/vect-67.c: Ditto. * gcc.dg/vect/vect-68.c: Ditto. * gcc.dg/vect/vect-69.c: Ditto. * gcc.dg/vect/vect-7.c: Ditto. * gcc.dg/vect/vect-72.c: Ditto. * gcc.dg/vect/vect-72a.c: Ditto. * gcc.dg/vect/vect-73.c: Ditto. * gcc.dg/vect/vect-74.c: Ditto. * gcc.dg/vect/vect-75.c: Ditto. * gcc.dg/vect/vect-76.c: Ditto. * gcc.dg/vect/vect-77.c: Ditto. * gcc.dg/vect/vect-77a.c: Ditto. * gcc.dg/vect/vect-78.c: Ditto. * gcc.dg/vect/vect-79.c: Ditto. * gcc.dg/vect/vect-8.c: Ditto. * gcc.dg/vect/vect-80.c: Ditto. * gcc.dg/vect/vect-82.c: Ditto. * gcc.dg/vect/vect-82_64.c: Ditto. * gcc.dg/vect/vect-83.c: Ditto. * gcc.dg/vect/vect-83_64.c: Ditto. * gcc.dg/vect/vect-9.c: Ditto. * gcc.dg/vect/vect-all.c: Ditto. * gcc.dg/vect/vect-none.c: Ditto. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r90831
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
}
# 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
}
# Return 1 is this is an arm target using 32-bit instructions
proc check_effective_target_arm32 { } {
return [check_no_compiler_messages arm32 assembly {
#if !defined(__arm__) || (defined(__thumb__) && !defined(__thumb2__))
#error FOO
#endif
}]
}
# 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-*-*] } {
# 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
}
}
# 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
}
}
# 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
}
}
# 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
}
# Return 1 if the target supports hardware vector shift operation.
proc check_effective_target_vect_shift { } {
global et_vect_shift_saved
if [info exists et_vect_shift_saved] {
verbose "check_effective_target_vect_shift: using cached result" 2
} else {
set et_vect_shift_saved 0
if { [istarget powerpc*-*-*]
|| [istarget ia64-*-*]
|| [istarget i?86-*-*]
|| [istarget x86_64-*-*] } {
set et_vect_shift_saved 1
}
}
verbose "check_effective_target_vect_shift: returning $et_vect_shift_saved" 2
return $et_vect_shift_saved
}
# Return 1 if the target supports hardware vectors of long, 0 otherwise.
#
# This can change for different subtargets so do not cache the result.
proc check_effective_target_vect_long { } {
if { [istarget i?86-*-*]
|| ([istarget powerpc*-*-*] && [check_effective_target_ilp32])
|| [istarget x86_64-*-*]
|| ([istarget sparc*-*-*] && [check_effective_target_ilp32]) } {
set answer 1
} else {
set answer 0
}
verbose "check_effective_target_vect_long: returning $answer" 2
return $answer
}
target-supports.exp (check_effective_target_vect_int): New * lib/target-supports.exp (check_effective_target_vect_int): New (check_effective_target_vect_float): New (check_effective_target_vect_double): New. (is-effective-target): Support new effective targets keywords. * gcc.dg/vect/vect.exp: Set target-dependent vector flags and default action for dg-do. * gcc.dg/vect/pr16105.c: Use new support. * gcc.dg/vect/pr18400.c: Ditto. * gcc.dg/vect/pr18425.c: Ditto. * gcc.dg/vect/vect-1.c: Ditto. * gcc.dg/vect/vect-10.c: Ditto. * gcc.dg/vect/vect-11.c: Ditto. * gcc.dg/vect/vect-12.c: Ditto. * gcc.dg/vect/vect-13.c: Ditto. * gcc.dg/vect/vect-14.c: Ditto. * gcc.dg/vect/vect-15.c: Ditto. * gcc.dg/vect/vect-16.c: Ditto. * gcc.dg/vect/vect-17.c: Ditto. * gcc.dg/vect/vect-18.c: Ditto. * gcc.dg/vect/vect-19.c: Ditto. * gcc.dg/vect/vect-2.c: Ditto. * gcc.dg/vect/vect-20.c: Ditto. * gcc.dg/vect/vect-21.c: Ditto. * gcc.dg/vect/vect-22.c: Ditto. * gcc.dg/vect/vect-23.c: Ditto. * gcc.dg/vect/vect-24.c: Ditto. * gcc.dg/vect/vect-25.c: Ditto. * gcc.dg/vect/vect-26.c: Ditto. * gcc.dg/vect/vect-27.c: Ditto. * gcc.dg/vect/vect-27a.c: Ditto. * gcc.dg/vect/vect-28.c: Ditto. * gcc.dg/vect/vect-29.c: Ditto. * gcc.dg/vect/vect-29a.c: Ditto. * gcc.dg/vect/vect-3.c: Ditto. * gcc.dg/vect/vect-30.c: Ditto. * gcc.dg/vect/vect-31.c: Ditto. * gcc.dg/vect/vect-32.c: Ditto. * gcc.dg/vect/vect-33.c: Ditto. * gcc.dg/vect/vect-34.c: Ditto. * gcc.dg/vect/vect-35.c: Ditto. * gcc.dg/vect/vect-36.c: Ditto. * gcc.dg/vect/vect-37.c: Ditto. * gcc.dg/vect/vect-38.c: Ditto. * gcc.dg/vect/vect-4.c: Ditto. * gcc.dg/vect/vect-40.c: Ditto. * gcc.dg/vect/vect-41.c: Ditto. * gcc.dg/vect/vect-42.c: Ditto. * gcc.dg/vect/vect-43.c: Ditto. * gcc.dg/vect/vect-44.c: Ditto. * gcc.dg/vect/vect-45.c: Ditto. * gcc.dg/vect/vect-46.c: Ditto. * gcc.dg/vect/vect-47.c: Ditto. * gcc.dg/vect/vect-48.c: Ditto. * gcc.dg/vect/vect-48a.c: Ditto. * gcc.dg/vect/vect-49.c: Ditto. * gcc.dg/vect/vect-5.c: Ditto. * gcc.dg/vect/vect-50.c: Ditto. * gcc.dg/vect/vect-51.c: Ditto. * gcc.dg/vect/vect-52.c: Ditto. * gcc.dg/vect/vect-53.c: Ditto. * gcc.dg/vect/vect-54.c: Ditto. * gcc.dg/vect/vect-55.c: Ditto. * gcc.dg/vect/vect-56.c: Ditto. * gcc.dg/vect/vect-56a.c: Ditto. * gcc.dg/vect/vect-57.c: Ditto. * gcc.dg/vect/vect-58.c: Ditto. * gcc.dg/vect/vect-59.c: Ditto. * gcc.dg/vect/vect-6.c: Ditto. * gcc.dg/vect/vect-60.c: Ditto. * gcc.dg/vect/vect-61.c: Ditto. * gcc.dg/vect/vect-62.c: Ditto. * gcc.dg/vect/vect-63.c: Ditto. * gcc.dg/vect/vect-64.c: Ditto. * gcc.dg/vect/vect-65.c: Ditto. * gcc.dg/vect/vect-66.c: Ditto. * gcc.dg/vect/vect-67.c: Ditto. * gcc.dg/vect/vect-68.c: Ditto. * gcc.dg/vect/vect-69.c: Ditto. * gcc.dg/vect/vect-7.c: Ditto. * gcc.dg/vect/vect-72.c: Ditto. * gcc.dg/vect/vect-72a.c: Ditto. * gcc.dg/vect/vect-73.c: Ditto. * gcc.dg/vect/vect-74.c: Ditto. * gcc.dg/vect/vect-75.c: Ditto. * gcc.dg/vect/vect-76.c: Ditto. * gcc.dg/vect/vect-77.c: Ditto. * gcc.dg/vect/vect-77a.c: Ditto. * gcc.dg/vect/vect-78.c: Ditto. * gcc.dg/vect/vect-79.c: Ditto. * gcc.dg/vect/vect-8.c: Ditto. * gcc.dg/vect/vect-80.c: Ditto. * gcc.dg/vect/vect-82.c: Ditto. * gcc.dg/vect/vect-82_64.c: Ditto. * gcc.dg/vect/vect-83.c: Ditto. * gcc.dg/vect/vect-83_64.c: Ditto. * gcc.dg/vect/vect-9.c: Ditto. * gcc.dg/vect/vect-all.c: Ditto. * gcc.dg/vect/vect-none.c: Ditto. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r90831
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*-*-*]
|| [istarget spu-*-*]
target-supports.exp (check_effective_target_vect_int): New * lib/target-supports.exp (check_effective_target_vect_int): New (check_effective_target_vect_float): New (check_effective_target_vect_double): New. (is-effective-target): Support new effective targets keywords. * gcc.dg/vect/vect.exp: Set target-dependent vector flags and default action for dg-do. * gcc.dg/vect/pr16105.c: Use new support. * gcc.dg/vect/pr18400.c: Ditto. * gcc.dg/vect/pr18425.c: Ditto. * gcc.dg/vect/vect-1.c: Ditto. * gcc.dg/vect/vect-10.c: Ditto. * gcc.dg/vect/vect-11.c: Ditto. * gcc.dg/vect/vect-12.c: Ditto. * gcc.dg/vect/vect-13.c: Ditto. * gcc.dg/vect/vect-14.c: Ditto. * gcc.dg/vect/vect-15.c: Ditto. * gcc.dg/vect/vect-16.c: Ditto. * gcc.dg/vect/vect-17.c: Ditto. * gcc.dg/vect/vect-18.c: Ditto. * gcc.dg/vect/vect-19.c: Ditto. * gcc.dg/vect/vect-2.c: Ditto. * gcc.dg/vect/vect-20.c: Ditto. * gcc.dg/vect/vect-21.c: Ditto. * gcc.dg/vect/vect-22.c: Ditto. * gcc.dg/vect/vect-23.c: Ditto. * gcc.dg/vect/vect-24.c: Ditto. * gcc.dg/vect/vect-25.c: Ditto. * gcc.dg/vect/vect-26.c: Ditto. * gcc.dg/vect/vect-27.c: Ditto. * gcc.dg/vect/vect-27a.c: Ditto. * gcc.dg/vect/vect-28.c: Ditto. * gcc.dg/vect/vect-29.c: Ditto. * gcc.dg/vect/vect-29a.c: Ditto. * gcc.dg/vect/vect-3.c: Ditto. * gcc.dg/vect/vect-30.c: Ditto. * gcc.dg/vect/vect-31.c: Ditto. * gcc.dg/vect/vect-32.c: Ditto. * gcc.dg/vect/vect-33.c: Ditto. * gcc.dg/vect/vect-34.c: Ditto. * gcc.dg/vect/vect-35.c: Ditto. * gcc.dg/vect/vect-36.c: Ditto. * gcc.dg/vect/vect-37.c: Ditto. * gcc.dg/vect/vect-38.c: Ditto. * gcc.dg/vect/vect-4.c: Ditto. * gcc.dg/vect/vect-40.c: Ditto. * gcc.dg/vect/vect-41.c: Ditto. * gcc.dg/vect/vect-42.c: Ditto. * gcc.dg/vect/vect-43.c: Ditto. * gcc.dg/vect/vect-44.c: Ditto. * gcc.dg/vect/vect-45.c: Ditto. * gcc.dg/vect/vect-46.c: Ditto. * gcc.dg/vect/vect-47.c: Ditto. * gcc.dg/vect/vect-48.c: Ditto. * gcc.dg/vect/vect-48a.c: Ditto. * gcc.dg/vect/vect-49.c: Ditto. * gcc.dg/vect/vect-5.c: Ditto. * gcc.dg/vect/vect-50.c: Ditto. * gcc.dg/vect/vect-51.c: Ditto. * gcc.dg/vect/vect-52.c: Ditto. * gcc.dg/vect/vect-53.c: Ditto. * gcc.dg/vect/vect-54.c: Ditto. * gcc.dg/vect/vect-55.c: Ditto. * gcc.dg/vect/vect-56.c: Ditto. * gcc.dg/vect/vect-56a.c: Ditto. * gcc.dg/vect/vect-57.c: Ditto. * gcc.dg/vect/vect-58.c: Ditto. * gcc.dg/vect/vect-59.c: Ditto. * gcc.dg/vect/vect-6.c: Ditto. * gcc.dg/vect/vect-60.c: Ditto. * gcc.dg/vect/vect-61.c: Ditto. * gcc.dg/vect/vect-62.c: Ditto. * gcc.dg/vect/vect-63.c: Ditto. * gcc.dg/vect/vect-64.c: Ditto. * gcc.dg/vect/vect-65.c: Ditto. * gcc.dg/vect/vect-66.c: Ditto. * gcc.dg/vect/vect-67.c: Ditto. * gcc.dg/vect/vect-68.c: Ditto. * gcc.dg/vect/vect-69.c: Ditto. * gcc.dg/vect/vect-7.c: Ditto. * gcc.dg/vect/vect-72.c: Ditto. * gcc.dg/vect/vect-72a.c: Ditto. * gcc.dg/vect/vect-73.c: Ditto. * gcc.dg/vect/vect-74.c: Ditto. * gcc.dg/vect/vect-75.c: Ditto. * gcc.dg/vect/vect-76.c: Ditto. * gcc.dg/vect/vect-77.c: Ditto. * gcc.dg/vect/vect-77a.c: Ditto. * gcc.dg/vect/vect-78.c: Ditto. * gcc.dg/vect/vect-79.c: Ditto. * gcc.dg/vect/vect-8.c: Ditto. * gcc.dg/vect/vect-80.c: Ditto. * gcc.dg/vect/vect-82.c: Ditto. * gcc.dg/vect/vect-82_64.c: Ditto. * gcc.dg/vect/vect-83.c: Ditto. * gcc.dg/vect/vect-83_64.c: Ditto. * gcc.dg/vect/vect-9.c: Ditto. * gcc.dg/vect/vect-all.c: Ditto. * gcc.dg/vect/vect-none.c: Ditto. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r90831
2004-11-18 00:47:21 +01:00
|| [istarget mipsisa64*-*-*]
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
2005-01-03 20:59:13 +01:00
|| [istarget x86_64-*-*]
|| [istarget ia64-*-*] } {
target-supports.exp (check_effective_target_vect_int): New * lib/target-supports.exp (check_effective_target_vect_int): New (check_effective_target_vect_float): New (check_effective_target_vect_double): New. (is-effective-target): Support new effective targets keywords. * gcc.dg/vect/vect.exp: Set target-dependent vector flags and default action for dg-do. * gcc.dg/vect/pr16105.c: Use new support. * gcc.dg/vect/pr18400.c: Ditto. * gcc.dg/vect/pr18425.c: Ditto. * gcc.dg/vect/vect-1.c: Ditto. * gcc.dg/vect/vect-10.c: Ditto. * gcc.dg/vect/vect-11.c: Ditto. * gcc.dg/vect/vect-12.c: Ditto. * gcc.dg/vect/vect-13.c: Ditto. * gcc.dg/vect/vect-14.c: Ditto. * gcc.dg/vect/vect-15.c: Ditto. * gcc.dg/vect/vect-16.c: Ditto. * gcc.dg/vect/vect-17.c: Ditto. * gcc.dg/vect/vect-18.c: Ditto. * gcc.dg/vect/vect-19.c: Ditto. * gcc.dg/vect/vect-2.c: Ditto. * gcc.dg/vect/vect-20.c: Ditto. * gcc.dg/vect/vect-21.c: Ditto. * gcc.dg/vect/vect-22.c: Ditto. * gcc.dg/vect/vect-23.c: Ditto. * gcc.dg/vect/vect-24.c: Ditto. * gcc.dg/vect/vect-25.c: Ditto. * gcc.dg/vect/vect-26.c: Ditto. * gcc.dg/vect/vect-27.c: Ditto. * gcc.dg/vect/vect-27a.c: Ditto. * gcc.dg/vect/vect-28.c: Ditto. * gcc.dg/vect/vect-29.c: Ditto. * gcc.dg/vect/vect-29a.c: Ditto. * gcc.dg/vect/vect-3.c: Ditto. * gcc.dg/vect/vect-30.c: Ditto. * gcc.dg/vect/vect-31.c: Ditto. * gcc.dg/vect/vect-32.c: Ditto. * gcc.dg/vect/vect-33.c: Ditto. * gcc.dg/vect/vect-34.c: Ditto. * gcc.dg/vect/vect-35.c: Ditto. * gcc.dg/vect/vect-36.c: Ditto. * gcc.dg/vect/vect-37.c: Ditto. * gcc.dg/vect/vect-38.c: Ditto. * gcc.dg/vect/vect-4.c: Ditto. * gcc.dg/vect/vect-40.c: Ditto. * gcc.dg/vect/vect-41.c: Ditto. * gcc.dg/vect/vect-42.c: Ditto. * gcc.dg/vect/vect-43.c: Ditto. * gcc.dg/vect/vect-44.c: Ditto. * gcc.dg/vect/vect-45.c: Ditto. * gcc.dg/vect/vect-46.c: Ditto. * gcc.dg/vect/vect-47.c: Ditto. * gcc.dg/vect/vect-48.c: Ditto. * gcc.dg/vect/vect-48a.c: Ditto. * gcc.dg/vect/vect-49.c: Ditto. * gcc.dg/vect/vect-5.c: Ditto. * gcc.dg/vect/vect-50.c: Ditto. * gcc.dg/vect/vect-51.c: Ditto. * gcc.dg/vect/vect-52.c: Ditto. * gcc.dg/vect/vect-53.c: Ditto. * gcc.dg/vect/vect-54.c: Ditto. * gcc.dg/vect/vect-55.c: Ditto. * gcc.dg/vect/vect-56.c: Ditto. * gcc.dg/vect/vect-56a.c: Ditto. * gcc.dg/vect/vect-57.c: Ditto. * gcc.dg/vect/vect-58.c: Ditto. * gcc.dg/vect/vect-59.c: Ditto. * gcc.dg/vect/vect-6.c: Ditto. * gcc.dg/vect/vect-60.c: Ditto. * gcc.dg/vect/vect-61.c: Ditto. * gcc.dg/vect/vect-62.c: Ditto. * gcc.dg/vect/vect-63.c: Ditto. * gcc.dg/vect/vect-64.c: Ditto. * gcc.dg/vect/vect-65.c: Ditto. * gcc.dg/vect/vect-66.c: Ditto. * gcc.dg/vect/vect-67.c: Ditto. * gcc.dg/vect/vect-68.c: Ditto. * gcc.dg/vect/vect-69.c: Ditto. * gcc.dg/vect/vect-7.c: Ditto. * gcc.dg/vect/vect-72.c: Ditto. * gcc.dg/vect/vect-72a.c: Ditto. * gcc.dg/vect/vect-73.c: Ditto. * gcc.dg/vect/vect-74.c: Ditto. * gcc.dg/vect/vect-75.c: Ditto. * gcc.dg/vect/vect-76.c: Ditto. * gcc.dg/vect/vect-77.c: Ditto. * gcc.dg/vect/vect-77a.c: Ditto. * gcc.dg/vect/vect-78.c: Ditto. * gcc.dg/vect/vect-79.c: Ditto. * gcc.dg/vect/vect-8.c: Ditto. * gcc.dg/vect/vect-80.c: Ditto. * gcc.dg/vect/vect-82.c: Ditto. * gcc.dg/vect/vect-82_64.c: Ditto. * gcc.dg/vect/vect-83.c: Ditto. * gcc.dg/vect/vect-83_64.c: Ditto. * gcc.dg/vect/vect-9.c: Ditto. * gcc.dg/vect/vect-all.c: Ditto. * gcc.dg/vect/vect-none.c: Ditto. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r90831
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-*-*]
|| [istarget x86_64-*-*]
|| [istarget spu-*-*] } {
target-supports.exp (check_effective_target_vect_int): New * lib/target-supports.exp (check_effective_target_vect_int): New (check_effective_target_vect_float): New (check_effective_target_vect_double): New. (is-effective-target): Support new effective targets keywords. * gcc.dg/vect/vect.exp: Set target-dependent vector flags and default action for dg-do. * gcc.dg/vect/pr16105.c: Use new support. * gcc.dg/vect/pr18400.c: Ditto. * gcc.dg/vect/pr18425.c: Ditto. * gcc.dg/vect/vect-1.c: Ditto. * gcc.dg/vect/vect-10.c: Ditto. * gcc.dg/vect/vect-11.c: Ditto. * gcc.dg/vect/vect-12.c: Ditto. * gcc.dg/vect/vect-13.c: Ditto. * gcc.dg/vect/vect-14.c: Ditto. * gcc.dg/vect/vect-15.c: Ditto. * gcc.dg/vect/vect-16.c: Ditto. * gcc.dg/vect/vect-17.c: Ditto. * gcc.dg/vect/vect-18.c: Ditto. * gcc.dg/vect/vect-19.c: Ditto. * gcc.dg/vect/vect-2.c: Ditto. * gcc.dg/vect/vect-20.c: Ditto. * gcc.dg/vect/vect-21.c: Ditto. * gcc.dg/vect/vect-22.c: Ditto. * gcc.dg/vect/vect-23.c: Ditto. * gcc.dg/vect/vect-24.c: Ditto. * gcc.dg/vect/vect-25.c: Ditto. * gcc.dg/vect/vect-26.c: Ditto. * gcc.dg/vect/vect-27.c: Ditto. * gcc.dg/vect/vect-27a.c: Ditto. * gcc.dg/vect/vect-28.c: Ditto. * gcc.dg/vect/vect-29.c: Ditto. * gcc.dg/vect/vect-29a.c: Ditto. * gcc.dg/vect/vect-3.c: Ditto. * gcc.dg/vect/vect-30.c: Ditto. * gcc.dg/vect/vect-31.c: Ditto. * gcc.dg/vect/vect-32.c: Ditto. * gcc.dg/vect/vect-33.c: Ditto. * gcc.dg/vect/vect-34.c: Ditto. * gcc.dg/vect/vect-35.c: Ditto. * gcc.dg/vect/vect-36.c: Ditto. * gcc.dg/vect/vect-37.c: Ditto. * gcc.dg/vect/vect-38.c: Ditto. * gcc.dg/vect/vect-4.c: Ditto. * gcc.dg/vect/vect-40.c: Ditto. * gcc.dg/vect/vect-41.c: Ditto. * gcc.dg/vect/vect-42.c: Ditto. * gcc.dg/vect/vect-43.c: Ditto. * gcc.dg/vect/vect-44.c: Ditto. * gcc.dg/vect/vect-45.c: Ditto. * gcc.dg/vect/vect-46.c: Ditto. * gcc.dg/vect/vect-47.c: Ditto. * gcc.dg/vect/vect-48.c: Ditto. * gcc.dg/vect/vect-48a.c: Ditto. * gcc.dg/vect/vect-49.c: Ditto. * gcc.dg/vect/vect-5.c: Ditto. * gcc.dg/vect/vect-50.c: Ditto. * gcc.dg/vect/vect-51.c: Ditto. * gcc.dg/vect/vect-52.c: Ditto. * gcc.dg/vect/vect-53.c: Ditto. * gcc.dg/vect/vect-54.c: Ditto. * gcc.dg/vect/vect-55.c: Ditto. * gcc.dg/vect/vect-56.c: Ditto. * gcc.dg/vect/vect-56a.c: Ditto. * gcc.dg/vect/vect-57.c: Ditto. * gcc.dg/vect/vect-58.c: Ditto. * gcc.dg/vect/vect-59.c: Ditto. * gcc.dg/vect/vect-6.c: Ditto. * gcc.dg/vect/vect-60.c: Ditto. * gcc.dg/vect/vect-61.c: Ditto. * gcc.dg/vect/vect-62.c: Ditto. * gcc.dg/vect/vect-63.c: Ditto. * gcc.dg/vect/vect-64.c: Ditto. * gcc.dg/vect/vect-65.c: Ditto. * gcc.dg/vect/vect-66.c: Ditto. * gcc.dg/vect/vect-67.c: Ditto. * gcc.dg/vect/vect-68.c: Ditto. * gcc.dg/vect/vect-69.c: Ditto. * gcc.dg/vect/vect-7.c: Ditto. * gcc.dg/vect/vect-72.c: Ditto. * gcc.dg/vect/vect-72a.c: Ditto. * gcc.dg/vect/vect-73.c: Ditto. * gcc.dg/vect/vect-74.c: Ditto. * gcc.dg/vect/vect-75.c: Ditto. * gcc.dg/vect/vect-76.c: Ditto. * gcc.dg/vect/vect-77.c: Ditto. * gcc.dg/vect/vect-77a.c: Ditto. * gcc.dg/vect/vect-78.c: Ditto. * gcc.dg/vect/vect-79.c: Ditto. * gcc.dg/vect/vect-8.c: Ditto. * gcc.dg/vect/vect-80.c: Ditto. * gcc.dg/vect/vect-82.c: Ditto. * gcc.dg/vect/vect-82_64.c: Ditto. * gcc.dg/vect/vect-83.c: Ditto. * gcc.dg/vect/vect-83_64.c: Ditto. * gcc.dg/vect/vect-9.c: Ditto. * gcc.dg/vect/vect-all.c: Ditto. * gcc.dg/vect/vect-none.c: Ditto. Co-Authored-By: Aldy Hernandez <aldyh@redhat.com> From-SVN: r90831
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
}
# Return 1 if the target plus current options does not support a vector
# max instruction on "int", 0 otherwise.
#
# This won't change for different subtargets so cache the result.
proc check_effective_target_vect_no_int_max { } {
global et_vect_no_int_max_saved
if [info exists et_vect_no_int_max_saved] {
verbose "check_effective_target_vect_no_int_max: using cached result" 2
} else {
set et_vect_no_int_max_saved 0
if { [istarget sparc*-*-*]
|| [istarget spu-*-*]
|| [istarget alpha*-*-*] } {
set et_vect_no_int_max_saved 1
}
}
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
}
# 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
}
# 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.
#
# 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
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]
if { [istarget powerpc*-*-*]
|| [istarget ia64-*-*] } {
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.
#
# 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
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
if { [check_effective_target_vect_unpack]
|| [istarget ia64-*-*] } {
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
}
}
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
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
}
if { [istarget powerpc*-*-*]
|| [istarget spu-*-*]
|| [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.
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
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 {
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-*-*] } {
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
}
}
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
}
# 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
}
# 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
if { [istarget mipsisa64*-*-*]
ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. (ia64_const_ok_for_letter_p): New. (ia64_const_double_ok_for_letter_p): New. (ia64_extra_constraint): New. (ia64_expand_vecint_compare): New. (ia64_expand_vcondu_v2si): New. (ia64_expand_vecint_cmov): New. (ia64_expand_vecint_minmax): New. (ia64_print_operand): Add 'v'. (ia64_preferred_reload_class): New. (ia64_vector_mode_supported_p): New. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. (PREFERRED_RELOAD_CLASS): Move to function. (CONST_OK_FOR_LETTER_P): Move to function. (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. (EXTRA_CONSTRAINT): Move to function. * config/ia64/ia64.md: Include vect.md. (itanium_class): Add mmalua. (type): Handle it. * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. (1b_mmalua): New. * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any CONST0_RTX. (const_int_2bit_operand): New. (fr_reg_or_0_operand): New. * config/ia64/ia64-modes.def: Add vector modes. * config/ia64/ia64-protos.h: Update. * config/ia64/vect.md: New file. * gcc.dg/vect/vect.exp: Enable for ia64. * lib/target-supports.exp (check_effective_target_vect_int): Likewise. (check_effective_target_vect_float): Likewise. (check_effective_target_vect_no_align): Likewise. * gcc.dg/vect/vect-30.c: XFAIL for vect_no_align. * gcc.dg/vect/vect-8.c: Likewise. From-SVN: r92862
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-*-*] } {
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
}
# Return 1 if arrays are aligned to the vector alignment
# boundary, 0 otherwise.
#
# 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
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
2007-10-21 12:01:16 +02:00
if { (([istarget x86_64-*-*]
|| [istarget i?86-*-*]) && [is-effective-target lp64])
|| [istarget spu-*-*] } {
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
}
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
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.
#
# This won't change for different subtargets so cache the result.
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
2007-10-21 12:01:16 +02:00
proc check_effective_target_natural_alignment_64 { } {
global et_natural_alignment_64
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
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
} else {
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
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
}
}
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
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
}
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
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.
#
# 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]
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
2007-10-21 12:01:16 +02:00
|| [check_effective_target_natural_alignment_32] } {
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
}
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
2007-10-21 12:01:16 +02:00
# Return 1 if vector alignment for 64 bit is reachable, 0 otherwise.
#
# This won't change for different subtargets so cache the result.
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
2007-10-21 12:01:16 +02:00
proc check_effective_target_vector_alignment_reachable_for_64bit { } {
global et_vector_alignment_reachable_for_64bit
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
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
} else {
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
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
} else {
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
2007-10-21 12:01:16 +02:00
set et_vector_alignment_reachable_for_64bit_saved 0
}
}
vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-5.c: Require vect_int. * gcc.dg/vect/vect-16.c: Fix comment. * gcc.dg/vect/pr33369.c: Require vect_int. * gcc.dg/vect/slp-33.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-18.c: Enable only for vect_interleave targets. * gcc.dg/vect/vect-ifcvt-6.c: Require vect_int. * gcc.dg/vect/no-scevccp-outer-19.c: Enable only for vect_unpack targets. * gcc.dg/vect/vect-ifcvt-7.c: Require vect_int. * gcc.dg/vect/vect-strided-store-u16-i4.c: Add vect_unpack to targets. * gcc.dg/vect/slp-10.c: Add spaces. * gcc.dg/vect/no-scevccp-outer-21.c: Enable only for vect_pack_trunc targets. * gcc.dg/vect/slp-36.c: Require vect_int. * gcc.dg/vect/vect-ifcvt-9.c, gcc.dg/vect/vect-strided-store-u32-i2.c, gcc.dg/vect/vect-ifcvt-2.c, gcc.dg/vect/vect-ifcvt-3.c, gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Likewise. * gcc.dg/vect/no-scevccp-outer-16.c: Enable only for vect_unpack targets. * gcc.dg/vect/no-scevccp-outer-17.c: Likewise. * gcc.dg/vect/pr25413.c: Use vector alignment_reachable_for_64bit instead of vector_alignment_reachable_for_double. * lib/target-supports.exp (vect_aligned_arrays): Add spu-*-*. (natural_alignment): Split into... (natural_alignment_32, natural_alignment_64): New. (vector_alignment_reachable): Depend on natural_alignment_32. (vector_alignment_reachable_for_double): Rename to ... (vector_alignment_reachable_for_64bit): And depend on natural_alignment_64. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r129529
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
}
# Return 1 if the target supports vector conditional operations, 0 otherwise.
proc check_effective_target_vect_condition { } {
global et_vect_cond_saved
if [info exists et_vect_cond_saved] {
verbose "check_effective_target_vect_cond: using cached result" 2
} else {
set et_vect_cond_saved 0
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-*-*]
|| [istarget x86_64-*-*] } {
set et_vect_cond_saved 1
}
}
verbose "check_effective_target_vect_cond: returning $et_vect_cond_saved" 2
return $et_vect_cond_saved
}
# 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
}
# Return 1 if the target supports vector int multiplication, 0 otherwise.
proc check_effective_target_vect_int_mult { } {
global et_vect_int_mult_saved
if [info exists et_vect_int_mult_saved] {
verbose "check_effective_target_vect_int_mult: using cached result" 2
} else {
set et_vect_int_mult_saved 0
if { [istarget powerpc*-*-*]
target.h (builtin_vectorization_cost): Add new target builtin. 2007-07-12 Dorit Nuzman <dorit@il.ibm.com> * target.h (builtin_vectorization_cost): Add new target builtin. * target-def.h (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): New. * tree-vectorizer.h (TARG_SCALAR_STMT_COST): New. (TARG_SCALAR_LOAD_COST, TARG_SCALAR_STORE_COST): New. * tree-vect-analyze.c (vect_analyze_slp_instance): Initisliaze uninitialized variables. * tree-vect-transform.c (cost_for_stmt): New function. (vect_estimate_min_profitable_iters): Call cost_for_stmt instead of using cost 1 for all scalar stmts. Be less conservative when estimating the number of prologue/epulogue iterations. Call targetm.vectorize.builtin_vectorization_cost. Return min_profitable_iters-1. (vect_model_reduction_cost): Use TARG_SCALAR_TO_VEC_COST for initialization cost instead of TARG_VEC_STMT_COST. Use TARG_VEC_TO_SCALAR_COST instead of TARG_VEC_STMT_COST for reduction epilogue code. Fix epilogue cost computation. * config/spu/spu.c (spu_builtin_vectorization_cost): New. (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Implement. * config/spu/spu.h (TARG_COND_BRANCH_COST, TARG_SCALAR_STMT_COST): (TARG_SCALAR_LOAD_COST, TARG_SCALAR_STORE_COST, TARG_VEC_STMT_COST): (TARG_VEC_TO_SCALAR_COST, TARG_SCALAR_TO_VEC, TARG_VEC_LOAD_COST): (TARG_VEC_UNALIGNED_LOAD_COST, TARG_VEC_STORE_COST): Define. 2007-07-12 Dorit Nuzman <dorit@il.ibm.com> * gcc.dg/vect/costmodel/ppc/costmodel-vect-reduc-1char.c: Loops now get vectorized. * gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c: Loops now get vectorized. * gcc.dg/vect/costmodel/spu/spu-costmodel-vect.exp: New. * gcc.dg/vect/costmodel/spu/costmodel-fast-math-vect-pr29925.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-31a.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-31b.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-31c.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-31d.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-iv-9.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-33.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-68a.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-68b.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-68c.c: New. * gcc.dg/vect/costmodel/spu/costmodel-vect-68d.c: New. * lib/target-supports.exp (check_effective_target_vect_int_mul): Add spu. From-SVN: r126584
2007-07-12 14:17:03 +02:00
|| [istarget spu-*-*]
|| [istarget i?86-*-*]
|| [istarget x86_64-*-*] } {
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
}
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
}
# 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
}
# 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.
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*-*-*]
|| [istarget s390*-*-*]
|| [istarget powerpc*-*-*]
|| [istarget sparc64-*-*]
|| [istarget sparcv9-*-*] } {
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
}
# 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-*-*]
|| [istarget alpha*-*-*]
|| [istarget s390*-*-*]
|| [istarget powerpc*-*-*]
|| [istarget sparc64-*-*]
|| [istarget sparcv9-*-*] } {
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
}
# 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
}]
}
# 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
}]
}
# 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} {
return [check_no_compiler_messages $feature object "
#include <features.h>
#if !defined (__UCLIBC) || defined (__${feature}__)
#error FOO
#endif
"]
}
# Return true if this is a Newlib target.
proc check_effective_target_newlib {} {
return [check_no_compiler_messages newlib object {
#include <newlib.h>
}]
}
# 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]
}
extend.texi: Document optional priority argument to constructors and destructors. * doc/extend.texi: Document optional priority argument to constructors and destructors. * tree.c (init_priority_for_decl): Adjust GTY markers. (init_ttree): Use priority-info hash functions for init_priority_for_decl. (tree_map_eq): Rename to ... (tree_map_base_eq): ... this. (tree_map_marked_p): Rename to ... (tree_map_base_marked_p): ... this. (tree_map_base_hash): New function. (decl_init_priority_lookup): Rework. (decl_fini_priority_lookup): New function. (decl_priority_info): New function. (decl_init_priority_insert): Use it. (decl_fini_priority_insert): Likewise. (decl_restrict_base_lookup): Adjust for refactoring of tree_map hierarchy. (decl_restrict_base_insert): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_lookup): Likewise. (decl_value_expr_insert): Likewise. * tree.h (priority_type): New type. (decl_init_priority_lookup): Use priority_type. (decl_fini_priority_lookup): New function. (decl_init_priority_insert): Use priority_type. (decl_fini_priority_insert): New function. (DECL_HAS_INIT_PRIORITY): Tweak comments. (DECL_INIT_PRIORITY): Likewise. (SET_DECL_INIT_PRIORITY): Add comment. (DECL_FINI_PRIORITY): New macro. (SET_DECL_FINI_PRIORITY): Likewise. (DEFAULT_INIT_PRIORITY): Document. (MAX_INIT_PRIORITY): Likewise. (MAX_RESERVED_INIT_PRIORITY): Likewise. (tree_map_base): New type. (tree_map_base_eq): New function. (tree_map_base_hash): Likewise. (tree_map_base_marked_p): Likewise. (tree_map): Inherit from tree_map_base. (tree_map_eq): Make it a macro. (tree_map_marked_p): Likewise. (tree_int_map): Inherit from tree_map_base. (tree_int_map_eq): Make it a macro. (tree_int_map_hash): Likewise. (tree_int_map_marked_p): Likewise. (tree_priority_map): New type. (tree_priority_map_eq): New macro. (tree_priority_map_hash): Likewise. (tree_priority_map_marked_p): Likewise. * varasm.c (emults_decl): Adjust for refactoring of tree_map hierarchy. (emutls_common_1): Likewise. * lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise. * tree-ssa-structalias.c (heapvar_lookup): Adjust for refactoring of tree_map hierarchy. * tree-cfg.c (move_stmt_r): Likewise. (new_label_mapper): Likewise. * c-tree.h (c_expand_body): Move to ... * c-common.h (c_expand_body): ... here. * c-decl.c (c_expand_body): Move to ... * c-common.c (c_expand_body): ... here. (c_common_attribute_table): Allow 1 argument for the constructor and destructor attributes. (get_priority): New function. (handle_constructor_attribute): Set DECL_INIT_PRIORITY. (handle_destructor_attribute): Set DECL_FINI_PRIORITY. * cp-tree.h (static_ctors): Remove. * cp-tree.h (static_dtors): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for refactoring of tree_map hierarchy. (decl_shadowed_for_var_insert): Likewise. * semantics.c (expand_body): Use c_expand_body. (expand_or_defer_fn): Don't update static_ctors or static_dtors. * decl2.c (static_ctors): Remove. (static_dtors): Likewise. (generate_ctor_or_dtor_function): Pass NULL_TREE to objc_generate_static_init_call. Do not call static_[cd]tors. (generate_ctor_and_dtor_functions_for_priority): Do not check for static_[cd]tors. (cp_write_global_declarations): Likewise. * decl.c (annotate_value): Adjust for refactoring of tree_map hierarchy. * gcc.dg/initpri1.c: New test. * gcc.dg/initpri2.c: Likewise. * g++.dg/special/initpri1.C: New test. * g++.dg/special/initpri2.C: Likewise. * g++.dg/special/conpr-1.C: Use init_priority effective target. * g++.dg/special/conpr-2.C: Likewise. * g++.dg/special/conpr-3.C: Likewise. * g++.dg/special/conpr-4.C: Likewise. * g++.dg/special/initp1.C: Likewise. * g++.dg/special/ecos.exp: Remove code to detect availability of constructor priorities. * lib/target-support.exp (target_init_priority): New function. From-SVN: r122315
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() \{\}
"]
}
# 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
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] }
"cxa_atexit" { set selected [check_cxa_atexit_available] }
default { error "unknown effective target keyword `$arg'" }
}
}
verbose "is-effective-target: $arg $selected" 2
return $selected
}
# 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 }
"cxa_atexit" { return 1 }
default { return 0 }
}
}
}
# Return 1 if target default to short enums
proc check_effective_target_short_enums { } {
return [check_no_compiler_messages short_enums assembly {
enum foo { bar };
int s[sizeof (enum foo) == 1 ? 1 : -1];
}]
}
# 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}]
}
# 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;
}]
}
# 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
}
# 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
}]
}
# 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>
}]
}
# 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
}
# 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 ""]]
}]
}