Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752176AbbHSWdw (ORCPT ); Wed, 19 Aug 2015 18:33:52 -0400 Received: from mail-ig0-f176.google.com ([209.85.213.176]:33887 "EHLO mail-ig0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751165AbbHSWdv (ORCPT ); Wed, 19 Aug 2015 18:33:51 -0400 MIME-Version: 1.0 In-Reply-To: <55D453B0.2090108@zytor.com> References: <20150814071500.GA2678@gmail.com> <20150817080143.GA16928@gmail.com> <55D25D7F.40503@zytor.com> <20150819055931.GD32338@gmail.com> <20150819065056.GB28292@gmail.com> <55D453B0.2090108@zytor.com> Date: Wed, 19 Aug 2015 15:33:50 -0700 X-Google-Sender-Auth: xGT6k90yhy5wQvmZDdBryd9oyBI Message-ID: Subject: Re: [GIT PULL] x86 fixes From: Linus Torvalds To: "H. Peter Anvin" Cc: Ingo Molnar , Juergen Gross , Andy Lutomirski , Linux Kernel Mailing List , Thomas Gleixner , Peter Zijlstra , Brian Gerst , Denys Vlasenko , Andrew Morton Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1558 Lines: 32 On Wed, Aug 19, 2015 at 3:00 AM, H. Peter Anvin wrote: > > And I bet if CPUID actually reported the right thing it probably would work > okay. As I said, I tested this under Qemu which reported an accurate (lack > of) CPUID for a 486SX. While I agree that cpuid is a problem for FPU emulation on modern CPU's, if this is due to "fucomip" then I think it's just that modern distributions (and not-so-modern ones, for that matter) are compiled with i686 support, so gcc just generates fucomip directly. So it's just "plain FPU" code (no mmx, nothing like that), but it still fails. The "set regular integer flags instructions" versions of floating point compares are some of the bigger improvements to the legacy i87 instruction set, because the sequences to do FP compares without them are just insane. I forget the details, but it's something like "store status word to ax, then use sahf to get it into the flags register". Crazy crazy crap. So it's no wonder that gcc wants to use a i686-only instruction even for just regular FP code if at all possible. I suspect it shouldn't be that hard to add f[u]compi[p] support to the emulator. But I also expect that most modern distributions are likely fairly eager to use mmx etc, which sounds like a major pain to emulate. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/