diff --git a/stf-inc/stf_branch.hpp b/stf-inc/stf_branch.hpp index 96dea1c..176149d 100644 --- a/stf-inc/stf_branch.hpp +++ b/stf-inc/stf_branch.hpp @@ -114,6 +114,7 @@ namespace stf { uint64_t rs1_value_ = 0; uint64_t rs2_value_ = 0; uint64_t rd_value_ = 0; + bool compressed_ = false; bool taken_ = false; bool conditional_ = false; bool call_ = false; @@ -164,6 +165,7 @@ namespace stf { rs1_value_ = 0; rs2_value_ = 0; rd_value_ = 0; + compressed_ = false; taken_ = false; conditional_ = false; call_ = false; @@ -224,6 +226,7 @@ namespace stf { const Registers::STF_REG rs1, const Registers::STF_REG rs2, const Registers::STF_REG rd, + const bool compressed, const bool is_conditional, const bool is_call, const bool is_return, @@ -245,6 +248,7 @@ namespace stf { rs1_ = rs1; rs2_ = rs2; rd_ = rd; + compressed_ = compressed; conditional_ = is_conditional; call_ = is_call; return_ = is_return; @@ -331,6 +335,13 @@ namespace stf { return target_opcode_; } + /** + * Gets whether the branch is compressed + */ + inline bool isCompressed() const { + return compressed_; + } + /** * Gets whether the branch is an indirect */ @@ -513,6 +524,7 @@ namespace stf { const Registers::STF_REG rs1, const Registers::STF_REG rs2, const Registers::STF_REG rd, + const bool compressed, const bool is_conditional, const bool is_call, const bool is_return, @@ -530,6 +542,7 @@ namespace stf { rs1, rs2, rd, + compressed, is_conditional, is_call, is_return, diff --git a/stf-inc/stf_branch_decoder.hpp b/stf-inc/stf_branch_decoder.hpp index dcf4a0e..c80f241 100644 --- a/stf-inc/stf_branch_decoder.hpp +++ b/stf-inc/stf_branch_decoder.hpp @@ -332,6 +332,7 @@ namespace stf { Registers::STF_REG& rs1, Registers::STF_REG& rs2, Registers::STF_REG& rd, + bool& compressed, bool& is_conditional, bool& is_call, bool& is_return, @@ -343,6 +344,7 @@ namespace stf { bool& compare_greater_than_or_equal, bool& compare_less_than, bool& compare_unsigned) { + compressed = true; return decodeBranch16_(iem, rec.getPC(), rec.getOpcode(), @@ -390,6 +392,7 @@ namespace stf { Registers::STF_REG& rs1, Registers::STF_REG& rs2, Registers::STF_REG& rd, + bool& compressed, bool& is_conditional, bool& is_call, bool& is_return, @@ -401,6 +404,7 @@ namespace stf { bool& compare_greater_than_or_equal, bool& compare_less_than, bool& compare_unsigned) { + compressed = false; return decodeBranch32_(rec.getPC(), rec.getOpcode(), target, @@ -449,6 +453,7 @@ namespace stf { Registers::STF_REG& rs1, Registers::STF_REG& rs2, Registers::STF_REG& rd, + bool& compressed, bool& is_conditional, bool& is_call, bool& is_return, @@ -466,6 +471,7 @@ namespace stf { rs1, rs2, rd, + compressed, is_conditional, is_call, is_return, @@ -495,6 +501,7 @@ namespace stf { Registers::STF_REG rs1; Registers::STF_REG rs2; Registers::STF_REG rd; + bool compressed = false; bool is_conditional = false; bool is_call = false; bool is_return = false; @@ -513,6 +520,7 @@ namespace stf { rs1, rs2, rd, + compressed, is_conditional, is_call, is_return, @@ -534,6 +542,7 @@ namespace stf { rs1, rs2, rd, + compressed, is_conditional, is_call, is_return, @@ -562,6 +571,7 @@ namespace stf { Registers::STF_REG rs1 = Registers::STF_REG::STF_REG_INVALID; Registers::STF_REG rs2 = Registers::STF_REG::STF_REG_INVALID; Registers::STF_REG rd = Registers::STF_REG::STF_REG_INVALID; + bool compressed = false; bool is_conditional = false; bool is_call = false; bool is_return = false; @@ -580,6 +590,7 @@ namespace stf { rs1, rs2, rd, + compressed, is_conditional, is_call, is_return, diff --git a/stfpy/CMakeLists.txt b/stfpy/CMakeLists.txt index 493796a..3516170 100644 --- a/stfpy/CMakeLists.txt +++ b/stfpy/CMakeLists.txt @@ -7,7 +7,7 @@ include_directories(${STF_BASE}/stf-inc) add_compile_options(-Wno-sign-conversion -Wno-deprecated-declarations -Wno-deprecated-copy -Wno-implicit-int-conversion -Wno-missing-field-initializers) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wno-ignored-optimization-argument -Wno-unknown-warning-option) + add_compile_options(-Wno-ignored-optimization-argument -Wno-unknown-warning-option -Wno-gnu-anonymous-struct -Wno-nested-anon-types) add_link_options(-Wno-unused-command-line-argument -Wno-ignored-optimization-argument) endif()