Commit d16b59fa by Dorit Naishlos Committed by Dorit Nuzman

genopinit.c (vec_realign_store_optab): Initialization removed.

2004-12-09  Dorit Naishlos  <dorit@il.ibm.com>

        * genopinit.c (vec_realign_store_optab): Initialization removed.
        * optabs.c (optab_for_tree_code): REALIGN_STORE_EXPR case removed.
        * optabs.h (optab_index): OTI_vec_realign_store Removed.
        (vec_realign_store_optab): Removed.
        * target-def.h (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Removed.
        * target.h (builtin_mask_for_store): Removed.
        * tree.def (REALIGN_STORE_EXPR): Removed.
        * config/rs6000/rs6000.c (rs6000_builtin_mask_for_store): Removed.
        (altivec_builtin_mask_for_store): Removed.
        (altivec_init_builtins): Removed initialization of
        altivec_builtin_mask_for_store.

        * doc/tm.texi (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New.
        (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): New.

From-SVN: r91932
parent 08f2586c
2004-12-09 Dorit Naishlos <dorit@il.ibm.com>
* genopinit.c (vec_realign_store_optab): Initialization removed.
* optabs.c (optab_for_tree_code): REALIGN_STORE_EXPR case removed.
* optabs.h (optab_index): OTI_vec_realign_store Removed.
(vec_realign_store_optab): Removed.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Removed.
* target.h (builtin_mask_for_store): Removed.
* tree.def (REALIGN_STORE_EXPR): Removed.
* config/rs6000/rs6000.c (rs6000_builtin_mask_for_store): Removed.
(altivec_builtin_mask_for_store): Removed.
(altivec_init_builtins): Removed initialization of
altivec_builtin_mask_for_store.
* doc/tm.texi (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New.
(TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): New.
2004-12-09 Nathan Sidwell <nathan@codesourcery.com> 2004-12-09 Nathan Sidwell <nathan@codesourcery.com>
* tree.def (SET_TYPE): Remove. * tree.def (SET_TYPE): Remove.
......
...@@ -147,8 +147,6 @@ enum rs6000_nop_insertion rs6000_sched_insert_nops; ...@@ -147,8 +147,6 @@ enum rs6000_nop_insertion rs6000_sched_insert_nops;
/* Support targetm.vectorize.builtin_mask_for_load. */ /* Support targetm.vectorize.builtin_mask_for_load. */
static GTY(()) tree altivec_builtin_mask_for_load; static GTY(()) tree altivec_builtin_mask_for_load;
/* Support targetm.vectorize.builtin_mask_for_store. */
static GTY(()) tree altivec_builtin_mask_for_store;
/* Size of long double */ /* Size of long double */
const char *rs6000_long_double_size_string; const char *rs6000_long_double_size_string;
...@@ -693,7 +691,6 @@ static int pad_groups (FILE *, int, rtx, rtx); ...@@ -693,7 +691,6 @@ static int pad_groups (FILE *, int, rtx, rtx);
static void rs6000_sched_finish (FILE *, int); static void rs6000_sched_finish (FILE *, int);
static int rs6000_use_sched_lookahead (void); static int rs6000_use_sched_lookahead (void);
static tree rs6000_builtin_mask_for_load (void); static tree rs6000_builtin_mask_for_load (void);
static tree rs6000_builtin_mask_for_store (void);
static void rs6000_init_builtins (void); static void rs6000_init_builtins (void);
static rtx rs6000_expand_unop_builtin (enum insn_code, tree, rtx); static rtx rs6000_expand_unop_builtin (enum insn_code, tree, rtx);
...@@ -933,9 +930,6 @@ static const char alt_reg_names[][8] = ...@@ -933,9 +930,6 @@ static const char alt_reg_names[][8] =
#undef TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD #undef TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD
#define TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD rs6000_builtin_mask_for_load #define TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD rs6000_builtin_mask_for_load
#undef TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE
#define TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE rs6000_builtin_mask_for_store
#undef TARGET_INIT_BUILTINS #undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS rs6000_init_builtins #define TARGET_INIT_BUILTINS rs6000_init_builtins
...@@ -1592,16 +1586,6 @@ rs6000_builtin_mask_for_load (void) ...@@ -1592,16 +1586,6 @@ rs6000_builtin_mask_for_load (void)
return 0; return 0;
} }
/* Implement targetm.vectorize.builtin_mask_for_store. */
static tree
rs6000_builtin_mask_for_store (void)
{
if (TARGET_ALTIVEC)
return altivec_builtin_mask_for_store;
else
return 0;
}
/* Handle generic options of the form -mfoo=yes/no. /* Handle generic options of the form -mfoo=yes/no.
NAME is the option name. NAME is the option name.
VALUE is the option value. VALUE is the option value.
...@@ -8308,17 +8292,6 @@ altivec_init_builtins (void) ...@@ -8308,17 +8292,6 @@ altivec_init_builtins (void)
BUILT_IN_MD, NULL, NULL_TREE); BUILT_IN_MD, NULL, NULL_TREE);
/* Record the decl. Will be used by rs6000_builtin_mask_for_load. */ /* Record the decl. Will be used by rs6000_builtin_mask_for_load. */
altivec_builtin_mask_for_load = decl; altivec_builtin_mask_for_load = decl;
/* Initialize target builtin that implements
targetm.vectorize.builtin_mask_for_store. */
decl = lang_hooks.builtin_function ("__builtin_altivec_mask_for_store",
v16qi_ftype_long_pcvoid,
ALTIVEC_BUILTIN_MASK_FOR_STORE,
BUILT_IN_MD, NULL, NULL_TREE);
/* Record the decl. Will be used by rs6000_builtin_mask_for_store. */
altivec_builtin_mask_for_store = decl;
} }
} }
......
...@@ -5184,6 +5184,45 @@ holding the constant. This restriction is often true of addresses ...@@ -5184,6 +5184,45 @@ holding the constant. This restriction is often true of addresses
of TLS symbols for various targets. of TLS symbols for various targets.
@end deftypefn @end deftypefn
@deftypefn {Target Hook} bool TARGET_VECTORIZE_MISALIGNED_MEM_OK (@var{mode})
This hook should return true if a move* pattern to/from memory
can be generated for machine_mode @var{mode} even if the memory location
is unaligned.
If a move* of data to/from unaligned memory locations is not supported for
machine_mode @var{mode}, the hook should return false.
This hook is used by the autovectorizer, and when expanding a
@code{MISALIGNED_INDIRECT_REF} expression.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD (void)
This hook should return the DECL of a function @var{f} that given an
address @var{addr} as an argument returns a mask @var{m} that can be
used to extract from two vectors the relevant data that resides in
@var{addr} in case @var{addr} is not properly aligned.
The autovectrizer, when vectorizing a load operation from an address
@var{addr} that may be unaligned, will generate two vector loads from
the two aligned addresses around @var{addr}. It then generates a
@code{REALIGN_LOAD} operation to extract the relevant data from the
two loaded vectors. The first two arguments to @code{REALIGN_LOAD},
@var{v1} and @var{v2}, are the two vectors, each of size @var{VS}, and
the third argument, @var{OFF}, defines how the data will be extracted
from these two vectors: if @var{OFF} is 0, then the returned vector is
@var{v2}; otherwise, the returned vector is composed from the last
@var{VS}-@var{OFF} elements of @var{v1} concatenated to the first
@var{OFF} elements of @var{v2}.
If this hook is defined, the autovectorizer will generate a call
to @var{f} (using the DECL tree that this hook returns) and will
use the return value of @var{f} as the argument @var{OFF} to
@code{REALIGN_LOAD}. Therefore, the mask @var{m} returned by @var{f}
should comply with the semantics expected by @code{REALIGN_LOAD}
described above.
If this hook is not defined, then @var{addr} will be used as
the argument @var{OFF} to @code{REALIGN_LOAD}, in which case the low
log2(@var{VS})-1 bits of @var{addr} will be considered.
@end deftypefn
@node Condition Code @node Condition Code
@section Condition Code Status @section Condition Code Status
@cindex condition code status @cindex condition code status
......
...@@ -170,7 +170,6 @@ static const char * const optabs[] = ...@@ -170,7 +170,6 @@ static const char * const optabs[] =
"vec_set_optab->handlers[$A].insn_code = CODE_FOR_$(vec_set$a$)", "vec_set_optab->handlers[$A].insn_code = CODE_FOR_$(vec_set$a$)",
"vec_extract_optab->handlers[$A].insn_code = CODE_FOR_$(vec_extract$a$)", "vec_extract_optab->handlers[$A].insn_code = CODE_FOR_$(vec_extract$a$)",
"vec_init_optab->handlers[$A].insn_code = CODE_FOR_$(vec_init$a$)", "vec_init_optab->handlers[$A].insn_code = CODE_FOR_$(vec_init$a$)",
"vec_realign_store_optab->handlers[$A].insn_code = CODE_FOR_$(vec_realign_store_$a$)",
"vec_realign_load_optab->handlers[$A].insn_code = CODE_FOR_$(vec_realign_load_$a$)", "vec_realign_load_optab->handlers[$A].insn_code = CODE_FOR_$(vec_realign_load_$a$)",
"vcond_gen_code[$A] = CODE_FOR_$(vcond$a$)", "vcond_gen_code[$A] = CODE_FOR_$(vcond$a$)",
"vcondu_gen_code[$A] = CODE_FOR_$(vcondu$a$)" }; "vcondu_gen_code[$A] = CODE_FOR_$(vcondu$a$)" };
......
...@@ -294,9 +294,6 @@ optab_for_tree_code (enum tree_code code, tree type) ...@@ -294,9 +294,6 @@ optab_for_tree_code (enum tree_code code, tree type)
case MIN_EXPR: case MIN_EXPR:
return TYPE_UNSIGNED (type) ? umin_optab : smin_optab; return TYPE_UNSIGNED (type) ? umin_optab : smin_optab;
case REALIGN_STORE_EXPR:
return vec_realign_store_optab;
case REALIGN_LOAD_EXPR: case REALIGN_LOAD_EXPR:
return vec_realign_load_optab; return vec_realign_load_optab;
......
...@@ -228,8 +228,6 @@ enum optab_index ...@@ -228,8 +228,6 @@ enum optab_index
OTI_vec_extract, OTI_vec_extract,
/* Initialize vector operand. */ /* Initialize vector operand. */
OTI_vec_init, OTI_vec_init,
/* Extract specified elements from vectors, for vector store. */
OTI_vec_realign_store,
/* Extract specified elements from vectors, for vector load. */ /* Extract specified elements from vectors, for vector load. */
OTI_vec_realign_load, OTI_vec_realign_load,
...@@ -334,7 +332,6 @@ extern GTY(()) optab optab_table[OTI_MAX]; ...@@ -334,7 +332,6 @@ extern GTY(()) optab optab_table[OTI_MAX];
#define vec_set_optab (optab_table[OTI_vec_set]) #define vec_set_optab (optab_table[OTI_vec_set])
#define vec_extract_optab (optab_table[OTI_vec_extract]) #define vec_extract_optab (optab_table[OTI_vec_extract])
#define vec_init_optab (optab_table[OTI_vec_init]) #define vec_init_optab (optab_table[OTI_vec_init])
#define vec_realign_store_optab (optab_table[OTI_vec_realign_store])
#define vec_realign_load_optab (optab_table[OTI_vec_realign_load]) #define vec_realign_load_optab (optab_table[OTI_vec_realign_load])
/* Conversion optabs have their own table and indexes. */ /* Conversion optabs have their own table and indexes. */
......
...@@ -277,12 +277,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -277,12 +277,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_VECTORIZE_MISALIGNED_MEM_OK default_vect_misaligned_mem_ok #define TARGET_VECTORIZE_MISALIGNED_MEM_OK default_vect_misaligned_mem_ok
#endif #endif
#define TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD 0 #define TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD 0
#define TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE 0
#define TARGET_VECTORIZE \ #define TARGET_VECTORIZE \
{TARGET_VECTORIZE_MISALIGNED_MEM_OK, \ {TARGET_VECTORIZE_MISALIGNED_MEM_OK, \
TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD, \ TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD}
TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE}
/* In except.c */ /* In except.c */
#define TARGET_EH_RETURN_FILTER_MODE default_eh_return_filter_mode #define TARGET_EH_RETURN_FILTER_MODE default_eh_return_filter_mode
......
...@@ -286,17 +286,16 @@ struct gcc_target ...@@ -286,17 +286,16 @@ struct gcc_target
struct vectorize struct vectorize
{ {
/* The following member value is a pointer to a function called /* The following member value is a pointer to a function called
by the vectorizer, and when expanding a MISALIGNED_INDIREC_REF by te vectorizer, and when expanding a MISALIGNED_INDIRECT_REF
expression. If the hook returns true (false) then a move* pattern expression. If the hook returns true (false) then a move* pattern
to/from memory can (cannot) be generated for this mode even if the to/from memory can (cannot) be generated for this mode even if the
memory location is unaligned. */ memory location is unaligned. */
bool (* misaligned_mem_ok) (enum machine_mode); bool (* misaligned_mem_ok) (enum machine_mode);
/* The following member values are pointers to functions called /* The following member value is a pointer to a function called
by the vectorizer, and return the decl of the target builtin by the vectorizer, and return the decl of the target builtin
function. */ function. */
tree (* builtin_mask_for_load) (void); tree (* builtin_mask_for_load) (void);
tree (* builtin_mask_for_store) (void);
} vectorize; } vectorize;
/* Return machine mode for filter value. */ /* Return machine mode for filter value. */
......
...@@ -886,17 +886,6 @@ DEFTREECODE (WITH_SIZE_EXPR, "with_size_expr", tcc_expression, 2) ...@@ -886,17 +886,6 @@ DEFTREECODE (WITH_SIZE_EXPR, "with_size_expr", tcc_expression, 2)
generated by the builtin targetm.vectorize.mask_for_load_builtin_decl. */ generated by the builtin targetm.vectorize.mask_for_load_builtin_decl. */
DEFTREECODE (REALIGN_LOAD_EXPR, "realign_load", tcc_expression, 3) DEFTREECODE (REALIGN_LOAD_EXPR, "realign_load", tcc_expression, 3)
/* Extract elements from two input vectors Operand 0 and Operand 1
size VS, according to the offset OFF defined by Operand 2 as
follows:
If OFF > 0, the last OFF elements of vector OP0 are concatenated to
the first VS - OFF elements of the vector OP1.
If OFF == 0, then the returned vector is OP0.
On different targets OFF may take different forms; It can be an address, in
which case its low log2(VS)-1 bits define the offset, or it can be a mask
generated by the builtin targetm.vectorize.mask_for_store_builtin_decl. */
DEFTREECODE (REALIGN_STORE_EXPR, "realign_store", tcc_expression, 3)
/* /*
Local variables: Local variables:
mode:c mode:c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment