From patchwork Fri Nov 17 16:03:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 119170 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp694502qgn; Fri, 17 Nov 2017 08:03:41 -0800 (PST) X-Google-Smtp-Source: AGs4zMa7itu0HGpVNtY4odeq8M7HBVizEL8WnpeOrs3LNSWbhuHKgMT7FNVYtqhduoiffgIIlmUa X-Received: by 10.159.252.1 with SMTP id n1mr5642794pls.415.1510934621018; Fri, 17 Nov 2017 08:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510934621; cv=none; d=google.com; s=arc-20160816; b=IYkyVXClHtiN7/z14Akg4I4qf3fMvQbsBunV4t+Mf7DRuCtohdkx2Uf80wyAJMvffP mE/knStsmbQHkjBTc79nrc0HxGZENOESO6e/OBalODGcBp51yme6S2vsqvB/3S9wM2Hc T2D+yazF3izfJ9x+47QUN9xCqiq9UatbTR6ZDugI4PA8RYC0OBWp81UA23umFLcFom9Y uiF0Fl8sPP7dUrTddiq4Tg5Sd7ByCVt6wy7luWMz8sJs7PKcK3bVYPXDjrnjKFGCCtpa THhnAEGFiGa60Yxg0O4q4lqvimwMAUMM9zcDorhSO73b1BpMSBR2hFHJR9YSe2Su2lNK AaSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:date:subject:mail-followup-to:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=IPCdskEuEuXqgFGVH1ItJTlob+qTNSshkOfGW1Eupcs=; b=RFBfu6mYWdeANP52vdzmmtbdptza4gJ7pAWq5KsPM72D55Wp6FJDu4+trCbWZGoTSq nZJ2XWLFIMcK1YbmkfDitdFytrvWcEPd3kF/YMNVQzvHwf2gRPV7t4wMVlSzML82ARjJ yVTVH6osQ4SXDw8l1/pdpWk7+6zLZxtnENjN0mYlSzTTQRXRFnO9Gdb7MTSCPAs0aL9/ iBBjAQQ8dIvXXVxiPV1M8vrwxhJQGIB+7m4X8cIoxG0tuyAFwEKhCbUtcQtZswUrFO3z D/cInlU9YTfPa0cEPHew3ZRrd2+kJueEYjWxsvZQyt8uora0QqwOqJ9hz5rPAuL5KK10 s76w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=sXhn0f1Z; spf=pass (google.com: domain of gcc-patches-return-467165-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-467165-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id m3si3027448pld.27.2017.11.17.08.03.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:03:41 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-467165-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=sXhn0f1Z; spf=pass (google.com: domain of gcc-patches-return-467165-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-467165-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=Ho1a3cI0LczgdgXHtqqOOHquiDhA/7PwsxodI2qg4ZFf0FHf6QWt0 YrqYDtgRVEyZRSeE47oWPPnWjMDXJ+0l7nol2mniZu9Zme6hvAPs12zwUqznKoia YQt0hZWWUT1IUTPTHNvX5zvHN8/4A2KpQn4pyModVTsmsAmAQSHg5g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=K0d/z+N/5UwqLjF7qnYxAMDoXY0=; b=sXhn0f1Z7lG94Ids/GuI VQw7GxOgAg4PSiBr4wyl+HDkE7Fv2rz2oi2OXwcdVRxvqpja4o0FoGw+eOkwba9g EjUu8un90OhnotxnP91iNi2avqq9HIdhi0iF4xEl8xPnnlX4zqYwj5BVK93gIwYK SAzKEtIPIuLCifhbj0Ez5KU= Received: (qmail 98363 invoked by alias); 17 Nov 2017 16:03:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 98354 invoked by uid 89); 17 Nov 2017 16:03:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f67.google.com Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Nov 2017 16:03:08 +0000 Received: by mail-wm0-f67.google.com with SMTP id b189so7440401wmd.0 for ; Fri, 17 Nov 2017 08:03:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:date:message-id :user-agent:mime-version; bh=IPCdskEuEuXqgFGVH1ItJTlob+qTNSshkOfGW1Eupcs=; b=Cvo0aYycdYFkdqzT/dEq2vms7IvPfJehTE0vpP1Ym8NRdCNnMpvOGTdOn1rKOKTA1f H3XXcBwz/AT0hwSlb0U2QKjj1HKvx0poAua4QYEStuSdvO+YqOteaq9VauyV8x18//ff wnaJQRj0J33JrgJeX2jHQxvQ7jK55wXqMbi+i7IN0EzWEmYvaLFCrlDXeTWaUNys/Jvu uvQtSrcxM1ykcvZZ0pBw4odLhxSetrNIyi9AVVDyQvcmTyISUqsJbFU8KkXetX6cCeAM P88VMpDtAekGRrtDi/EiTYcA+HkfDTfoFaofzzISHB4WMd/36pU0xjur+woQ7OxawwAc 1x+w== X-Gm-Message-State: AJaThX6aNujG9aCWqoiEPjazB9P++h7PhBQk4QV7bPc/x6hohUxReJLt dFeZgNKB2mzwZBFCEZBuKVFtitpWmhQ= X-Received: by 10.28.230.140 with SMTP id e12mr4190490wmi.118.1510934586175; Fri, 17 Nov 2017 08:03:06 -0800 (PST) Received: from localhost ([2.25.234.120]) by smtp.gmail.com with ESMTPSA id q13sm2452994wrg.97.2017.11.17.08.03.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Nov 2017 08:03:05 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: Rework the legitimize_address_displacement hook Date: Fri, 17 Nov 2017 16:03:04 +0000 Message-ID: <878tf4yjt3.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 This patch: - tweaks the handling of legitimize_address_displacement so that it gets called before rather than after the address has been expanded. This means that we're no longer at the mercy of LRA being able to interpret the expanded instructions. - passes the original offset to legitimize_address_displacement. - adds SVE support to the AArch64 implementation of legitimize_address_displacement. Tested on aarch64-linux-gnu (with and without SVE), x86_64-linux-gnu and powerpc64le-linux-gnu. OK to install? Richard 2017-11-17 Richard Sandiford Alan Hayward David Sherwood gcc/ * target.def (legitimize_address_displacement): Take the original offset as a poly_int. * targhooks.h (default_legitimize_address_displacement): Update accordingly. * targhooks.c (default_legitimize_address_displacement): Likewise. * doc/tm.texi: Regenerate. * lra-constraints.c (base_plus_disp_to_reg): Take the displacement as an argument, moving assert of ad->disp == ad->disp_term to... (process_address_1): ...here. Update calls to base_plus_disp_to_reg. Try calling targetm.legitimize_address_displacement before expanding the address rather than afterwards, and adjust for the new interface. * config/aarch64/aarch64.c (aarch64_legitimize_address_displacement): Match the new hook interface. Handle SVE addresses. * config/sh/sh.c (sh_legitimize_address_displacement): Make the new hook interface. Index: gcc/target.def =================================================================== --- gcc/target.def 2017-11-17 16:01:54.798206825 +0000 +++ gcc/target.def 2017-11-17 16:01:54.994775173 +0000 @@ -5615,13 +5615,16 @@ as SH, this hook can be used to avoid ex displacement addressing. */ DEFHOOK (legitimize_address_displacement, - "A target hook which returns @code{true} if *@var{disp} is\n\ -legitimezed to valid address displacement with subtracting *@var{offset}\n\ -at memory mode @var{mode}.\n\ -The default version of this target hook returns @code{false}.\n\ -This hook will benefit machines with limited base plus displacement\n\ -addressing.", - bool, (rtx *disp, rtx *offset, machine_mode mode), + "This hook tries to split address offset @var{orig_offset} into\n\ +two parts: one that should be added to the base address to create\n\ +a local anchor point, and an additional offset that can be applied\n\ +to the anchor to address a value of mode @var{mode}. The idea is that\n\ +the local anchor could be shared by other accesses to nearby locations.\n\ +\n\ +The hook returns true if it succeeds, storing the offset of the\n\ +anchor from the base in @var{offset1} and the offset of the final address\n\ +from the anchor in @var{offset2}. The default implementation returns false.", + bool, (rtx *offset1, rtx *offset2, poly_int64 orig_offset, machine_mode mode), default_legitimize_address_displacement) /* This target hook allows the backend to perform additional Index: gcc/targhooks.h =================================================================== --- gcc/targhooks.h 2017-11-17 16:01:54.798206825 +0000 +++ gcc/targhooks.h 2017-11-17 16:01:54.995689444 +0000 @@ -25,7 +25,7 @@ extern bool default_legitimate_address_p extern void default_external_libcall (rtx); extern rtx default_legitimize_address (rtx, rtx, machine_mode); extern bool default_legitimize_address_displacement (rtx *, rtx *, - machine_mode); + poly_int64, machine_mode); extern bool default_const_not_ok_for_debug_p (rtx); extern int default_unspec_may_trap_p (const_rtx, unsigned); Index: gcc/targhooks.c =================================================================== --- gcc/targhooks.c 2017-11-17 16:01:54.798206825 +0000 +++ gcc/targhooks.c 2017-11-17 16:01:54.994775173 +0000 @@ -171,9 +171,8 @@ default_legitimize_address (rtx x, rtx o } bool -default_legitimize_address_displacement (rtx *disp ATTRIBUTE_UNUSED, - rtx *offset ATTRIBUTE_UNUSED, - machine_mode mode ATTRIBUTE_UNUSED) +default_legitimize_address_displacement (rtx *, rtx *, poly_int64, + machine_mode) { return false; } Index: gcc/doc/tm.texi =================================================================== --- gcc/doc/tm.texi 2017-11-17 16:01:54.798206825 +0000 +++ gcc/doc/tm.texi 2017-11-17 16:01:54.993860901 +0000 @@ -2894,13 +2894,16 @@ machines with non orthogonal register us as SH, this hook can be used to avoid excessive spilling. @end deftypefn -@deftypefn {Target Hook} bool TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT (rtx *@var{disp}, rtx *@var{offset}, machine_mode @var{mode}) -A target hook which returns @code{true} if *@var{disp} is -legitimezed to valid address displacement with subtracting *@var{offset} -at memory mode @var{mode}. -The default version of this target hook returns @code{false}. -This hook will benefit machines with limited base plus displacement -addressing. +@deftypefn {Target Hook} bool TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT (rtx *@var{offset1}, rtx *@var{offset2}, poly_int64 @var{orig_offset}, machine_mode @var{mode}) +This hook tries to split address offset @var{orig_offset} into +two parts: one that should be added to the base address to create +a local anchor point, and an additional offset that can be applied +to the anchor to address a value of mode @var{mode}. The idea is that +the local anchor could be shared by other accesses to nearby locations. + +The hook returns true if it succeeds, storing the offset of the +anchor from the base in @var{offset1} and the offset of the final address +from the anchor in @var{offset2}. The default implementation returns false. @end deftypefn @deftypefn {Target Hook} reg_class_t TARGET_SPILL_CLASS (reg_class_t, @var{machine_mode}) Index: gcc/lra-constraints.c =================================================================== --- gcc/lra-constraints.c 2017-11-17 16:01:54.798206825 +0000 +++ gcc/lra-constraints.c 2017-11-17 16:01:54.994775173 +0000 @@ -3053,19 +3053,19 @@ base_to_reg (struct address_info *ad) return new_inner; } -/* Make reload base reg + disp from address AD. Return the new pseudo. */ +/* Make reload base reg + DISP from address AD. Return the new pseudo. */ static rtx -base_plus_disp_to_reg (struct address_info *ad) +base_plus_disp_to_reg (struct address_info *ad, rtx disp) { enum reg_class cl; rtx new_reg; - lra_assert (ad->base == ad->base_term && ad->disp == ad->disp_term); + lra_assert (ad->base == ad->base_term); cl = base_reg_class (ad->mode, ad->as, ad->base_outer_code, get_index_code (ad)); new_reg = lra_create_new_reg (GET_MODE (*ad->base_term), NULL_RTX, cl, "base + disp"); - lra_emit_add (new_reg, *ad->base_term, *ad->disp_term); + lra_emit_add (new_reg, *ad->base_term, disp); return new_reg; } @@ -3415,12 +3415,30 @@ process_address_1 (int nop, bool check_o displacements, so reloading into an index register would not necessarily be a win. */ if (new_reg == NULL_RTX) - new_reg = base_plus_disp_to_reg (&ad); + { + /* See if the target can split the displacement into a + legitimate new displacement from a local anchor. */ + gcc_assert (ad.disp == ad.disp_term); + poly_int64 orig_offset; + rtx offset1, offset2; + if (poly_int_rtx_p (*ad.disp, &orig_offset) + && targetm.legitimize_address_displacement (&offset1, &offset2, + orig_offset, + ad.mode)) + { + new_reg = base_plus_disp_to_reg (&ad, offset1); + new_reg = gen_rtx_PLUS (GET_MODE (new_reg), new_reg, offset2); + } + else + new_reg = base_plus_disp_to_reg (&ad, *ad.disp); + } insns = get_insns (); last_insn = get_last_insn (); /* If we generated at least two insns, try last insn source as an address. If we succeed, we generate one less insn. */ - if (last_insn != insns && (set = single_set (last_insn)) != NULL_RTX + if (REG_P (new_reg) + && last_insn != insns + && (set = single_set (last_insn)) != NULL_RTX && GET_CODE (SET_SRC (set)) == PLUS && REG_P (XEXP (SET_SRC (set), 0)) && CONSTANT_P (XEXP (SET_SRC (set), 1))) @@ -3440,32 +3458,6 @@ process_address_1 (int nop, bool check_o delete_insns_since (PREV_INSN (last_insn)); } } - /* Try if target can split displacement into legitimite new disp - and offset. If it's the case, we replace the last insn with - insns for base + offset => new_reg and set new_reg + new disp - to *ad.inner. */ - last_insn = get_last_insn (); - if ((set = single_set (last_insn)) != NULL_RTX - && GET_CODE (SET_SRC (set)) == PLUS - && REG_P (XEXP (SET_SRC (set), 0)) - && REGNO (XEXP (SET_SRC (set), 0)) < FIRST_PSEUDO_REGISTER - && CONST_INT_P (XEXP (SET_SRC (set), 1))) - { - rtx addend, disp = XEXP (SET_SRC (set), 1); - if (targetm.legitimize_address_displacement (&disp, &addend, - ad.mode)) - { - rtx_insn *new_insns; - start_sequence (); - lra_emit_add (new_reg, XEXP (SET_SRC (set), 0), addend); - new_insns = get_insns (); - end_sequence (); - new_reg = gen_rtx_PLUS (Pmode, new_reg, disp); - delete_insns_since (PREV_INSN (last_insn)); - add_insn (new_insns); - insns = get_insns (); - } - } end_sequence (); emit_insn (insns); *ad.inner = new_reg; @@ -3474,7 +3466,8 @@ process_address_1 (int nop, bool check_o { /* base + scale * index + disp => new base + scale * index, case (1) above. */ - new_reg = base_plus_disp_to_reg (&ad); + gcc_assert (ad.disp == ad.disp_term); + new_reg = base_plus_disp_to_reg (&ad, *ad.disp); *ad.inner = simplify_gen_binary (PLUS, GET_MODE (new_reg), new_reg, *ad.index); } Index: gcc/config/aarch64/aarch64.c =================================================================== --- gcc/config/aarch64/aarch64.c 2017-11-17 16:01:54.798206825 +0000 +++ gcc/config/aarch64/aarch64.c 2017-11-17 16:01:54.992032358 +0000 @@ -5902,32 +5902,78 @@ aarch64_legitimate_address_p (machine_mo return aarch64_classify_address (&addr, x, mode, strict_p, type); } -/* Split an out-of-range address displacement into a base and offset. - Use 4KB range for 1- and 2-byte accesses and a 16KB range otherwise - to increase opportunities for sharing the base address of different sizes. - Unaligned accesses use the signed 9-bit range, TImode/TFmode use - the intersection of signed scaled 7-bit and signed 9-bit offset. */ +/* Implement TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT. */ + static bool -aarch64_legitimize_address_displacement (rtx *disp, rtx *off, machine_mode mode) +aarch64_legitimize_address_displacement (rtx *offset1, rtx *offset2, + poly_int64 orig_offset, + machine_mode mode) { HOST_WIDE_INT size; if (GET_MODE_SIZE (mode).is_constant (&size)) { - HOST_WIDE_INT offset = INTVAL (*disp); - HOST_WIDE_INT base; + HOST_WIDE_INT const_offset, second_offset; + + /* A general SVE offset is A * VQ + B. Remove the A component from + coefficient 0 in order to get the constant B. */ + const_offset = orig_offset.coeffs[0] - orig_offset.coeffs[1]; + /* Split an out-of-range address displacement into a base and + offset. Use 4KB range for 1- and 2-byte accesses and a 16KB + range otherwise to increase opportunities for sharing the base + address of different sizes. Unaligned accesses use the signed + 9-bit range, TImode/TFmode use the intersection of signed + scaled 7-bit and signed 9-bit offset. */ if (mode == TImode || mode == TFmode) - base = (offset + 0x100) & ~0x1f8; - else if ((offset & (size - 1)) != 0) - base = (offset + 0x100) & ~0x1ff; + second_offset = ((const_offset + 0x100) & 0x1f8) - 0x100; + else if ((const_offset & (size - 1)) != 0) + second_offset = ((const_offset + 0x100) & 0x1ff) - 0x100; + else + second_offset = const_offset & (size < 4 ? 0xfff : 0x3ffc); + + if (second_offset == 0 || must_eq (orig_offset, second_offset)) + return false; + + /* Split the offset into second_offset and the rest. */ + *offset1 = gen_int_mode (orig_offset - second_offset, Pmode); + *offset2 = gen_int_mode (second_offset, Pmode); + return true; + } + else + { + /* Get the mode we should use as the basis of the range. For structure + modes this is the mode of one vector. */ + unsigned int vec_flags = aarch64_classify_vector_mode (mode); + machine_mode step_mode + = (vec_flags & VEC_STRUCT) != 0 ? SVE_BYTE_MODE : mode; + + /* Get the "mul vl" multiplier we'd like to use. */ + HOST_WIDE_INT factor = GET_MODE_SIZE (step_mode).coeffs[1]; + HOST_WIDE_INT vnum = orig_offset.coeffs[1] / factor; + if (vec_flags & VEC_SVE_DATA) + /* LDR supports a 9-bit range, but the move patterns for + structure modes require all vectors to be in range of the + same base. The simplest way of accomodating that while still + promoting reuse of anchor points between different modes is + to use an 8-bit range unconditionally. */ + vnum = ((vnum + 128) & 255) - 128; else - base = offset & ~(size < 4 ? 0xfff : 0x3ffc); + /* Predicates are only handled singly, so we might as well use + the full range. */ + vnum = ((vnum + 256) & 511) - 256; + if (vnum == 0) + return false; + + /* Convert the "mul vl" multiplier into a byte offset. */ + poly_int64 second_offset = GET_MODE_SIZE (step_mode) * vnum; + if (must_eq (second_offset, orig_offset)) + return false; - *off = GEN_INT (base); - *disp = GEN_INT (offset - base); + /* Split the offset into second_offset and the rest. */ + *offset1 = gen_int_mode (orig_offset - second_offset, Pmode); + *offset2 = gen_int_mode (second_offset, Pmode); return true; } - return false; } /* Return the binary representation of floating point constant VALUE in INTVAL. Index: gcc/config/sh/sh.c =================================================================== --- gcc/config/sh/sh.c 2017-11-17 16:01:54.798206825 +0000 +++ gcc/config/sh/sh.c 2017-11-17 16:01:54.992946630 +0000 @@ -269,7 +269,8 @@ static bool sh_legitimate_address_p (mac static rtx sh_legitimize_address (rtx, rtx, machine_mode); static rtx sh_delegitimize_address (rtx); static bool sh_cannot_substitute_mem_equiv_p (rtx); -static bool sh_legitimize_address_displacement (rtx *, rtx *, machine_mode); +static bool sh_legitimize_address_displacement (rtx *, rtx *, + poly_int64, machine_mode); static int scavenge_reg (HARD_REG_SET *s); static rtx sh_struct_value_rtx (tree, int); @@ -11395,20 +11396,21 @@ sh_cannot_substitute_mem_equiv_p (rtx) return true; } -/* Return true if DISP can be legitimized. */ +/* Implement TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT. */ static bool -sh_legitimize_address_displacement (rtx *disp, rtx *offs, +sh_legitimize_address_displacement (rtx *offset1, rtx *offset2, + poly_int64 orig_offset, machine_mode mode) { if ((TARGET_FPU_DOUBLE && mode == DFmode) || (TARGET_SH2E && mode == SFmode)) return false; - struct disp_adjust adj = sh_find_mov_disp_adjust (mode, INTVAL (*disp)); + struct disp_adjust adj = sh_find_mov_disp_adjust (mode, orig_offset); if (adj.offset_adjust != NULL_RTX && adj.mov_disp != NULL_RTX) { - *disp = adj.mov_disp; - *offs = adj.offset_adjust; + *offset1 = adj.offset_adjust; + *offset2 = adj.mov_disp; return true; }