Re: [PATCH 32/35] m68k: add ColdFire FPU support for the V4e ColdFire CPU's

Greg Ungerer
2011-12-27T12:39:30Z

Hi Geert,

On 12/25/2011 05:38 AM, Geert Uytterhoeven wrote:
> On Fri, Dec 23, 2011 at 04:15,<gerg@snapgear.com> wrote:
>> @@ -570,15 +616,12 @@ static inline int rt_save_fpu_state(struct ucontext __user *uc, struct pt_regs *
>> Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡return err;
>> Ã¡ Ã¡ Ã¡ Ã¡}
>>
>> - Ã¡ Ã¡ Ã¡ __asm__ volatile (".chip 68k/68881\n\t"
>> - Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ "fsave %0\n\t"
>> - Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ ".chip 68k"
>> - Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ Ã¡ : : "m" (*fpstate) : "memory");
>> + Ã¡ Ã¡ Ã¡ __asm__ volatile ("fsave %0" : : "m" (*fpstate) : "memory");
>
> This change breaks one of my test configs, which builds for 68040 only:
>
> {standard input}: Assembler messages:
> {standard input}:475: Error: invalid instruction for this
> architecture; needs 68020 [68k, 68ec020], 68030 [68ec030], 68040
> [68ec040], 68060 [68ec060], cpu32 [68330, 68331, 68332, 68333, 68334,
> 68336, 68340, 68341, 68349, 68360], 547x [5470, 5471, 5472, 5473,
> 5474, 5475], 548x [5480, 5481, 5482, 5483, 5484, 5485] -- statement
> `fsave -540(%fp)' ignored
>
> You can reproduce it by taking e.g. amiga_defconfig and disabling all of
> CONFIG_M68[236]0, or by manually compiling arch/m68k/kernel/signal.c
> with "-m68040" added (that's what 68040-only does).
>
> By convention, we always switch to the needed CPU type using the ".chip"
> directive, and switch back to generic 68k afterwards. So I'd expect it to fail
> for all my builds, but it only does for the 68040-only ones...

Ok, I'll need to dig into this one again then :-)
I think the problem for me was that the the switch back using
".chip 68k" is no longer correct when compiling for ColdFire.

I'll have a closer look tomorrow when I have some time.

Thanks
Greg

------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg@snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
8 Gardner Close, FAX: +61 7 3891 3630
Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com