summaryrefslogtreecommitdiff
path: root/gcc/config/mips/mips.md
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-21 11:05:04 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-21 11:05:04 +0000
commit5c8affdcd1df8abb4e04793f620df13bfa3bc4bf (patch)
tree45658fb05b44ae2d9ddf0eaed39c4ab15e524137 /gcc/config/mips/mips.md
parent9b58b4c71cd42e75e2c9fea2fde3bd0181037dce (diff)
downloadgcc-5c8affdcd1df8abb4e04793f620df13bfa3bc4bf.tar.gz
2012-07-21 Andrew Pinski <apinski@cavium.com>
* config/mips/mips.md (*popcountdi2_trunc): New pattern to handle popcount of a truncation. 2012-07-21 Andrew Pinski <apinski@cavium.com> * gcc.target/mips/octeon-pop-2.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189744 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mips/mips.md')
-rw-r--r--gcc/config/mips/mips.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 0edc9d94986..af741ba2b82 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -2643,6 +2643,16 @@
"<d>pop\t%0,%1"
[(set_attr "type" "pop")
(set_attr "mode" "<MODE>")])
+
+;; The POP instruction is special as it does not take into account the upper
+;; 32bits and is documented that way.
+(define_insn "*popcountdi2_trunc"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (popcount:SI (truncate:SI (match_operand:DI 1 "register_operand" "d"))))]
+ "ISA_HAS_POP && TARGET_64BIT"
+ "pop\t%0,%1"
+ [(set_attr "type" "pop")
+ (set_attr "mode" "SI")])
;;
;; ....................