Commit c55963eb by Andrew Pinski Committed by Andrew Pinski

mips.md (*popcountdi2_trunc): New pattern to handle popcount of a truncation.

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
parent 63fbf586
2012-07-21 Andrew Pinski <apinski@cavium.com> 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): * config/mips/mips-protos.h (mips_expand_ext_as_unaligned_load):
Add a bool argument. Add a bool argument.
* config/mips/mips.c (mips_block_move_straight): Update call to * config/mips/mips.c (mips_block_move_straight): Update call to
......
...@@ -2643,6 +2643,16 @@ ...@@ -2643,6 +2643,16 @@
"<d>pop\t%0,%1" "<d>pop\t%0,%1"
[(set_attr "type" "pop") [(set_attr "type" "pop")
(set_attr "mode" "<MODE>")]) (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")])
;; ;;
;; .................... ;; ....................
......
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> 2012-07-21 Tobias Burnus <burnus@net-b.de>
PR fortran/48820 PR fortran/48820
......
/* { 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);
}
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