Commit 934f2a96 by Uros Bizjak Committed by Uros Bizjak

i386.md (ashlti3, [...]): Expand using ix86_expand_binary_operator directly.

	* config/i386/i386.md (ashlti3, ashrti3, lshrti3): Expand using
	ix86_expand_binary_operator directly.
	(*ashlti3_1): Rename from ashlti3_1.  Use nonmemory_operand predicate
	for operand 2.
	(*ashrti3_1): Ditto.
	(*lshrti3_1): Ditto.
	(*ashlti3_2, *ashrti3_2, *lshrti3_2): Remove insn patterns.
	(ashlti, ashrti and lshrti splitters): Handle nonmemory operand 2
	using only one splitter.  Conditionaly execute splitter before or
	after peephole2 pass.
	(ashlti, ashrti and lshrti peephole2): Define peephole2 patterns.
	(x86_shld): Rename from x86_shld_1.  Compress operand 2 constraints.
	Use only one alternative in asm template.
	(x86_64_shld): Compress operand 2 constraints. Use only one alternative
	in asm template.
	(*ashldi3_cmp_rex64): Use const_1_to_63_operand operand predicate and
	"J" operand constraint for operand 2.
	(*ashldi3_cconly_rex64): Ditto.
	(*ashrdi3_cmp_rex64): Ditto.
	(*ashrdi3_cconly_rex64): Ditto.
	(*lshrdi3_cmp_rex64): Ditto.
	(*lshrdi3_cconly_rex64): Ditto.
	* config/i386/predicates.md (const_1_to_63_operand): New predicate.
	* config/i386/i386.md (print_operand) ['s']: Print ", " using fputs.
	(split_ashr, split_ashl, split_lshr): Use gen_x86_shrd instead of
	gen_x86_shrd_1.

From-SVN: r137201
parent a7235bfb
2008-06-27 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (ashlti3, ashrti3, lshrti3): Expand using
ix86_expand_binary_operator directly.
(*ashlti3_1): Rename from ashlti3_1. Use nonmemory_operand predicate
for operand 2.
(*ashrti3_1): Ditto.
(*lshrti3_1): Ditto.
(*ashlti3_2, *ashrti3_2, *lshrti3_2): Remove insn patterns.
(ashlti, ashrti and lshrti splitters): Handle nonmemory operand 2
using only one splitter. Conditionaly execute splitter before or
after peephole2 pass.
(ashlti, ashrti and lshrti peephole2): Define peephole2 patterns.
(x86_shld): Rename from x86_shld_1. Compress operand 2 constraints.
Use only one alternative in asm template.
(x86_64_shld): Compress operand 2 constraints. Use only one alternative
in asm template.
(*ashldi3_cmp_rex64): Use const_1_to_63_operand operand predicate and
"J" operand constraint for operand 2.
(*ashldi3_cconly_rex64): Ditto.
(*ashrdi3_cmp_rex64): Ditto.
(*ashrdi3_cconly_rex64): Ditto.
(*lshrdi3_cmp_rex64): Ditto.
(*lshrdi3_cconly_rex64): Ditto.
* config/i386/predicates.md (const_1_to_63_operand): New predicate.
* config/i386/i386.md (print_operand) ['s']: Print ", " using fputs.
(split_ashr, split_ashl, split_lshr): Use gen_x86_shrd instead of
gen_x86_shrd_1.
2008-06-27 Jakub Jelinek <jakub@redhat.com> 2008-06-27 Jakub Jelinek <jakub@redhat.com>
* gimplify.c (omp_is_private): Don't return true if decl * gimplify.c (omp_is_private): Don't return true if decl
......
...@@ -9207,7 +9207,7 @@ print_operand (FILE *file, rtx x, int code) ...@@ -9207,7 +9207,7 @@ print_operand (FILE *file, rtx x, int code)
if (CONST_INT_P (x) || ! SHIFT_DOUBLE_OMITS_COUNT) if (CONST_INT_P (x) || ! SHIFT_DOUBLE_OMITS_COUNT)
{ {
PRINT_OPERAND (file, x, 0); PRINT_OPERAND (file, x, 0);
putc (',', file); fputs (", ", file);
} }
return; return;
...@@ -14542,7 +14542,7 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode) ...@@ -14542,7 +14542,7 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode)
if (!rtx_equal_p (operands[0], operands[1])) if (!rtx_equal_p (operands[0], operands[1]))
emit_move_insn (operands[0], operands[1]); emit_move_insn (operands[0], operands[1]);
emit_insn ((mode == DImode emit_insn ((mode == DImode
? gen_x86_shld_1 ? gen_x86_shld
: gen_x86_64_shld) (high[0], low[0], GEN_INT (count))); : gen_x86_64_shld) (high[0], low[0], GEN_INT (count)));
ix86_expand_ashl_const (low[0], count, mode); ix86_expand_ashl_const (low[0], count, mode);
} }
...@@ -14627,7 +14627,7 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode) ...@@ -14627,7 +14627,7 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode)
(mode == DImode ? split_di : split_ti) (operands, 1, low, high); (mode == DImode ? split_di : split_ti) (operands, 1, low, high);
emit_insn ((mode == DImode emit_insn ((mode == DImode
? gen_x86_shld_1 ? gen_x86_shld
: gen_x86_64_shld) (high[0], low[0], operands[2])); : gen_x86_64_shld) (high[0], low[0], operands[2]));
} }
...@@ -14685,7 +14685,7 @@ ix86_split_ashr (rtx *operands, rtx scratch, enum machine_mode mode) ...@@ -14685,7 +14685,7 @@ ix86_split_ashr (rtx *operands, rtx scratch, enum machine_mode mode)
if (!rtx_equal_p (operands[0], operands[1])) if (!rtx_equal_p (operands[0], operands[1]))
emit_move_insn (operands[0], operands[1]); emit_move_insn (operands[0], operands[1]);
emit_insn ((mode == DImode emit_insn ((mode == DImode
? gen_x86_shrd_1 ? gen_x86_shrd
: gen_x86_64_shrd) (low[0], high[0], GEN_INT (count))); : gen_x86_64_shrd) (low[0], high[0], GEN_INT (count)));
emit_insn ((mode == DImode emit_insn ((mode == DImode
? gen_ashrsi3 ? gen_ashrsi3
...@@ -14700,7 +14700,7 @@ ix86_split_ashr (rtx *operands, rtx scratch, enum machine_mode mode) ...@@ -14700,7 +14700,7 @@ ix86_split_ashr (rtx *operands, rtx scratch, enum machine_mode mode)
(mode == DImode ? split_di : split_ti) (operands, 1, low, high); (mode == DImode ? split_di : split_ti) (operands, 1, low, high);
emit_insn ((mode == DImode emit_insn ((mode == DImode
? gen_x86_shrd_1 ? gen_x86_shrd
: gen_x86_64_shrd) (low[0], high[0], operands[2])); : gen_x86_64_shrd) (low[0], high[0], operands[2]));
emit_insn ((mode == DImode emit_insn ((mode == DImode
? gen_ashrsi3 ? gen_ashrsi3
...@@ -14751,7 +14751,7 @@ ix86_split_lshr (rtx *operands, rtx scratch, enum machine_mode mode) ...@@ -14751,7 +14751,7 @@ ix86_split_lshr (rtx *operands, rtx scratch, enum machine_mode mode)
if (!rtx_equal_p (operands[0], operands[1])) if (!rtx_equal_p (operands[0], operands[1]))
emit_move_insn (operands[0], operands[1]); emit_move_insn (operands[0], operands[1]);
emit_insn ((mode == DImode emit_insn ((mode == DImode
? gen_x86_shrd_1 ? gen_x86_shrd
: gen_x86_64_shrd) (low[0], high[0], GEN_INT (count))); : gen_x86_64_shrd) (low[0], high[0], GEN_INT (count)));
emit_insn ((mode == DImode emit_insn ((mode == DImode
? gen_lshrsi3 ? gen_lshrsi3
...@@ -14766,7 +14766,7 @@ ix86_split_lshr (rtx *operands, rtx scratch, enum machine_mode mode) ...@@ -14766,7 +14766,7 @@ ix86_split_lshr (rtx *operands, rtx scratch, enum machine_mode mode)
(mode == DImode ? split_di : split_ti) (operands, 1, low, high); (mode == DImode ? split_di : split_ti) (operands, 1, low, high);
emit_insn ((mode == DImode emit_insn ((mode == DImode
? gen_x86_shrd_1 ? gen_x86_shrd
: gen_x86_64_shrd) (low[0], high[0], operands[2])); : gen_x86_64_shrd) (low[0], high[0], operands[2]));
emit_insn ((mode == DImode emit_insn ((mode == DImode
? gen_lshrsi3 ? gen_lshrsi3
......
...@@ -629,6 +629,12 @@ ...@@ -629,6 +629,12 @@
(and (match_code "const_int") (and (match_code "const_int")
(match_test "IN_RANGE (INTVAL (op), 1, 31)"))) (match_test "IN_RANGE (INTVAL (op), 1, 31)")))
;; Return nonzero if OP is CONST_INT >= 1 and <= 63 (a valid operand
;; for 64bit shift & compare patterns, as shifting by 0 does not change flags).
(define_predicate "const_1_to_63_operand"
(and (match_code "const_int")
(match_test "IN_RANGE (INTVAL (op), 1, 63)")))
;; Match 2 or 3. ;; Match 2 or 3.
(define_predicate "const_2_to_3_operand" (define_predicate "const_2_to_3_operand"
(and (match_code "const_int") (and (match_code "const_int")
......
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