diff options
author | Michael Meissner <michael.meissner@amd.com> | 2008-05-14 20:07:53 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 2008-05-14 20:07:53 +0000 |
commit | 71d46ca56cb36baa54ec8a1de7cbc0fda9ae3245 (patch) | |
tree | b9a9ff4a7540533104609eb87beb98cc4f84d114 /gcc/expmed.c | |
parent | 550c9cf0fe26d6da75cfaeea41a766fe69ddee4e (diff) | |
download | gcc-71d46ca56cb36baa54ec8a1de7cbc0fda9ae3245.zip gcc-71d46ca56cb36baa54ec8a1de7cbc0fda9ae3245.tar.gz gcc-71d46ca56cb36baa54ec8a1de7cbc0fda9ae3245.tar.bz2 |
Add SSE5 vector shift/rotate; Update SSE5 vector multiply
Co-Authored-By: Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
Co-Authored-By: Paolo Bonzini <bonzini@gnu.org>
From-SVN: r135304
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 5268b31..ab5057a 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -2044,14 +2044,32 @@ expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted, rtx op1, temp = 0; int left = (code == LSHIFT_EXPR || code == LROTATE_EXPR); int rotate = (code == LROTATE_EXPR || code == RROTATE_EXPR); + optab lshift_optab = ashl_optab; + optab rshift_arith_optab = ashr_optab; + optab rshift_uns_optab = lshr_optab; + optab lrotate_optab = rotl_optab; + optab rrotate_optab = rotr_optab; + enum machine_mode op1_mode; int try; + op1 = expand_normal (amount); + op1_mode = GET_MODE (op1); + + /* Determine whether the shift/rotate amount is a vector, or scalar. If the + shift amount is a vector, use the vector/vector shift patterns. */ + if (VECTOR_MODE_P (mode) && VECTOR_MODE_P (op1_mode)) + { + lshift_optab = vashl_optab; + rshift_arith_optab = vashr_optab; + rshift_uns_optab = vlshr_optab; + lrotate_optab = vrotl_optab; + rrotate_optab = vrotr_optab; + } + /* Previously detected shift-counts computed by NEGATE_EXPR and shifted in the other direction; but that does not work on all machines. */ - op1 = expand_normal (amount); - if (SHIFT_COUNT_TRUNCATED) { if (GET_CODE (op1) == CONST_INT @@ -2141,12 +2159,12 @@ expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted, } temp = expand_binop (mode, - left ? rotl_optab : rotr_optab, + left ? lrotate_optab : rrotate_optab, shifted, op1, target, unsignedp, methods); } else if (unsignedp) temp = expand_binop (mode, - left ? ashl_optab : lshr_optab, + left ? lshift_optab : rshift_uns_optab, shifted, op1, target, unsignedp, methods); /* Do arithmetic shifts. @@ -2165,7 +2183,7 @@ expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted, /* Arithmetic shift */ temp = expand_binop (mode, - left ? ashl_optab : ashr_optab, + left ? lshift_optab : rshift_arith_optab, shifted, op1, target, unsignedp, methods1); } |