Commit 6d8fd7bb by Richard Henderson

alpha.c (reg_or_const_int_operand): New.

        * config/alpha/alpha.c (reg_or_const_int_operand): New.
        (some_operand, input_operand): Accept CONST_VECTOR.
        (alpha_extra_constraint): Add 'W'.
        (alpha_expand_zap_mask): New.
        (alpha_expand_builtin_vector_binop): New.
        (enum alpha_builtin): New.
        (zero_arg_builtins, one_arg_builtins, two_arg_builtins): New.
        (alpha_init_builtins, alpha_expand_builtin): New.
        (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): New.
        * config/alpha/alpha.h (VECTOR_MODE_SUPPORTED_P): New.
        (PREDICATE_CODES): Update.
        * config/alpha/alpha-protos.h: Update.
        * config/alpha/alpha.md (UNSPEC_CMPBGE, UNSPEC_ZAP,
        UNSPEC_AMASK, UNSPEC_IMPLVER, UNSPEC_PERR, UNSPECV_RPCC): New.
        (movv8qi, movv8qi_fix, movv8qi_nofix): New.
        (movv4hi, movv4hi_fix, movv4hi_nofix): New.
        (movv2si, movv2si_fix, movv2si_nofix): New.
        (uminv8qi3, sminv8qi3, uminv4hi3, sminv4hi3): New.
        (umaxv8qi3, smaxv8qi3, umaxv4hi3, smaxv4hi3): New.
        (builtin_cmpbge, builtin_extql, builtin_extqh, builtin_zap,
        builtin_zap_1, builtin_zapnot, builtin_zapnot_1, builtin_amask,
        builtin_implver, builtin_rpcc, builtin_minub8, builtin_minsb8,
        builtin_minuw4, builtin_minsw4, builtin_maxub8, builtin_maxsb8,
        builtin_maxuw4, builtin_maxsw4, builtin_perr, builtin_pklb,
        pklb, builtin_pkwb, pkwb, builtin_unpkbl, unpkbl,
        builtin_unpkbw, unpkbw): New.
        * doc/extend.texi (Alpha Built-in Functions): New.

        * gcc.dg/alpha-base-1.c, gcc.dg/alpha-base-2.c: New.
        * gcc.dg/alpha-max-1.c, gcc.dg/alpha-max-2.c: New.

From-SVN: r54229
parent 618939de
2002-06-03 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Richard Henderson <rth@redhat.com>
* config/alpha/alpha.c (reg_or_const_int_operand): New.
(some_operand, input_operand): Accept CONST_VECTOR.
(alpha_extra_constraint): Add 'W'.
(alpha_expand_zap_mask): New.
(alpha_expand_builtin_vector_binop): New.
(enum alpha_builtin): New.
(zero_arg_builtins, one_arg_builtins, two_arg_builtins): New.
(alpha_init_builtins, alpha_expand_builtin): New.
(TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): New.
* config/alpha/alpha.h (VECTOR_MODE_SUPPORTED_P): New.
(PREDICATE_CODES): Update.
* config/alpha/alpha-protos.h: Update.
* config/alpha/alpha.md (UNSPEC_CMPBGE, UNSPEC_ZAP,
UNSPEC_AMASK, UNSPEC_IMPLVER, UNSPEC_PERR, UNSPECV_RPCC): New.
(movv8qi, movv8qi_fix, movv8qi_nofix): New.
(movv4hi, movv4hi_fix, movv4hi_nofix): New.
(movv2si, movv2si_fix, movv2si_nofix): New.
(uminv8qi3, sminv8qi3, uminv4hi3, sminv4hi3): New.
(umaxv8qi3, smaxv8qi3, umaxv4hi3, smaxv4hi3): New.
(builtin_cmpbge, builtin_extql, builtin_extqh, builtin_zap,
builtin_zap_1, builtin_zapnot, builtin_zapnot_1, builtin_amask,
builtin_implver, builtin_rpcc, builtin_minub8, builtin_minsb8,
builtin_minuw4, builtin_minsw4, builtin_maxub8, builtin_maxsb8,
builtin_maxuw4, builtin_maxsw4, builtin_perr, builtin_pklb,
pklb, builtin_pkwb, pkwb, builtin_unpkbl, unpkbl,
builtin_unpkbw, unpkbw): New.
* doc/extend.texi (Alpha Built-in Functions): New.
2002-06-03 Richard Henderson <rth@redhat.com>
* crtstuff.c (__EH_FRAME_BEGIN__): Conditionalize on
......
......@@ -37,6 +37,7 @@ extern void alpha_output_lineno PARAMS ((FILE *, int));
extern int reg_or_0_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_6bit_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_8bit_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_const_int_operand PARAMS ((rtx, enum machine_mode));
extern int cint8_operand PARAMS ((rtx, enum machine_mode));
extern int add_operand PARAMS ((rtx, enum machine_mode));
extern int sext_add_operand PARAMS ((rtx, enum machine_mode));
......@@ -122,6 +123,10 @@ extern void alpha_expand_unaligned_store PARAMS ((rtx, rtx, HOST_WIDE_INT,
HOST_WIDE_INT));
extern int alpha_expand_block_move PARAMS ((rtx []));
extern int alpha_expand_block_clear PARAMS ((rtx []));
extern rtx alpha_expand_zap_mask PARAMS ((HOST_WIDE_INT));
extern void alpha_expand_builtin_vector_binop PARAMS ((rtx (*)(rtx, rtx, rtx),
enum machine_mode,
rtx, rtx, rtx));
extern rtx alpha_return_addr PARAMS ((int, rtx));
extern rtx alpha_gp_save_rtx PARAMS ((void));
extern void print_operand PARAMS ((FILE *, rtx, int));
......
......@@ -615,6 +615,12 @@ extern const char *alpha_tls_size_string; /* For -mtls-size= */
? GET_MODE_UNIT_SIZE (MODE) == 8 || GET_MODE_UNIT_SIZE (MODE) == 4 \
: 1)
/* Value is 1 if MODE is a supported vector mode. */
#define VECTOR_MODE_SUPPORTED_P(MODE) \
(TARGET_MAX \
&& ((MODE) == V8QImode || (MODE) == V4HImode || (MODE) == V2SImode))
/* A C expression that is nonzero if a value of mode
MODE1 is accessible in mode MODE2 without copying.
......@@ -789,7 +795,9 @@ enum reg_class {
'T' is a HIGH.
'U' is a symbolic operand. */
'U' is a symbolic operand.
'W' is a vector zero. */
#define EXTRA_CONSTRAINT alpha_extra_constraint
......@@ -1923,6 +1931,7 @@ do { \
CONST_VECTOR}}, \
{"reg_or_6bit_operand", {SUBREG, REG, CONST_INT}}, \
{"reg_or_8bit_operand", {SUBREG, REG, CONST_INT}}, \
{"reg_or_const_int_operand", {SUBREG, REG, CONST_INT}}, \
{"cint8_operand", {CONST_INT}}, \
{"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \
{"add_operand", {SUBREG, REG, CONST_INT}}, \
......@@ -1953,9 +1962,9 @@ do { \
{"gottp_symbolic_operand", {CONST}}, \
{"call_operand", {REG, SYMBOL_REF}}, \
{"input_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \
SYMBOL_REF, CONST, LABEL_REF, HIGH}}, \
CONST_VECTOR, SYMBOL_REF, CONST, LABEL_REF, HIGH}},\
{"some_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \
SYMBOL_REF, CONST, LABEL_REF, HIGH}}, \
CONST_VECTOR, SYMBOL_REF, CONST, LABEL_REF, HIGH}}, \
{"some_ni_operand", {SUBREG, REG, MEM}}, \
{"aligned_memory_operand", {MEM}}, \
{"unaligned_memory_operand", {MEM}}, \
......
......@@ -4754,10 +4754,52 @@ to those machines. Generally these generate calls to specific machine
instructions, but allow the compiler to schedule those calls.
@menu
* Alpha Built-in Functions::
* X86 Built-in Functions::
* PowerPC AltiVec Built-in Functions::
@end menu
@node Alpha Built-in Functions
@subsection Alpha Built-in Functions
These built-in functions are available for the Alpha family of
processors, depending on the command-line switches used.
The following built-in functions are always available. They
all generate the machine instruction that is part of the name.
@example
long __builtin_alpha_implver (void)
long __builtin_alpha_rpcc (void)
long __builtin_alpha_amask (long)
long __builtin_alpha_cmpbge (long, long)
long __builtin_alpha_extql (long, long)
long __builtin_alpha_extqh (long, long)
long __builtin_alpha_zap (long, long)
long __builtin_alpha_zapnot (long, long)
@end example
The following built-in functions are always with @option{-mmax}
or @option{-mcpu=@var{cpu}} where @var{cpu} is @code{pca56} or
later. They all generate the machine instruction that is part
of the name.
@example
long __builtin_alpha_pklb (long)
long __builtin_alpha_pkwb (long)
long __builtin_alpha_unpkbl (long)
long __builtin_alpha_unpkbw (long)
long __builtin_alpha_minub8 (long, long)
long __builtin_alpha_minsb8 (long, long)
long __builtin_alpha_minuw4 (long, long)
long __builtin_alpha_minsw4 (long, long)
long __builtin_alpha_maxub8 (long, long)
long __builtin_alpha_maxsb8 (long, long)
long __builtin_alpha_maxuw4 (long, long)
long __builtin_alpha_maxsw4 (long, long)
long __builtin_alpha_perr (long, long)
@end example
@node X86 Built-in Functions
@subsection X86 Built-in Functions
......
2002-06-03 Richard Henderson <rth@redhat.com>
* gcc.dg/alpha-base-1.c, gcc.dg/alpha-base-2.c: New.
* gcc.dg/alpha-max-1.c, gcc.dg/alpha-max-2.c: New.
2002-06-02 Richard Henderson <rth@redhat.com>
* gcc.c-torture/execute/pure-1.c: Don't mark any of the
......
/* Test that the base isa builtins compile. */
/* { dg-do link { target alpha*-*-* } } */
/* { dg-options "-mcpu=ev4" } */
void test_BASE (long x, long y)
{
volatile long sink;
long z;
sink = __builtin_alpha_implver ();
sink = __builtin_alpha_rpcc ();
sink = __builtin_alpha_amask (-1);
sink = __builtin_alpha_amask (x);
sink = __builtin_alpha_cmpbge (x, y);
sink = __builtin_alpha_cmpbge (-1, x);
sink = __builtin_alpha_extql (x, y);
sink = __builtin_alpha_extqh (x, y);
}
void test_zap (long x, long y)
{
volatile long sink;
long z;
sink = __builtin_alpha_zap (x, y);
sink = __builtin_alpha_zap (x, 0xaa);
z = 0xaa;
sink = __builtin_alpha_zap (x, z);
z = 0;
sink = __builtin_alpha_zap (z, x);
sink = __builtin_alpha_zap (x, z);
}
void test_zapnot (long x, long y)
{
volatile long sink;
long z;
sink = __builtin_alpha_zapnot (x, y);
sink = __builtin_alpha_zapnot (x, 0xaa);
z = 0xaa;
sink = __builtin_alpha_zapnot (x, z);
z = 0;
sink = __builtin_alpha_zapnot (z, x);
sink = __builtin_alpha_zapnot (x, z);
}
int main() { return 0; }
/* Test that alpha-base-1.c compiles with optimization. */
/* { dg-do link { target alpha*-*-* } } */
/* { dg-options "-mcpu=ev4 -O2" } */
#include "alpha-base-1.c"
/* Test that the MAX isa builtins compile. */
/* { dg-do link { target alpha*-*-* } } */
/* { dg-options "-mmax" } */
void test_MAX (long x, long y)
{
volatile long sink;
sink = __builtin_alpha_pklb (x);
sink = __builtin_alpha_pkwb (x);
sink = __builtin_alpha_unpkbl (x);
sink = __builtin_alpha_unpkbw (x);
sink = __builtin_alpha_minub8 (0, x);
sink = __builtin_alpha_minub8 (1, x);
sink = __builtin_alpha_minub8 (x, y);
sink = __builtin_alpha_minsb8 (x, y);
sink = __builtin_alpha_minuw4 (x, y);
sink = __builtin_alpha_minsw4 (x, y);
sink = __builtin_alpha_maxub8 (x, y);
sink = __builtin_alpha_maxsb8 (x, y);
sink = __builtin_alpha_maxuw4 (x, y);
sink = __builtin_alpha_maxsw4 (x, y);
sink = __builtin_alpha_perr (x, y);
}
int main() { return 0; }
/* Test that alpha-max-1.c compiles with optimization. */
/* { dg-do link { target alpha*-*-* } } */
/* { dg-options "-mmax -O2" } */
#include "alpha-max-1.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