From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27139 invoked by alias); 4 Oct 2011 23:05:48 -0000 Received: (qmail 27127 invoked by uid 22791); 4 Oct 2011 23:05:47 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_FN X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Oct 2011 23:05:15 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p94N5BTq008244 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 4 Oct 2011 19:05:12 -0400 Received: from anchor.twiddle.net (vpn-235-162.phx2.redhat.com [10.3.235.162]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p94N5ALA019495; Tue, 4 Oct 2011 19:05:11 -0400 Message-ID: <4E8B9126.4090109@redhat.com> Date: Tue, 04 Oct 2011 23:13:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: "Jayant R. Sonar" CC: "joseph@codesourcery.com" , "gcc-patches@gcc.gnu.org" Subject: Re: [Ping] RE: CR16 Port addition References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00288.txt.bz2 > +(define_constraint "M" > + "A unsigned and customized 4-bit immediate." > + (and (match_code "const_int") > + (match_test "(IN_RANGE_P (ival, 0, 15) && ((ival != 9) || (ival != 11))) "))) Logic error: x != 9 || x != 11 => true. > +/* TARGETM Function Prototypes and forward declarations */ > +static rtx cr16_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED, > + int incoming ATTRIBUTE_UNUSED); > +static bool cr16_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED); > +static bool cr16_frame_pointer_required (void); > +static bool cr16_can_eliminate (const int, const int); > +static rtx cr16_legitimize_address (rtx, rtx, enum machine_mode); > +static enum machine_mode cr16_unwind_word_mode (void); > +static void cr16_conditional_register_usage (void); > +static void cr16_override_options (void); > +static bool cr16_class_likely_spilled_p (reg_class_t); > +static int cr16_return_pops_args (tree, tree, int); > +static rtx cr16_function_arg (CUMULATIVE_ARGS *, enum machine_mode, > + const_tree, bool); > +static void cr16_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, > + const_tree, bool); > +static bool cr16_legitimate_constant_p (enum machine_mode, rtx); > +static rtx cr16_function_value (const_tree, const_tree, bool); > +static rtx cr16_libcall_value (enum machine_mode, const_rtx); > +static bool cr16_function_value_regno_p (const unsigned int); > +static bool cr16_legitimate_address_p (enum machine_mode, rtx, bool); > +static void cr16_print_operand (FILE *, rtx, int); > +static void cr16_print_operand_address (FILE *, rtx); > +static int cr16_address_cost (rtx, bool); > +static int cr16_register_move_cost (enum machine_mode, reg_class_t, reg_class_t); > +static int cr16_memory_move_cost (enum machine_mode, reg_class_t, bool); Please delete as many of these as you can. Since the TARGETM structure is now at the end, I suspect you need none of them. > +cr16_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) > +{ > + if (TYPE_MODE (type) == BLKmode) Don't define your ABI based on modes. Define your ABI in terms of types and sizes. Different versions of the compiler can and will have different modes based on various optimizations. > + data_model = DM_DEFAULT; > + > + > +} Extra whitespace. Check for this all over. > + case UNSPEC: > + inform (input_location, "unspec!!"); > + switch (XINT (x, 1)) > + { > + default: > + gcc_unreachable (); > + } > + break; Delete debuging statements. > + REG_NOTES (insn) = gen_rtx_EXPR_LIST (SImode, dwarf, > + REG_NOTES (insn)); Huh? That's not a reg note. Try something like add_reg_note (insn, kind, dwarf). Certainly "SImode" is the wrong enum type. > +/* Helper function for md file. This function is used to emit arithmetic > + DI instructions. The argument "num" decides which instruction to be > + printed. */ > +const char * > +cr16_emit_add_sub_di (rtx *operands, int num) ... > +const char * > +cr16_emit_logical_di (rtx *operands, int num) Why use 0, 1, 2 instead of the proper enum rtx_code? > +#define FUNCTION_BOUNDARY (!optimize_size ? BIGGEST_ALIGNMENT : BITS_PER_WORD) This is part of the ABI, and so should not change based on optimization. It should be the minimum necessary alignment of an instruction. > +(define_expand "adddi3" > + [(set (match_operand:DI 0 "register_operand" "") > + (plus:DI (match_operand:DI 1 "register_operand" "") > + (match_operand:DI 2 "nonmemory_operand" "")))] > + "" > + { > + if ((GET_CODE (operands[2]) != REG)) > + { > + operands[2] = force_reg (DImode, operands[2]); > + } > + } > +) Still unfixed from last review. Remove this expander and rename "adddi3_insn" to "adddi3". You do not need this. Similarly for subdi3, anddi3, iordi3, > + "* > + return cr16_emit_add_sub_di (operands, 0); > + " "* is deprecated. Use { } instead. Many examples. > +(define_insn "smachisi3" This should be spelled "maddhisi4" so that it'll be used by generic code. > +(define_insn "umachisi3" "umaddhisi4". > +(define_insn "indirect_jump_return" > + [(parallel > + [(set (pc) > + (reg:SI RA_REGNUM)) > + (return)]) > + ] Unfixed from last review. Double parallel. > 3c3 > < 2008, 2009, 2010 Free Software Foundation, Inc. > --- >> 2008, 2009, 2010, 2011 Free Software Foundation, Inc. > 39a40,43 Non-context/unidiffs will not be reviewed. r~