target/loongarch: Add CHECK_SXE maccro for check LSX enable

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20230504122810.4094787-4-gaosong@loongson.cn>
This commit is contained in:
Song Gao 2023-05-04 20:27:29 +08:00
parent a0c9400a5b
commit a3f3db5cda
No known key found for this signature in database
GPG key ID: 40A2FFF239263EDF
3 changed files with 15 additions and 0 deletions

View file

@ -3,3 +3,14 @@
* LSX translate functions
* Copyright (c) 2022-2023 Loongson Technology Corporation Limited
*/
#ifndef CONFIG_USER_ONLY
#define CHECK_SXE do { \
if ((ctx->base.tb->flags & HW_FLAGS_EUEN_SXE) == 0) { \
generate_exception(ctx, EXCCODE_SXD); \
return true; \
} \
} while (0)
#else
#define CHECK_SXE
#endif