From c519c5ee2b725e6f946ffd11c862463b3391876e Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Tue, 30 May 2017 18:46:21 +1000 Subject: arch-microblaze.inc: Invert how the 'reorder' feature is used for v8.30 With Xilinx MicroBlaze v8.30 a configuration issue requires that the 'pattern-compare' feature is enable for the 'reorder' feature to be correctly functional. Previously the MicroBlaze tune setup would assume that 'pattern-compare' was available even when it may not actually be, and would force enable the 'pattern-compare' feature automatically. This behaviour is prone to issues and may emit broken binaries for a target when the user was not aware or expected that there target CPU was broken. This change inverts the behaviour such that instead of implicitly enabling the 'pattern-compare' feature it instead does not enable generation of reorder instructions for the compiler by setting '-mno-xl-reorder' in the same way as the case that the target does not have the feature enabled. Signed-off-by: Nathan Rossi --- conf/machine/include/microblaze/arch-microblaze.inc | 8 +++++++- .../machine/include/microblaze/feature-microblaze-versions.inc | 10 ---------- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'conf') diff --git a/conf/machine/include/microblaze/arch-microblaze.inc b/conf/machine/include/microblaze/arch-microblaze.inc index 9a5e685f..b01f03b6 100644 --- a/conf/machine/include/microblaze/arch-microblaze.inc +++ b/conf/machine/include/microblaze/arch-microblaze.inc @@ -23,7 +23,13 @@ TUNEVALID[reorder] = "Enable Reorder Instructions" # General feature compiler args TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "barrel-shift", "-mxl-barrel-shift", "-mno-xl-barrel-shift" ,d)}" TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "pattern-compare", "-mxl-pattern-compare", "-mno-xl-pattern-compare" ,d)}" -TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "reorder", "-mxl-reorder", "-mno-xl-reorder" ,d)}" + +# Disable reorder for v8.30 if pattern-compare is not enabled +TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "reorder", \ + bb.utils.contains("TUNE_FEATURES", "v8.30", \ + bb.utils.contains("TUNE_FEATURES", "pattern-compare", \ + "-mxl-reorder", "-mno-xl-reorder", d), \ + "-mxl-reorder", d), "-mno-xl-reorder", d)}" # General feature package architecture formatting MBPKGARCH_TUNE = "" diff --git a/conf/machine/include/microblaze/feature-microblaze-versions.inc b/conf/machine/include/microblaze/feature-microblaze-versions.inc index dcdf020d..53d0b9bf 100644 --- a/conf/machine/include/microblaze/feature-microblaze-versions.inc +++ b/conf/machine/include/microblaze/feature-microblaze-versions.inc @@ -92,13 +92,3 @@ TUNECONFLICTS[v8.20] += "reorder" TUNE_CCARGS += "-mcpu=${@microblaze_format_gcc_version(microblaze_current_version(d))}" MBPKGARCH_VERSION = "-${@microblaze_format_pkg_version(microblaze_current_version(d))}" -# Perform some additional tune feature dependency enforcement -python __anonymous () { - tunes = (d.getVar('TUNE_FEATURES') or "").split() - if len(tunes) != 0: - # For v8.30 pattern-compare is required if reorder is enabled, enforce - # this in tune features. - if 'v8.30' in tunes and 'reorder' in tunes and 'pattern-compare' not in tunes: - d.setVar("TUNE_FEATURES_append", " pattern-compare") -} - -- cgit v1.2.3-54-g00ecf