From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22342 invoked by alias); 6 Dec 2001 21:01:37 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 22206 invoked from network); 6 Dec 2001 21:01:34 -0000 Received: from unknown (HELO motgate.mot.com) (129.188.136.100) by sources.redhat.com with SMTP; 6 Dec 2001 21:01:34 -0000 Received: [from pobox.mot.com (pobox.mot.com [129.188.137.100]) by motgate.mot.com (motgate 2.1) with ESMTP id OAA14862 for ; Thu, 6 Dec 2001 14:01:33 -0700 (MST)] Received: [from mail.wm.sps.mot.com ([199.10.246.2]) by pobox.mot.com (MOT-pobox 2.0) with ESMTP id OAA28892 for ; Thu, 6 Dec 2001 14:01:32 -0700 (MST)] Received: from hyper.wm.sps.mot.com (hyper.wm.sps.mot.com [199.10.246.43]) by mail.wm.sps.mot.com (8.9.3/8.9.3) with ESMTP id QAA29432 for ; Thu, 6 Dec 2001 16:01:26 -0500 Received: by hyper.wm.sps.mot.com (8.11.2) id fB6L1Vf06678; Thu, 6 Dec 2001 16:01:31 -0500 Date: Thu, 06 Dec 2001 13:13:00 -0000 Message-Id: <200112062101.fB6L1Vf06678@hyper.wm.sps.mot.com> From: Peter Barada To: gcc@gcc.gnu.org Subject: Re: How to force register indirect addressing of global FP variables X-SW-Source: 2001-12/txt/msg00309.txt.bz2 The Coldfire FPU can't deal with absolute addressing, or immediate values, so constants have to be loaded out of memory. I decided to carve this problem up into two parts. First I'll get gcc-2.95.3 to generate RTL to leave the DPFP constants in memory. Later I'll figure out how to deal with better methods of addressing the DPFP constants. I'm running into a problem where the instruction combination pass is putting back together the RTL that I split up. The rtl I have so far looks like(the 'Q' constraint is register indirect): (define_expand "movdf" [(set (match_operand:DF 0 "nonimmediate_operand" "") (match_operand:DF 1 "general_operand" ""))] "" " { if (TARGET_FPU_V4E) { /* The ColdFire FPU can't deal with absolute addresses or double * constants, so push the constant to memory */ if (CONSTANT_P (operands[1])) { operands[1] = force_const_mem(DFmode, operands[1]); if (! memory_address_p (DFmode, XEXP (operands[1], 0)) && ! reload_in_progress) operands[1] = change_address (operands[1], DFmode, XEXP (operands[1], 0)); } /* Since the Coldfire can't deal with absolute addresses, force * the address of the reference into a register and do it indirect */ if (!reload_in_progress && GET_CODE (operands[1]) == MEM && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF) operands[1] = gen_rtx (MEM, DFmode, force_reg (Pmode, XEXP (operands[1], 0))); } }") (define_insn "movdf_v4e" [(set (match_operand:DF 0 "general_operand" "=f,S") (match_operand:DF 1 "general_operand" "fS,f"))] "TARGET_FPU_V4E" "* { return \"fmove%.d %1,%0\"; }") And when I try to compile: double x(void) { return (0.5); } I get the following .c.rtl: (insn 8 6 9 (set (reg:SI 30) (symbol_ref/u:SI ("*.LC0"))) -1 (nil) (expr_list:REG_EQUAL (symbol_ref/u:SI ("*.LC0")) (nil))) (insn 9 8 10 (set (reg/i:DF 16 %fp0) (mem:DF (reg:SI 30) 0)) -1 (nil) (nil)) (insn 10 9 11 (use (reg/i:DF 16 %fp0)) -1 (nil) (nil)) Which looks correct, but the two are merged by the combiner back into: ;; Start of basic block 0, registers live: 14 [%a6] 15 [%sp] (note 17 6 8 [bb 0] NOTE_INSN_BASIC_BLOCK) (note 8 17 9 "" NOTE_INSN_DELETED) (insn 9 8 10 (set (reg/i:DF 16 %fp0) (mem:DF (symbol_ref/u:SI ("*.LC0")) 0)) 67 {movdf_v4e} (nil) (expr_list:REG_EQUAL (const_double:DF (mem/u:DF (symbol_ref/u:SI ("*.LC0")) 0) 0 [0x0] 0 [0x0] 1073643520 [0x3ffe8000]) (nil))) (insn 10 9 0 (use (reg/i:DF 16 %fp0)) -1 (insn_list 9 (nil)) (expr_list:REG_DEAD (reg/i:DF 16 %fp0) (nil))) ;; End of basic block 0 And the whole compilation fails with: /tmp/z.c: In function `x': /tmp/z.c:5: internal error--insn does not satisfy its constraints: (insn 21 8 9 (set (reg:DF 17 %fp1) (mem:DF (symbol_ref/u:SI ("*.LC0")) 0)) 67 {movdf_v4e} (nil) (nil)) How can I convince the combiner that it shouldn't merge these two insns into one??? -- Peter Barada Peter.Barada@motorola.com Wizard 781-852-2768 (direct) WaveMark Solutions(wholly owned by Motorola) 781-270-0193 (fax)