summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaximilian Stemmer-Grabow <mail@mxsg.de>2021-07-01 17:23:04 +0200
committerAndreas Fried <andreas.fried@kit.edu>2021-12-02 12:57:28 +0100
commit05c39447e14ad0ed63ec0dd101dfd87dc27fd7e6 (patch)
tree728cff42faf9f2b95c0982ff043d37eb2195c7e6
parent583ffded62f4c03a42f5fb409fb5946c777eff6d (diff)
Add additional notes in generated assembly with compression info
-rw-r--r--ir/be/riscv/riscv_emitter.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/ir/be/riscv/riscv_emitter.c b/ir/be/riscv/riscv_emitter.c
index 522c7e1..9fb2607 100644
--- a/ir/be/riscv/riscv_emitter.c
+++ b/ir/be/riscv/riscv_emitter.c
@@ -10,6 +10,7 @@
#include "be_t.h"
#include "bearch.h"
#include "beblocksched.h"
+#include "becopyopt_t.h"
#include "beemithlp.h"
#include "beemitter.h"
#include "begnuas.h"
@@ -338,10 +339,29 @@ static void riscv_add_compressibility_info(ir_node *const node)
struct backend_info_t *be_info = be_get_info(node);
bool compressible = riscv_is_compressible(node);
- const char* note = compressible ? "compr=true" : "compr=false";
+ const char* compressible_note = compressible ? "compr=true" : "compr=false";
+ const char* register_note = NULL;
+ const char* addr_note = NULL;
+
+ compression_req_t req = (compression_req_t)riscv_get_op_compression_requirements(node);
+
+ if (req == comp_req_register_subset || req == comp_req_2addr_register_subset) {
+ if (!riscv_is_compressible(node)) {
+ register_note = "comp_req_fail=register";
+ }
+ }
+
+ if (req == comp_req_2addr || req == comp_req_2addr_register_subset) {
+ if (!riscv_is_compressible(node)) {
+ addr_note = "comp_req_fail=address";
+ }
+ }
if (be_info) {
- be_info_add_note(node, note);
+ be_info_add_note(node, compressible_note);
+
+ if (register_note) be_info_add_note(node, register_note);
+ if (addr_note) be_info_add_note(node, addr_note);
}
}