On 27/2/23 06:41, Richard Henderson wrote:
Use proper enumeration types for input and output.
Use a const array to perform the mapping, with an
assert that the input is valid.

Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
  target/arm/internals.h     | 12 +++++++++---
  target/arm/translate-mve.c |  2 +-
  target/arm/vfp_helper.c    | 33 ++++++++-------------------------
  3 files changed, 18 insertions(+), 29 deletions(-)


+extern const FloatRoundMode arm_rmode_to_sf_map[6];
+
+static inline FloatRoundMode arm_rmode_to_sf(ARMFPRounding rmode)
+{
+    assert((unsigned)rmode < ARRAY_SIZE(arm_rmode_to_sf_map));
+    return arm_rmode_to_sf_map[rmode];
+}

Is the inlining justified?

Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>


Reply via email to