Skip to content

Commit

Permalink
Remove VERYALIGNED macro from binary translation
Browse files Browse the repository at this point in the history
  • Loading branch information
fwsGonzo committed Oct 25, 2023
1 parent c2c2394 commit 4909d7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion lib/libriscv/tr_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ typedef struct {
} CPU;
#define PUREFUNC __attribute__((pure))
#define VERYALIGNED(x) __builtin_assume_aligned(x, 32)
#define PAGENO(x) ((addr_t)(x) >> 12)
#define PAGEOFF(x) ((addr_t)(x) & 0xFFF)
Expand Down
4 changes: 2 additions & 2 deletions lib/libriscv/tr_emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ struct Emitter
}

const auto address = from_reg(reg) + " + " + from_imm(imm);
add_code("const char* " + data + " = VERYALIGNED(api.mem_ld(cpu, PAGENO(" + address + ")));");
add_code("const char* " + data + " = api.mem_ld(cpu, PAGENO(" + address + "));");
return cast + "*(" + type + "*)&" + data + "[PAGEOFF(" + address + ")]";
}
void memory_store(std::string type, int reg, int32_t imm, std::string value)
Expand All @@ -183,7 +183,7 @@ struct Emitter
}

const auto address = from_reg(reg) + " + " + from_imm(imm);
add_code("char* " + data + " = VERYALIGNED(api.mem_st(cpu, PAGENO(" + address + ")));");
add_code("char* " + data + " = api.mem_st(cpu, PAGENO(" + address + "));");
add_code(
"*(" + type + "*)&" + data + "[PAGEOFF(" + address + ")] = " + value + ";"
);
Expand Down

0 comments on commit 4909d7e

Please sign in to comment.