From 40c81f845c6f1c5e6df74442ca59279090ac1e8d Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 15 May 2019 19:59:19 +0200 Subject: [PATCH] i386-expand.c (ix86_split_idivmod): Rename signed_p argument to unsigned_p. * config/i386/i386-expand.c (ix86_split_idivmod): Rename signed_p argument to unsigned_p. Update all uses for changed polarity. * config/i386/i386.md (u_bool): Handle DIV and UDIV RTXes. (divmod splitters): Use u_bool macro in the call to ix86_split_idivmod. From-SVN: r271259 --- gcc/config/i386/i386-expand.c | 20 ++++++++++---------- gcc/config/i386/i386.md | 9 +++++---- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c index a8ed33c48e5..df035607fa7 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c @@ -1115,7 +1115,7 @@ predict_jump (int prob) void ix86_split_idivmod (machine_mode mode, rtx operands[], - bool signed_p) + bool unsigned_p) { rtx_code_label *end_label, *qimode_label; rtx div, mod; @@ -1131,22 +1131,22 @@ ix86_split_idivmod (machine_mode mode, rtx operands[], if (GET_MODE (operands[0]) == SImode) { if (GET_MODE (operands[1]) == SImode) - gen_divmod4_1 = signed_p ? gen_divmodsi4_1 : gen_udivmodsi4_1; + gen_divmod4_1 = unsigned_p ? gen_udivmodsi4_1 : gen_divmodsi4_1; else gen_divmod4_1 - = signed_p ? gen_divmodsi4_zext_2 : gen_udivmodsi4_zext_2; + = unsigned_p ? gen_udivmodsi4_zext_2 : gen_divmodsi4_zext_2; gen_zero_extend = gen_zero_extendqisi2; } else { gen_divmod4_1 - = signed_p ? gen_divmodsi4_zext_1 : gen_udivmodsi4_zext_1; + = unsigned_p ? gen_udivmodsi4_zext_1 : gen_divmodsi4_zext_1; gen_zero_extend = gen_zero_extendqidi2; } gen_test_ccno_1 = gen_testsi_ccno_1; break; case E_DImode: - gen_divmod4_1 = signed_p ? gen_divmoddi4_1 : gen_udivmoddi4_1; + gen_divmod4_1 = unsigned_p ? gen_udivmoddi4_1 : gen_divmoddi4_1; gen_test_ccno_1 = gen_testdi_ccno_1; gen_zero_extend = gen_zero_extendqidi2; break; @@ -1192,15 +1192,15 @@ ix86_split_idivmod (machine_mode mode, rtx operands[], tmp2 = lowpart_subreg (QImode, operands[3], mode); emit_insn (gen_udivmodhiqi3 (tmp0, tmp1, tmp2)); - if (signed_p) + if (unsigned_p) { - div = gen_rtx_DIV (mode, operands[2], operands[3]); - mod = gen_rtx_MOD (mode, operands[2], operands[3]); + div = gen_rtx_UDIV (mode, operands[2], operands[3]); + mod = gen_rtx_UMOD (mode, operands[2], operands[3]); } else { - div = gen_rtx_UDIV (mode, operands[2], operands[3]); - mod = gen_rtx_UMOD (mode, operands[2], operands[3]); + div = gen_rtx_DIV (mode, operands[2], operands[3]); + mod = gen_rtx_MOD (mode, operands[2], operands[3]); } if (mode == SImode) { diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 1bc14b94cb9..2e6329a3890 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -952,7 +952,8 @@ (define_code_attr s [(sign_extend "s") (zero_extend "u")]) (define_code_attr u [(sign_extend "") (zero_extend "u") (div "") (udiv "u")]) -(define_code_attr u_bool [(sign_extend "false") (zero_extend "true")]) +(define_code_attr u_bool [(sign_extend "false") (zero_extend "true") + (div "false") (udiv "true")]) ;; Used in signed and unsigned truncations. (define_code_iterator any_truncate [ss_truncate truncate us_truncate]) @@ -7522,7 +7523,7 @@ && can_create_pseudo_p () && !optimize_insn_for_size_p ()" [(const_int 0)] - "ix86_split_idivmod (mode, operands, true); DONE;") + "ix86_split_idivmod (mode, operands, ); DONE;") (define_split [(set (match_operand:DI 0 "register_operand") @@ -7538,7 +7539,7 @@ && can_create_pseudo_p () && !optimize_insn_for_size_p ()" [(const_int 0)] - "ix86_split_idivmod (SImode, operands, true); DONE;") + "ix86_split_idivmod (SImode, operands, ); DONE;") (define_split [(set (match_operand:DI 1 "register_operand") @@ -7554,7 +7555,7 @@ && can_create_pseudo_p () && !optimize_insn_for_size_p ()" [(const_int 0)] - "ix86_split_idivmod (SImode, operands, true); DONE;") + "ix86_split_idivmod (SImode, operands, ); DONE;") (define_insn_and_split "divmod4_1" [(set (match_operand:SWI48 0 "register_operand" "=a") -- 2.30.2