diff options
author | xguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-09 06:38:26 +0000 |
---|---|---|
committer | xguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-09 06:38:26 +0000 |
commit | 53e6ff93d8c83096e5d2e4e9290a57d164838145 (patch) | |
tree | ea555bd51f37002eb52fb97999532595b6682a4c /gcc/config/arm/neon.md | |
parent | a984f38336e6356117a3c16cb187fdb3763f020d (diff) | |
download | gcc-53e6ff93d8c83096e5d2e4e9290a57d164838145.tar.gz |
ChangeLog:
2013-08-09 Zhenqiang Chen <zhenqiang.chen@linaro.org>
* config/arm/neon.md (vcond): Fix floating-point vector
comparisons against 0.
testsuite/ChangeLog:
2013-08-09 Zhenqiang Chen <zhenqiang.chen@linaro.org>
* gcc.target/arm/lp1189445.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201618 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/arm/neon.md')
-rw-r--r-- | gcc/config/arm/neon.md | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index d0ca6b9ae79..e00ca2c7bf9 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -1671,6 +1671,7 @@ ? 3 : 1; rtx magic_rtx = GEN_INT (magic_word); int inverse = 0; + int use_zero_form = 0; int swap_bsl_operands = 0; rtx mask = gen_reg_rtx (<V_cmp_result>mode); rtx tmp = gen_reg_rtx (<V_cmp_result>mode); @@ -1681,12 +1682,16 @@ switch (GET_CODE (operands[3])) { case GE: + case GT: case LE: + case LT: case EQ: - if (!REG_P (operands[5]) - && (operands[5] != CONST0_RTX (<MODE>mode))) - operands[5] = force_reg (<MODE>mode, operands[5]); - break; + if (operands[5] == CONST0_RTX (<MODE>mode)) + { + use_zero_form = 1; + break; + } + /* Fall through. */ default: if (!REG_P (operands[5])) operands[5] = force_reg (<MODE>mode, operands[5]); @@ -1737,7 +1742,26 @@ a GT b -> a GT b a LE b -> b GE a a LT b -> b GT a - a EQ b -> a EQ b */ + a EQ b -> a EQ b + Note that there also exist direct comparison against 0 forms, + so catch those as a special case. */ + if (use_zero_form) + { + inverse = 0; + switch (GET_CODE (operands[3])) + { + case LT: + base_comparison = gen_neon_vclt<mode>; + break; + case LE: + base_comparison = gen_neon_vcle<mode>; + break; + default: + /* Do nothing, other zero form cases already have the correct + base_comparison. */ + break; + } + } if (!inverse) emit_insn (base_comparison (mask, operands[4], operands[5], magic_rtx)); |