|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH 03/70] target/arm: Improve arm_rmode_to_sf |
Date: | Mon, 6 Mar 2023 15:00:57 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 |
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.henderson@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é <philmd@linaro.org>
[Prev in Thread] | Current Thread | [Next in Thread] |