From af3b65b1357dd3463584e6a3da71fc4838c631e7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 10 May 2020 20:45:56 -0400 Subject: [PATCH] decoder_detail: Mark GetMaskAndExpect() as constexpr Elides quite a bit of code at runtime when constructing the decoding tables. --- src/frontend/decoder/decoder_detail.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/decoder/decoder_detail.h b/src/frontend/decoder/decoder_detail.h index 5daf7eed..b5eff901 100644 --- a/src/frontend/decoder/decoder_detail.h +++ b/src/frontend/decoder/decoder_detail.h @@ -35,7 +35,7 @@ private: * A '0' in a bitstring indicates that a zero must be present at that bit position. * A '1' in a bitstring indicates that a one must be present at that bit position. */ - static auto GetMaskAndExpect(const char* const bitstring) { + static constexpr auto GetMaskAndExpect(const char* const bitstring) { const auto one = static_cast(1); opcode_type mask = 0, expect = 0; for (size_t i = 0; i < opcode_bitsize; i++) {