From 40858b9dfb72960bff5978b1441d0f2d21ae55ba Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Thu, 19 Sep 2019 16:51:08 +0000 Subject: [PATCH] [ARM] Simplify logical DImode iterators Further simplify the logical DImode expander using code iterator and obtab attributes. This avoids adding unnecessary code_attr entries. gcc/ * config/arm/arm.md (di3): Use and . * config/arm/iterators.md (optab): Add and, ior, xor entries. (logical_op): Remove code attribute. (logical_OP): Likewise. From-SVN: r275970 --- gcc/ChangeLog | 7 +++++++ gcc/config/arm/arm.md | 8 ++++---- gcc/config/arm/iterators.md | 12 ++++++++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac055ef27a5..3be2b55523b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-09-19 Wilco Dijkstra + + * config/arm/arm.md (di3): Use and . + * config/arm/iterators.md (optab): Add and, ior, xor entries. + (logical_op): Remove code attribute. + (logical_OP): Likewise. + 2019-09-19 Martin Liska * ipa-icf.c (sort_congruence_class_groups_by_decl_uid): diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index d54082b13dd..d607f88cb05 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -2039,16 +2039,16 @@ ; operands or complex immediates, which leads to fewer LDRD/STRD instructions. ; So an explicit expander is needed to generate better code. -(define_expand "di3" +(define_expand "di3" [(set (match_operand:DI 0 "s_register_operand") (LOGICAL:DI (match_operand:DI 1 "s_register_operand") - (match_operand:DI 2 "arm_di_operand")))] + (match_operand:DI 2 "arm_di_operand")))] "TARGET_32BIT" { - rtx low = simplify_gen_binary (, SImode, + rtx low = simplify_gen_binary (, SImode, gen_lowpart (SImode, operands[1]), gen_lowpart (SImode, operands[2])); - rtx high = simplify_gen_binary (, SImode, + rtx high = simplify_gen_binary (, SImode, gen_highpart (SImode, operands[1]), gen_highpart_mode (SImode, DImode, operands[2])); diff --git a/gcc/config/arm/iterators.md b/gcc/config/arm/iterators.md index 5e3299e8508..2d8ef3f5fbd 100644 --- a/gcc/config/arm/iterators.md +++ b/gcc/config/arm/iterators.md @@ -287,9 +287,6 @@ (define_code_attr vfml_op [(plus "a") (minus "s")]) -(define_code_attr logical_op [(ior "ior") (xor "xor") (and "and")]) -(define_code_attr logical_OP [(ior "IOR") (xor "XOR") (and "AND")]) - ;;---------------------------------------------------------------------------- ;; Int iterators ;;---------------------------------------------------------------------------- @@ -797,7 +794,14 @@ (umax "u")]) (define_code_attr cnb [(ltu "CC_C") (geu "CC")]) -(define_code_attr optab [(ltu "ltu") (geu "geu")]) + +;; Map rtl operator codes to optab names +(define_code_attr optab + [(ltu "ltu") + (geu "geu") + (and "and") + (ior "ior") + (xor "xor")]) ;; Assembler mnemonics for signedness of widening operations. (define_code_attr US [(sign_extend "s") (zero_extend "u")]) -- 2.30.2