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

Geert Uytterhoeven
2011-12-24T19:38:27Z

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...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds