Skip to content

Commit a4b4735

Browse files
committed
applies clang-format
1 parent ce87cb3 commit a4b4735

2 files changed

Lines changed: 20 additions & 23 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if(NOT TARGET dbt-rise-core)
4444
FetchContent_Declare(
4545
dbt_rise_core_git
4646
GIT_REPOSITORY "https://github.com/Minres/DBT-RISE-Core.git"
47-
GIT_TAG ab939b51
47+
GIT_TAG 7cd010c
4848
GIT_SHALLOW OFF
4949
UPDATE_DISCONNECTED NOT ${UPDATE_EXTERNAL_PROJECT} # When enabled, this option causes the update step to be skipped.
5050
)

src/decoder_test.cpp

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
#include <iss/instruction_decoder.h>
2-
#include <vector>
31
#include <array>
42
#include <fstream>
3+
#include <iss/instruction_decoder.h>
4+
#include <vector>
55

66
enum class opcode_e {
7-
C__LBU = 116,
8-
C__LHU = 117,
9-
C__LH = 118,
10-
C__SB = 119,
11-
C__SH = 120,
7+
C__LBU = 116,
8+
C__LHU = 117,
9+
C__LH = 118,
10+
C__SB = 119,
11+
C__SH = 120,
1212

1313
};
1414
struct instruction_descriptor {
@@ -18,29 +18,26 @@ struct instruction_descriptor {
1818
opcode_e op;
1919
};
2020

21-
22-
const std::array<instruction_descriptor, 2> instr_descr = {{
23-
//{16, 0b1000000000000000, 0b1111110000000011, opcode_e::C__LBU},
24-
{16, 0b1000010000000000, 0b1111110001000011, opcode_e::C__LHU},
25-
{16, 0b1000010001000000, 0b1111110001000011, opcode_e::C__LH}
26-
}};
21+
const std::array<instruction_descriptor, 2> instr_descr = {{//{16, 0b1000000000000000, 0b1111110000000011, opcode_e::C__LBU},
22+
{16, 0b1000010000000000, 0b1111110001000011, opcode_e::C__LHU},
23+
{16, 0b1000010001000000, 0b1111110001000011, opcode_e::C__LH}}};
2724

2825
int main(int argc, char* argv[]) {
2926
iss::decoder instr_decoder([]() {
30-
std::vector<iss::generic_instruction_descriptor> g_instr_descr;
31-
g_instr_descr.reserve(instr_descr.size());
32-
for (uint32_t i = 0; i < instr_descr.size(); ++i) {
33-
iss::generic_instruction_descriptor new_instr_descr {instr_descr[i].value, instr_descr[i].mask, i};
34-
g_instr_descr.push_back(new_instr_descr);
27+
std::vector<iss::generic_instruction_descriptor> g_instr_descr;
28+
g_instr_descr.reserve(instr_descr.size());
29+
for(uint32_t i = 0; i < instr_descr.size(); ++i) {
30+
iss::generic_instruction_descriptor new_instr_descr{instr_descr[i].value, instr_descr[i].mask, i};
31+
g_instr_descr.push_back(new_instr_descr);
3532
}
36-
return std::move(g_instr_descr);
37-
}());
33+
return std::move(g_instr_descr);
34+
}());
3835

3936
std::ofstream json_out{"idecode_tree.json"};
40-
json_out<<instr_decoder.print_tree_as_pretty_json();
37+
json_out << instr_decoder.print_tree_as_pretty_json();
4138

4239
auto inst_index1 = instr_decoder.decode_instr(0x8440);
4340
auto inst_index2 = instr_decoder.decode_instr(0x86b0);
4441

45-
return inst_index1==inst_index2?0:1;
42+
return inst_index1 == inst_index2 ? 0 : 1;
4643
}

0 commit comments

Comments
 (0)