Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | # This include describes the math features (integer and floating point) that |
| 2 | # are available for the MicroBlaze ISA |
| 3 | |
| 4 | TUNEVALID[multiply-low] = "Hardware multipler with 32 bit result" |
| 5 | TUNEVALID[multiply-high] = "Hardware multipler with 64 bit result" |
| 6 | TUNEVALID[divide-hard] = "Hardware divider" |
| 7 | TUNEVALID[fpu-soft] = "Software FPU" |
| 8 | TUNEVALID[fpu-hard] = "Hardware FPU in basic mode" |
| 9 | TUNEVALID[fpu-hard-extended] = "Hardware FPU in extended mode (conversion and square root instructions)" |
| 10 | |
| 11 | TUNECONFLICTS[fpu-soft] = "fpu-hard fpu-hard-extended" |
| 12 | TUNECONFLICTS[fpu-hard] = "fpu-soft" |
| 13 | TUNECONFLICTS[fpu-hard-extended] = "fpu-soft" |
| 14 | |
| 15 | # Compiler args |
| 16 | TUNE_CCARGS += "${@bb.utils.contains_any('TUNE_FEATURES', ['multiply-low', 'multiply-high'], '-mno-xl-soft-mul', '-mxl-soft-mul', d)}" |
| 17 | TUNE_CCARGS += "${@bb.utils.contains('TUNE_FEATURES', 'multiply-high', '-mxl-multiply-high', '', d)}" |
| 18 | |
| 19 | TUNE_CCARGS += "${@bb.utils.contains('TUNE_FEATURES', 'divide-hard', '-mno-xl-soft-div', '-mxl-soft-div', d)}" |
| 20 | |
| 21 | TUNE_CCARGS += "${@bb.utils.contains('TUNE_FEATURES', 'fpu-soft', '', '', d)}" |
| 22 | TUNE_CCARGS += "${@bb.utils.contains_any('TUNE_FEATURES', ['fpu-hard', 'fpu-hard-extended'], '-mhard-float', '', d)}" |
| 23 | TUNE_CCARGS += "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard-extended', '-mxl-float-convert -mxl-float-sqrt', '', d)}" |
| 24 | |
| 25 | # Set target fpu (bitbake known target) to soft or hard (basic or extended) |
| 26 | TARGET_FPU = "${@bb.utils.contains_any('TUNE_FEATURES', 'fpu-hard fpu-hard-extended', 'fpu-hard', 'fpu-soft', d)}" |
| 27 | |
| 28 | # Package Architecture formatting |
| 29 | MBPKGARCH_MATH = "" |
| 30 | MBPKGARCH_MATH .= "${@bb.utils.contains('TUNE_FEATURES', 'multiply-high', '-mh', bb.utils.contains('TUNE_FEATURES', 'multiply-low', '-ml', '', d), d)}" |
| 31 | MBPKGARCH_MATH .= "${@bb.utils.contains('TUNE_FEATURES', 'divide-hard', '-div', '', d)}" |
| 32 | MBPKGARCH_MATH .= "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard-extended', '-fe', bb.utils.contains('TUNE_FEATURES', 'fpu-hard', '-fb', '', d), d)}" |
| 33 | |