Add 'x87' in x86 target feature map
Details
Diff Detail
Event Timeline
lib/Basic/Targets.cpp | ||
---|---|---|
2597–2598 | i386 doesn't necessarily have x87, does it? IIRC the floating point co-processor is only guaranteed to be available in the 486 DX and later. |
Hello Richard,
Thank for the review.
lib/Basic/Targets.cpp | ||
---|---|---|
2597–2598 | You are right. Fixed. |
Are there any of the intrinsics in the headers that also depend on x87?
One inline comment.
-eric
lib/Basic/Targets.cpp | ||
---|---|---|
2597–2598 | Mind only doing getCPUKind once here? :) |
Are there any of the intrinsics in the headers that also depend on x87?
Not that I could find.
lib/Basic/Targets.cpp | ||
---|---|---|
2600–2601 | Done. |
lib/Basic/Targets.cpp | ||
---|---|---|
2603 | What about CK_Generic? Also, if CK_i486 can be used for the 486SX, we need to exclude it here too. It looks (from wikipedia) like all the "WinChip" flavours of 486 have an x87 unit, but it'd be nice if someone could confirm that. Maybe we should have separate CPUKinds for 486 SX versus 486 DX. |
lib/Basic/Targets.cpp | ||
---|---|---|
2603 | Before this changeset clang would generate x87 instructions for Generic, i386 and i486. So one can say they had FeatureX87 enabled implicitly. If that was ok formerly why do we want to change that now? Wouldn't it be better to keep clang's behavior unchanged? |
lib/Basic/Targets.cpp | ||
---|---|---|
2603 | OK, if this means "x87 instructions probably work" (although they may be emulated in software) and not "x87 instructions definitely work", then we shouldn't be checking the CPU kind here at all. It looks like the former is how GCC handles this; it has -mno-80387 to specify that we're building for an i386 with no support for x87 instructions. Should we handle that flag? |
lib/Basic/Targets.cpp | ||
---|---|---|
2603 | "x87 instructions probably work" is more like it, and having feature x87 disabled would mean "x87 instructions definitely don't work". That's what I intended. If feature soft float is specified it takes precedence over feature x87 causing compiler to generate calls instead of X87 instructions. |
Hi,
The related LLVM patch (http://reviews.llvm.org/D13979) was approved. Is this patch ok for commit?
Can you add an explicit test for soft/hard-float.
One inline comment as well, waiting on Richard to pipe up.
-eric
lib/Basic/Targets.cpp | ||
---|---|---|
2603 | Waiting for rsmith to comment here. |
lib/Basic/Targets.cpp | ||
---|---|---|
2603 | This seems fine to me. |
i386 doesn't necessarily have x87, does it? IIRC the floating point co-processor is only guaranteed to be available in the 486 DX and later.