[Top] [All Lists]

Re: config option vs. run-time detection (the debate continues ...)

To: Jun Sun <>
Subject: Re: config option vs. run-time detection (the debate continues ...)
From: "Maciej W. Rozycki" <>
Date: Sat, 10 Feb 2001 10:01:50 +0100 (MET)
Cc: "Kevin D. Kissell" <>,
In-reply-to: <>
Organization: Technical University of Gdansk
On Fri, 9 Feb 2001, Jun Sun wrote:

>   a) an explicit config option, CONFIG_HAS_FPU, (which is not associated with
> PrID), plus "#ifdef CONFIG_HAS_FPU ..." code.  Or
>   b) have run-time detection and many "if .. then .." code.
> I listed some pro's and con's for both of them in my first email.  Right now,
> I found myself not having a strong preference but still biased towards config
> option approach ( - as if that really matters. :-0)

 Well, the number of places a run-time condition exist is small and they
are not performance-critical. 

> I actually don't understand your IDT quote.  It requires one to call mfc1 to
> get FCR0.  On many CPUs without a FPU, this will generate an exception.  Are
> you suggesting that we should catch the exception and from that we conclude
> there is no FPU present?

 I don't have an FPU-less system and I can't check such code.  I need to
depend on others (I couldn't test all possible configurations anyway).  If
we have a chance to get an exception we have to catch it, of course
(that's trivial to handle in Linux). 

+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+        e-mail:, PGP key available        +

<Prev in Thread] Current Thread [Next in Thread>