From 65171e44926f8549960a7accc4692ab2955b7f7b Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sun, 25 Jan 2009 21:31:41 +0000 Subject: [PATCH] Implemented the ROTATELEFT and ROTATERIGHT intrinsics --- support/tock_intrinsics_arith.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/tock_intrinsics_arith.h b/support/tock_intrinsics_arith.h index 3bd09bc..7078da2 100644 --- a/support/tock_intrinsics_arith.h +++ b/support/tock_intrinsics_arith.h @@ -110,12 +110,12 @@ static inline INT occam_ASHIFTLEFT (INT x, INT places, const char *pos) { static inline INT occam_ROTATERIGHT (INT, INT, const char *) occam_unused; static inline INT occam_ROTATERIGHT (INT x, INT places, const char *pos) { - return 0; + return (INT)((UINT)x >> places) | (x << (CHAR_BIT*sizeof(INT) - places)); } static inline INT occam_ROTATELEFT (INT, INT, const char *) occam_unused; static inline INT occam_ROTATELEFT (INT x, INT places, const char *pos) { - return 0; + return (x << places) | (INT)((UINT)x >> (CHAR_BIT*sizeof(INT) - places)); }