From 31a59c8825650f801a6e549b0215da835386b243 Mon Sep 17 00:00:00 2001 From: Sipke Vriend Date: Thu, 23 May 2013 08:18:02 +1000 Subject: microblaze: Set FPU_TARGET and add sanity checking Set bitbake 'known' FPU_TARGET to reflect soft-fpu or hard-fpu Sanity check: add pattern-compare if reorder only exists in v8.30. Signed-off-by: Sipke Vriend --- .../include/microblaze/feature-microblaze-fpu.inc | 6 ++++-- .../include/microblaze/feature-microblaze-v8.inc | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/conf/machine/include/microblaze/feature-microblaze-fpu.inc b/conf/machine/include/microblaze/feature-microblaze-fpu.inc index 07f9ba93..bf2fe38b 100644 --- a/conf/machine/include/microblaze/feature-microblaze-fpu.inc +++ b/conf/machine/include/microblaze/feature-microblaze-fpu.inc @@ -1,5 +1,3 @@ -TARGET_FPU = "fpu-other" - TUNEVALID[fpu-soft] = "Use Microblaze software FPU" TUNEVALID[fpu-hard] = "Enable Microblaze hardware FPU in basic mode." TUNEVALID[fpu-hard-extended] = "Enable Microblaze hardware FPU in extended mode - conversion and square root instructions." @@ -11,5 +9,9 @@ MBCCARGSFPU = "${@bb.utils.contains("TUNE_FEATURES", "fpu-hard-extended", "-mhar MBPKGFPU_BASIC = "${@bb.utils.contains("TUNE_FEATURES", "fpu-hard", "-fb", "", d)}" MBPKGFPU = "${@bb.utils.contains("TUNE_FEATURES", "fpu-hard-extended", "-fe", "${MBPKGFPU_BASIC}", d)}" +# Set target fpu (bitbake known target) to soft or hard (basic or extended in microblaze language) +TARGETFPU_BASIC = "${@bb.utils.contains("TUNE_FEATURES", "fpu-hard", "fpu-hard", "fpu-soft", d)}" +TARGET_FPU = "${@bb.utils.contains("TUNE_FEATURES", "fpu-hard-extended", "fpu-hard", "${TARGETFPU_BASIC}", d)}" + TUNECONFLICTS[fpu-hard] = "fpu-soft" TUNECONFLICTS[fpu-hard-extended] = "fpu-soft" diff --git a/conf/machine/include/microblaze/feature-microblaze-v8.inc b/conf/machine/include/microblaze/feature-microblaze-v8.inc index 21b54c0f..46a11cfd 100644 --- a/conf/machine/include/microblaze/feature-microblaze-v8.inc +++ b/conf/machine/include/microblaze/feature-microblaze-v8.inc @@ -22,3 +22,24 @@ MBPKGVERSION .= "${@bb.utils.contains("TUNE_FEATURES", "v8.10", "-v8.10", "" ,d) TUNEVALID[v8.00] = "Use Microblaze version 8.00" MBCCARGSVERSION += "${@bb.utils.contains("TUNE_FEATURES", "v8.00", "-mcpu=v8.00.a", "" ,d)}" MBPKGVERSION .= "${@bb.utils.contains("TUNE_FEATURES", "v8.00", "-v8.00", "" ,d)}" + +TUNECONFLICTS[v8.00] += "reorder" +TUNECONFLICTS[v8.10] += "reorder" +TUNECONFLICTS[v8.20] += "reorder" + +# Perform some additional sanity checking +python __anonymous () { + import bb + tune_features = bb.data.getVar('TUNE_FEATURES', d, 1) + tuneslist = tune_features.split() + + # + # GCC will fail on v8.30 if reorder and pattern-compare are not + # both in ccflags + # -mxl-reorder requires -mxl-pattern-compare for -mcpu=v8.30.a + # Check if either one exists alone and if so, add the other + # + if 'v8.30' in tuneslist: + if 'reorder' in tuneslist and 'pattern-compare' not in tuneslist: + d.setVar("TUNE_FEATURES", "%s pattern-compare" % tune_features) +} -- cgit v1.2.3-54-g00ecf