From 35be567605a8b032bb42f5911f3d658d8ba83b6a Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 16 May 2017 08:50:23 +0200 Subject: [PATCH] Improve simplec back-end --- backends/simplec/simplec.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/simplec/simplec.cc b/backends/simplec/simplec.cc index 5ea35c564..c8a812748 100644 --- a/backends/simplec/simplec.cc +++ b/backends/simplec/simplec.cc @@ -235,7 +235,7 @@ struct SimplecWorker util_declarations.push_back(stringf(" else")); util_declarations.push_back(stringf(" sig->%s &= ~(1UL << %d);", value_name.c_str(), word_offset)); #else - util_declarations.push_back(stringf(" sig->%s = (sig->%s | (uint%d_t)(value & 1) << %d) & ~((uint%d_t)((value & 1) ^ 1) << %d);", + util_declarations.push_back(stringf(" sig->%s = (sig->%s & ~((uint%d_t)1 << %d)) | ((uint%d_t)value << %d);", value_name.c_str(), value_name.c_str(), max_uintsize, word_offset, max_uintsize, word_offset)); #endif -- 2.30.2