libsvp64: support operands flags
authorDmitry Selyutin <ghostmansd@gmail.com>
Thu, 7 Sep 2023 19:05:51 +0000 (22:05 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 10 Sep 2023 20:29:53 +0000 (23:29 +0300)
src/libsvp64/codegen.py
src/libsvp64/svp64.h

index ff80119d7ed34d60a9e06b36a60dcbafc9de6473..0880742c9a98467241fddab280b2869edca249f9 100644 (file)
@@ -234,6 +234,7 @@ class DisGenSource(Source):
         self.emit("svp64_disassemble_operand(struct svp64_ctx *ctx, uint32_t insn, size_t id) {")
         with self:
             self.emit("uint32_t value;")
+            self.emit("uint32_t flags;")
             self.emit("")
             self.emit(f"switch (ctx->record->operands[id]) {{")
             yield node
@@ -244,6 +245,7 @@ class DisGenSource(Source):
         self.emit("")
         with self:
             self.emit("ctx->operands[id].value = value;")
+            self.emit("ctx->operands[id].flags = flags;")
             self.emit("")
             self.emit("return SVP64_SUCCESS;")
         self.emit("}")
@@ -277,6 +279,7 @@ class DisGenSource(Source):
             with self:
                 yield from fetch(span)
             yield f");"
+            yield "flags = UINT32_C(0);"
             self.emit("break;")
 
         def signed_handler(span):
@@ -295,6 +298,7 @@ class DisGenSource(Source):
                 yield "-"
                 yield f"{mask}"
             yield ");"
+            yield "flags = SVP64_OPERAND_SIGNED;"
             self.emit("break;")
 
         handlers = {
index 5949e179671efc4edf150553ad4668fb51c1f23a..e2e5776d8207bec38a19792ec23a931b66841826 100644 (file)
@@ -29,8 +29,11 @@ struct svp64_record {
 
 struct svp64_operand {
     uint32_t value;
+    uint32_t flags;
 };
 
+#define SVP64_OPERAND_SIGNED    (UINT32_C(1) << UINT32_C(0))
+
 struct svp64_ctx {
     struct svp64_record const *record;
     struct svp64_operand operands[8];