diff mbox

[3/3] target-unicore32: mark a few helpers const + pure

Message ID 1302647466-22448-3-git-send-email-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno April 12, 2011, 10:31 p.m. UTC
Helpers that do not trigger exceptions and do only access to the arguments
can be declared as const + pure.

Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-unicore32/helper.h |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

Comments

Guan Xuetao April 13, 2011, 6:03 a.m. UTC | #1
Applied, thanks.
Tested-and-Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>

Guan

> -----Original Message-----
> From: Aurelien Jarno [mailto:aurelien@aurel32.net]
> Sent: Wednesday, April 13, 2011 6:31 AM
> To: qemu-devel@nongnu.org
> Cc: Aurelien Jarno; Guan Xuetao
> Subject: [PATCH 3/3] target-unicore32: mark a few helpers const + pure
> 
> Helpers that do not trigger exceptions and do only access to the arguments
> can be declared as const + pure.
> 
> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
>  target-unicore32/helper.h |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/target-unicore32/helper.h b/target-unicore32/helper.h
> index 1e45302..4f8b5d7 100644
> --- a/target-unicore32/helper.h
> +++ b/target-unicore32/helper.h
> @@ -29,9 +29,9 @@ DEF_HELPER_2(adc_cc, i32, i32, i32)
>  DEF_HELPER_2(sub_cc, i32, i32, i32)
>  DEF_HELPER_2(sbc_cc, i32, i32, i32)
> 
> -DEF_HELPER_2(shl, i32, i32, i32)
> -DEF_HELPER_2(shr, i32, i32, i32)
> -DEF_HELPER_2(sar, i32, i32, i32)
> +DEF_HELPER_FLAGS_2(shl, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
> +DEF_HELPER_FLAGS_2(shr, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
> +DEF_HELPER_FLAGS_2(sar, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
>  DEF_HELPER_2(shl_cc, i32, i32, i32)
>  DEF_HELPER_2(shr_cc, i32, i32, i32)
>  DEF_HELPER_2(sar_cc, i32, i32, i32)
> @@ -51,10 +51,10 @@ DEF_HELPER_2(ucf64_muls, f32, f32, f32)
>  DEF_HELPER_2(ucf64_muld, f64, f64, f64)
>  DEF_HELPER_2(ucf64_divs, f32, f32, f32)
>  DEF_HELPER_2(ucf64_divd, f64, f64, f64)
> -DEF_HELPER_1(ucf64_negs, f32, f32)
> -DEF_HELPER_1(ucf64_negd, f64, f64)
> -DEF_HELPER_1(ucf64_abss, f32, f32)
> -DEF_HELPER_1(ucf64_absd, f64, f64)
> +DEF_HELPER_FLAGS_1(ucf64_negs, TCG_CALL_CONST | TCG_CALL_PURE, f32, f32)
> +DEF_HELPER_FLAGS_1(ucf64_negd, TCG_CALL_CONST | TCG_CALL_PURE, f64, f64)
> +DEF_HELPER_FLAGS_1(ucf64_abss, TCG_CALL_CONST | TCG_CALL_PURE, f32, f32)
> +DEF_HELPER_FLAGS_1(ucf64_absd, TCG_CALL_CONST | TCG_CALL_PURE, f64, f64)
>  DEF_HELPER_3(ucf64_cmps, void, f32, f32, i32)
>  DEF_HELPER_3(ucf64_cmpd, void, f64, f64, i32)
> 
> --
> 1.7.2.3
diff mbox

Patch

diff --git a/target-unicore32/helper.h b/target-unicore32/helper.h
index 1e45302..4f8b5d7 100644
--- a/target-unicore32/helper.h
+++ b/target-unicore32/helper.h
@@ -29,9 +29,9 @@  DEF_HELPER_2(adc_cc, i32, i32, i32)
 DEF_HELPER_2(sub_cc, i32, i32, i32)
 DEF_HELPER_2(sbc_cc, i32, i32, i32)
 
-DEF_HELPER_2(shl, i32, i32, i32)
-DEF_HELPER_2(shr, i32, i32, i32)
-DEF_HELPER_2(sar, i32, i32, i32)
+DEF_HELPER_FLAGS_2(shl, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+DEF_HELPER_FLAGS_2(shr, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+DEF_HELPER_FLAGS_2(sar, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
 DEF_HELPER_2(shl_cc, i32, i32, i32)
 DEF_HELPER_2(shr_cc, i32, i32, i32)
 DEF_HELPER_2(sar_cc, i32, i32, i32)
@@ -51,10 +51,10 @@  DEF_HELPER_2(ucf64_muls, f32, f32, f32)
 DEF_HELPER_2(ucf64_muld, f64, f64, f64)
 DEF_HELPER_2(ucf64_divs, f32, f32, f32)
 DEF_HELPER_2(ucf64_divd, f64, f64, f64)
-DEF_HELPER_1(ucf64_negs, f32, f32)
-DEF_HELPER_1(ucf64_negd, f64, f64)
-DEF_HELPER_1(ucf64_abss, f32, f32)
-DEF_HELPER_1(ucf64_absd, f64, f64)
+DEF_HELPER_FLAGS_1(ucf64_negs, TCG_CALL_CONST | TCG_CALL_PURE, f32, f32)
+DEF_HELPER_FLAGS_1(ucf64_negd, TCG_CALL_CONST | TCG_CALL_PURE, f64, f64)
+DEF_HELPER_FLAGS_1(ucf64_abss, TCG_CALL_CONST | TCG_CALL_PURE, f32, f32)
+DEF_HELPER_FLAGS_1(ucf64_absd, TCG_CALL_CONST | TCG_CALL_PURE, f64, f64)
 DEF_HELPER_3(ucf64_cmps, void, f32, f32, i32)
 DEF_HELPER_3(ucf64_cmpd, void, f64, f64, i32)