rules_cc_toolchain icon indicating copy to clipboard operation
rules_cc_toolchain copied to clipboard

The thumbv7e-m can combine both soft floating point and hard floating point, this should be represented in configs

Open nathaniel-brough opened this issue 4 years ago • 0 comments

The thumbv7e-m, AKA Cortex-M7 device can implement both hard and soft floating-point instructions at the same time. For example, a processor might only implement the single-precision floating-point instructions in hardware required soft floating point libraries to complete double-precision floating-point math.

This is an edge case where Bazel's platform API does not map nicely to the real world. i.e. for a;

constraint_setting(
  name = "fpu",
)

#  Has both single and double precision instructions. Can be implemented entirely in hardware.
constraint_value(
  name = "fpv5_d16",
  constraint_setting = ":fpu",
)

# Has only single precision instructions, double precision math must be implemented in software.
constraint_value(
  name = "fpv5_sp_d16",
  constraint_setting = ":fpu",
)

# Implements floating point math entirely in software.
constraint_value(
  name = "softfp",
  constraint_setting = ":fpu",
)

There can only ever be one constraint_value assigned to that setting at any one time, this means that you cannot enable both hard/soft floating point settings at the same time.

nathaniel-brough avatar Dec 08 '21 03:12 nathaniel-brough