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.
From-SVN: r189744
+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>
* config/mips/mips-protos.h (mips_expand_ext_as_unaligned_load):
"<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")])
\f
;;
;; ....................
+2012-07-21 Andrew Pinski <apinski@cavium.com>
+
+ * gcc.target/mips/octeon-pop-2.c: New testcase.
+
2012-07-21 Tobias Burnus <burnus@net-b.de>
PR fortran/48820
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -march=octeon -mgp64" } */
+/* The pop instruction does not depend on the word value to be sign extended. */
+/* { dg-final { scan-assembler-not "sll\t" } } */
+
+long long f(long long i)
+{
+ return __builtin_popcount (i);
+}
+