Patch to better represent x86 movdicc in rtl
John Wehle
john@feith.com
Thu Mar 25 21:19:00 GMT 1999
This patch results in better representation of x86 movdicc in rtl. At some
point this may allow the scheduler to move instructions between the two
cmove instructions used to implement movdicc which will result in better
performance (cmove takes 2-3 uops ... the pentium pro / II decoder can decode
three instructions at a time, however only the first instruction can be
more than 1 uop).
ChangeLog:
Wed Mar 24 00:44:14 EST 1999 John Wehle (john@feith.com)
* i386.md (movdicc+3, movdicc+4): Rewrite using split_di.
* i386.c (output_int_conditional_move): Delete unused code.
Enjoy!
-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/config/i386/i386.md.ORIGINAL Mon Mar 22 23:03:55 1999
--- gcc/config/i386/i386.md Wed Mar 24 00:18:50 1999
*************** byte_xor_operation:
*** 7840,7849 ****
"TARGET_CMOVE && reload_completed"
[(set (cc0)
(match_dup 2))
! (set (match_dup 0)
! (if_then_else:DI (match_op_dup 1 [(cc0) (const_int 0)])
! (match_dup 3) (match_dup 4)))]
! "")
(define_split
[(set (match_operand:DI 0 "register_operand" "=&r,&r")
--- 7840,7854 ----
"TARGET_CMOVE && reload_completed"
[(set (cc0)
(match_dup 2))
! (set (match_dup 5)
! (if_then_else:SI (match_op_dup 1 [(cc0) (const_int 0)])
! (match_dup 7) (match_dup 9)))
! (set (match_dup 6)
! (if_then_else:SI (match_op_dup 1 [(cc0) (const_int 0)])
! (match_dup 8) (match_dup 10)))]
! "split_di (&operands[0], 1, &operands[5], &operands[6]);
! split_di (&operands[3], 1, &operands[7], &operands[8]);
! split_di (&operands[4], 1, &operands[9], &operands[10]);")
(define_split
[(set (match_operand:DI 0 "register_operand" "=&r,&r")
*************** byte_xor_operation:
*** 7854,7872 ****
(match_operand:DI 5 "nonimmediate_operand" "0,ro")))]
"TARGET_CMOVE && reload_completed"
[(set (cc0) (compare (match_dup 2) (match_dup 3)))
! (set (match_dup 0)
! (if_then_else:DI (match_op_dup 1 [(cc0) (const_int 0)])
! (match_dup 4) (match_dup 5)))]
! "")
!
! (define_insn ""
! [(set (match_operand:DI 0 "register_operand" "=&r,&r")
! (if_then_else:DI (match_operator 1 "comparison_operator"
! [(cc0) (const_int 0)])
! (match_operand:DI 2 "nonimmediate_operand" "ro,0")
! (match_operand:DI 3 "nonimmediate_operand" "0,ro")))]
! "TARGET_CMOVE && reload_completed"
! "* return output_int_conditional_move (which_alternative, operands);")
(define_insn "strlensi_unroll"
[(set (match_operand:SI 0 "register_operand" "=&r,&r")
--- 7859,7873 ----
(match_operand:DI 5 "nonimmediate_operand" "0,ro")))]
"TARGET_CMOVE && reload_completed"
[(set (cc0) (compare (match_dup 2) (match_dup 3)))
! (set (match_dup 6)
! (if_then_else:SI (match_op_dup 1 [(cc0) (const_int 0)])
! (match_dup 8) (match_dup 10)))
! (set (match_dup 7)
! (if_then_else:SI (match_op_dup 1 [(cc0) (const_int 0)])
! (match_dup 9) (match_dup 11)))]
! "split_di (&operands[0], 1, &operands[6], &operands[7]);
! split_di (&operands[4], 1, &operands[8], &operands[9]);
! split_di (&operands[5], 1, &operands[10], &operands[11]);")
(define_insn "strlensi_unroll"
[(set (match_operand:SI 0 "register_operand" "=&r,&r")
*** gcc/config/i386/i386.c.ORIGINAL Sat Feb 20 03:07:44 1999
--- gcc/config/i386/i386.c Tue Mar 23 01:37:20 1999
*************** output_int_conditional_move (which_alter
*** 5468,5475 ****
rtx operands[];
{
int code = GET_CODE (operands[1]);
- enum machine_mode mode;
- rtx xops[4];
/* This is very tricky. We have to do it right. For a code segement
like:
--- 5468,5473 ----
*************** output_int_conditional_move (which_alter
*** 5489,5517 ****
&& (cc_prev_status.flags & CC_NO_OVERFLOW))
return NULL_PTR;
- mode = GET_MODE (operands [0]);
- if (mode == DImode)
- {
- xops [0] = gen_rtx_SUBREG (SImode, operands [0], 1);
- xops [1] = operands [1];
- xops [2] = gen_rtx_SUBREG (SImode, operands [2], 1);
- xops [3] = gen_rtx_SUBREG (SImode, operands [3], 1);
- }
-
switch (which_alternative)
{
case 0:
/* r <- cond ? arg : r */
output_asm_insn (AS2 (cmov%C1,%2,%0), operands);
- if (mode == DImode)
- output_asm_insn (AS2 (cmov%C1,%2,%0), xops);
break;
case 1:
/* r <- cond ? r : arg */
output_asm_insn (AS2 (cmov%c1,%3,%0), operands);
- if (mode == DImode)
- output_asm_insn (AS2 (cmov%c1,%3,%0), xops);
break;
default:
--- 5487,5502 ----
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------
More information about the Gcc-patches
mailing list