This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is there a way to adjust alignment of DImode and DFmode?
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jim Wilson <jim dot wilson at linaro dot org>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Thu, 21 May 2015 14:40:55 -0700
- Subject: Re: Is there a way to adjust alignment of DImode and DFmode?
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOriqDgDQ9Bbe+FU3_AUZdOOU5JxNAH5LXreebDR22Y0Ag at mail dot gmail dot com> <555E4687 dot 6030800 at linaro dot org> <CAMe9rOq6eQtEM2xhy_ijVgfEHVTCA3LFb6EKLPMwH8Z2kHcOnw at mail dot gmail dot com> <CAMe9rOrm9X5q0dgqgjfnoWRkyE403BFbbYYzRER6zdTesuYXfA at mail dot gmail dot com>
On Thu, May 21, 2015 at 2:25 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, May 21, 2015 at 2:08 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Thu, May 21, 2015 at 1:56 PM, Jim Wilson <jim.wilson@linaro.org> wrote:
>>> On 05/20/2015 10:00 AM, H.J. Lu wrote:
>>>> By default, alignment of DImode and DFmode is set to 8 bytes.
>>>> Intel MCU psABI specifies alignment of DImode and DFmode
>>>> to be 4 bytes. I'd like to make get_mode_alignment to return
>>>> 32 bits for DImode and DFmode. Is there a way to adjust alignment
>>>> of DImode and DFmode via ADJUST_ALIGNMENT?
>>>
>>> I see that i386-modes.def already uses ADJUST_ALIGNMENT to change the
>>> alignment of XFmode to 4 for ilp32 code. ADJUST_ALIGNMENT should work
>>> the same for DImode and DFmode. Did you run into a problem when you
>>> tried it?
>>
>> It seems to work. I don't know why it failed for me last time.
>>
>
> Now I remembered. It doesn't work for complex and decimal
> floating point modes:
>
> build/genmodes: config/i386/i386-modes.def:41: no mode "DD"
> build/genmodes: config/i386/i386-modes.def:42: no mode "TD"
>
machmode.def has
/* Allow the target to specify additional modes of various kinds. */
#if HAVE_EXTRA_MODES
# include EXTRA_MODES_FILE
#endif
/* Complex modes. */
COMPLEX_MODES (INT);
COMPLEX_MODES (FLOAT);
/* Decimal floating point modes. */
DECIMAL_FLOAT_MODE (SD, 4, decimal_single_format);
DECIMAL_FLOAT_MODE (DD, 8, decimal_double_format);
DECIMAL_FLOAT_MODE (TD, 16, decimal_quad_format);
We can't adjust any modes in i386-modes.def since they
aren't available yet. But we need to include i386-modes.def
before
COMPLEX_MODES (FLOAT);
to get XCmode.
Should we add an EXTRA_ALIGNMENTS_FILE and include it
after all modes are created?
--
H.J.