poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[COMMITTED] libpoke: decouple pvm_val offset from the quality of being m


From: Jose E. Marchesi
Subject: [COMMITTED] libpoke: decouple pvm_val offset from the quality of being mapped
Date: Wed, 11 Nov 2020 10:45:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

2020-11-11  Jose E. Marchesi  <jemarch@gnu.org>

        * libpoke/pvm.jitter (mm,map,unmap): New instructions.
        * libpoke/pkl-insn.def: Entries for new instructions.
        * libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Likewise.
        (pkl_gen_ps_op_unmap): Use the new unmap instruction.
        (pkl_gen_ps_op_attr): Use `mm' to determine
        whether a value is mapped or not.
        * libpoke/pkl-asm.pks (remap): Use mm instead of mgetm.
        (atrim): Likewise.
        (write) Likewise.
        * libpoke/pkl-gen.pks (array_mapper): Map the new value.
        (array_valmapper): Likewise.
        (struct_mapper): Likewise.
        (array_constructor): Set bit-offset of the constructed array.
        (struct_constructor): Likewise.
        (struct_field_inserter): Adapt to the fact mgeto can't return null
        any longer.
        (op_unmap): Delete macro.
        * libpoke/pvm-val.c (pvm_make_array): Make new arrays unmapped by
        default.
        (pvm_make_struct): Likewise for structs.
        (pvm_print_val_1): Print element offsets in
        mapped arrays and structs.
        * libpoke/pvm-val.h (PVM_VAL_ARR_MAPPED_P): Define.
        (struct pvm_array): New field `mapped_p'.
        (PVM_VAL_SCT_MAPPED_P): Define.
        (struct pvm_struct): New field `mapped_p'.
        (PVM_VAL_MAPPED_P): Define.
        (PVM_VAL_SET_MAPPED_P): Likewise.
        * testsuite/poke.cmd/set-omaps-1.pk: Adapt.
---
 ChangeLog                         | 32 +++++++++++++++++++++
 libpoke/pkl-asm.pks               | 17 +++++++----
 libpoke/pkl-gen.c                 | 27 ++++++++++--------
 libpoke/pkl-gen.pks               | 29 ++++++-------------
 libpoke/pkl-insn.def              |  5 ++++
 libpoke/pvm-val.c                 | 26 +++++++++++++++--
 libpoke/pvm-val.h                 | 31 ++++++++++++++++++--
 libpoke/pvm.jitter                | 47 +++++++++++++++++++++++++++++++
 testsuite/poke.cmd/set-omaps-1.pk |  2 +-
 9 files changed, 173 insertions(+), 43 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d1be36cc..0e2560ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+2020-11-11  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * libpoke/pvm.jitter (mm,map,unmap): New instructions.
+       * libpoke/pkl-insn.def: Entries for new instructions.
+       * libpoke/pkl-gen.c (pkl_gen_pr_ass_stmt): Likewise.
+       (pkl_gen_ps_op_unmap): Use the new unmap instruction.
+       (pkl_gen_ps_op_attr): Use `mm' to determine
+       whether a value is mapped or not.
+       * libpoke/pkl-asm.pks (remap): Use mm instead of mgetm.
+       (atrim): Likewise.
+       (write) Likewise.
+       * libpoke/pkl-gen.pks (array_mapper): Map the new value.
+       (array_valmapper): Likewise.
+       (struct_mapper): Likewise.
+       (array_constructor): Set bit-offset of the constructed array.
+       (struct_constructor): Likewise.
+       (struct_field_inserter): Adapt to the fact mgeto can't return null
+       any longer.
+       (op_unmap): Delete macro.
+       * libpoke/pvm-val.c (pvm_make_array): Make new arrays unmapped by
+       default.
+       (pvm_make_struct): Likewise for structs.
+       (pvm_print_val_1): Print element offsets in
+       mapped arrays and structs.
+       * libpoke/pvm-val.h (PVM_VAL_ARR_MAPPED_P): Define.
+       (struct pvm_array): New field `mapped_p'.
+       (PVM_VAL_SCT_MAPPED_P): Define.
+       (struct pvm_struct): New field `mapped_p'.
+       (PVM_VAL_MAPPED_P): Define.
+       (PVM_VAL_SET_MAPPED_P): Likewise.
+       * testsuite/poke.cmd/set-omaps-1.pk: Adapt.
+
 2020-11-11  Jose E. Marchesi  <jemarch@gnu.org>
 
        * libpoke/pvm.jitter (mktyv): New instruction.
diff --git a/libpoke/pkl-asm.pks b/libpoke/pkl-asm.pks
index 40473cd5..003697c6 100644
--- a/libpoke/pkl-asm.pks
+++ b/libpoke/pkl-asm.pks
@@ -39,9 +39,9 @@
 ;;; implementation of the PKL_INSN_REMAP macro-instruction.
 
         .macro remap
-        ;; The re-map should be done only if the value has a mapper.
-        mgetm                   ; VAL MCLS
-        bn .label               ; VAL MCLS
+        ;; The re-map should be done only if the value is mapped.
+        mm                      ; VAL MAPPED_P
+        bzi .label              ; VAL MAPPED_P
         drop                    ; VAL
         ;; XXX do not re-map if the object is up to date (cached
         ;; value.)
@@ -78,6 +78,9 @@
         .macro write
         dup                     ; VAL VAL
         ;; The write should be done only if the value is mapped.
+        mm                      ; VAL VAL MAPPED_P
+        bzi .label
+        drop                    ; VAL VAL
         mgetw                   ; VAL VAL WCLS
         bn .label
         call                    ; VAL null
@@ -470,9 +473,11 @@
         ;; bounded by number of elements, regardless of the
         ;; characteristics of the mapping of the trimmed array.
         pushvar $array          ; TARR ARR
-        mgeto                   ; TARR ARR BOFFSET
-        bn .notmapped
+        mm                      ; TARR ARR MAPPED_P
+        bzi .notmapped
+        drop                    ; TARR ARR
         ;; Calculate the new offset.
+        mgeto                   ; TARR ARR BOFFSET
         swap                    ; TARR BOFFSET ARR
         pushvar $from           ; TARR BOFFSET ARR FROM
         arefo                   ; TARR BOFFSET ARR FROM BOFF(FROM)
@@ -509,6 +514,8 @@
         msetm                   ; BOFFSET TARR
         swap                    ; TARR BOFFSET
         mseto                   ; TARR
+        ;; Mark the new array as mapped.
+        map                     ; TARR
         ;; Remap!!
         remap
         push null
diff --git a/libpoke/pkl-gen.c b/libpoke/pkl-gen.c
index 93dcde77..37a26511 100644
--- a/libpoke/pkl-gen.c
+++ b/libpoke/pkl-gen.c
@@ -675,8 +675,8 @@ PKL_PHASE_BEGIN_HANDLER (pkl_gen_pr_ass_stmt)
         /* If VAL is not mapped, skip the mapval.  */
         pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_PUSHR, 0);  /* LVALUE IDX VAL EXP 
*/
         pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_SWAP);      /* LVALUE IDX EXP VAL 
*/
-        pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_MGETM);     /* LVALUE IDX EXP VAL 
MCLS */
-        pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_BN, label); /* LVALUE IDX EXP VAL 
MCLS */
+        pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_MM);        /* LVALUE IDX EXP VAL 
MAPPED_P */
+        pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_BZI, label); /* LVALUE IDX EXP VAL 
MAPPED_P */
         pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_DROP);      /* LVALUE IDX EXP VAL 
*/
         pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_MGETO);     /* LVALUE IDX EXP VAL 
OFFSET */
         pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_NROT);      /* LVALUE IDX OFFSET 
EXP VAL */
@@ -3304,17 +3304,22 @@ PKL_PHASE_BEGIN_HANDLER (pkl_gen_ps_op_attr)
           {
             pvm_program_label label = pkl_asm_fresh_label (PKL_GEN_ASM);
 
-            if (attr == PKL_AST_ATTR_OFFSET)
-              pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_MGETO);
-            else
-              pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_MGETIOS);
-            pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_NIP);
-            pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_BNN, label);
+            pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_MM); /* VAL MAPPED_P */
+            pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_BNZI, label);
+
             pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_PUSH,
                           pvm_make_exception (PVM_E_MAP, PVM_E_MAP_MSG,
                                               PVM_E_MAP_ESTATUS));
             pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_RAISE);
             pkl_asm_label (PKL_GEN_ASM, label);
+
+            pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_DROP); /* VAL */
+            if (attr == PKL_AST_ATTR_OFFSET)
+              pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_MGETO);
+            else
+              pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_MGETIOS);
+            pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_NIP); /* (BOFF|IOS) */
+
             if (attr == PKL_AST_ATTR_OFFSET)
               {
                 pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_PUSH,
@@ -3337,9 +3342,7 @@ PKL_PHASE_BEGIN_HANDLER (pkl_gen_ps_op_attr)
         case PKL_TYPE_ANY:
         case PKL_TYPE_ARRAY:
         case PKL_TYPE_STRUCT:
-          pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_MGETO);
-          pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_NIP);
-          pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_NN);
+          pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_MM);
           pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_NIP);
           break;
         default:
@@ -3388,7 +3391,7 @@ PKL_PHASE_END_HANDLER
 
 PKL_PHASE_BEGIN_HANDLER (pkl_gen_ps_op_unmap)
 {
-  RAS_MACRO_OP_UNMAP;
+  pkl_asm_insn (PKL_GEN_ASM, PKL_INSN_UNMAP);
 }
 PKL_PHASE_END_HANDLER
 
diff --git a/libpoke/pkl-gen.pks b/libpoke/pkl-gen.pks
index b5c48f0e..07ea9852 100644
--- a/libpoke/pkl-gen.pks
+++ b/libpoke/pkl-gen.pks
@@ -24,14 +24,7 @@
 ;;; is mapped.  If the value is not mapped, this is a NOP.
 
         .macro op_unmap
-        push null
-        mseto
-        push null
-        msetm
-        push null
-        msetw
-        push null
-        msetios
+        unmap
         .end
 
 ;;; RAS_FUNCTION_ARRAY_MAPPER @array_type
@@ -226,6 +219,7 @@
         ;; Set the other map attributes.
         pushvar $ios          ; ARRAY IOS
         msetios               ; ARRAY
+        map                   ; ARRAY
         popf 1
         return
 .bounds_fail:
@@ -370,6 +364,7 @@
         msetsiz                 ; ARRAY
         pushvar $ebound         ; ARRAY EBOUND
         msetsel                 ; ARRAY
+        map                     ; ARRAY
         popf 1
         return
 .bounds_fail:
@@ -501,14 +496,13 @@
         dup                     ; 0UL 0UL
         regvar $eidx            ; BOFF
         regvar $eboff           ; _
-        ;; The offset of the constructed array is null, since it is
-        ;; not mapped.
-        push null               ; null
+        ;; The bit-offset of the constructed array is 0 by convention.
+        push ulong<64>0         ; 0UL
         ;; Build the type of the constructed array.
         .c PKL_GEN_PAYLOAD->in_constructor = 0;
         .c PKL_PASS_SUBPASS (PKL_AST_TYPE_A_ETYPE (@array_type));
         .c PKL_GEN_PAYLOAD->in_constructor = 1;
-                                ; null ATYPE
+                                ; 0UL ATYPE
         ;; Ok, loop to add elements to the constructed array.
      .while
         ;; If there is an EBOUND, check it.
@@ -1038,6 +1032,7 @@
         ;; Install the attributes of the mapped object.
         pushvar $ios            ; SCT IOS
         msetios                 ; SCT
+        map                     ; SCT
         popf 1
         return
         .end
@@ -1202,8 +1197,8 @@
         ;; So we have the same lexical structure than struct_mapper.
         push null
         regvar $unused
-        ;; The struct is not mapped, so its offset is null.
-        push null               ; null
+        ;; The struct is not mapped, so set its bit-offset to 0UL.
+        push ulong<64>0          ; 0UL
         ;; Iterate over the fields of the struct type.
  .c size_t vars_registered = 0;
         .let @field
@@ -1477,12 +1472,6 @@
         tor                     ; SCT I [IVAL EVAL]
         swap                    ; I SCT [IVAL EVAL]
         mgeto                   ; I SCT SOFF [IVAL EVAL]
-        ;; XXX: if NULL, put 0UL.  This check will go away when we
-        ;; add a separated flag for mapped values.
-        bnn .done
-        drop
-        push ulong<64>0
-.done:
         tor                     ; I SCT [IVAL EVAL SOFF]
         swap                    ; SCT I [IVAL EVAL SOFF]
         srefio                  ; SCT I EOFF [IVAL EVAL SOFF]
diff --git a/libpoke/pkl-insn.def b/libpoke/pkl-insn.def
index 24ce0bf8..1e11ae59 100644
--- a/libpoke/pkl-insn.def
+++ b/libpoke/pkl-insn.def
@@ -265,6 +265,11 @@ PKL_DEF_INSN(PKL_INSN_SMODI, "", "smodi")
 
 /* Instructions to handle mapped values.  */
 
+PKL_DEF_INSN(PKL_INSN_MM, "", "mm")
+
+PKL_DEF_INSN(PKL_INSN_MAP, "", "map")
+PKL_DEF_INSN(PKL_INSN_UNMAP, "", "unmap")
+
 PKL_DEF_INSN(PKL_INSN_MGETO, "", "mgeto")
 PKL_DEF_INSN(PKL_INSN_MSETO, "", "mseto")
 
diff --git a/libpoke/pvm-val.c b/libpoke/pvm-val.c
index 0720d01c..a7c77001 100644
--- a/libpoke/pvm-val.c
+++ b/libpoke/pvm-val.c
@@ -96,6 +96,7 @@ pvm_make_array (pvm_val nelem, pvm_val type)
   size_t nbytes = sizeof (struct pvm_array_elem) * PVM_VAL_ULONG (nelem);
   size_t i;
 
+  arr->mapped_p = 0;
   arr->ios = PVM_NULL;
   arr->offset = PVM_NULL;
   arr->elems_bound = PVM_NULL;
@@ -127,6 +128,7 @@ pvm_make_struct (pvm_val nfields, pvm_val nmethods, pvm_val 
type)
   size_t nmethodbytes
     = sizeof (struct pvm_struct_method) * PVM_VAL_ULONG (nmethods);
 
+  sct->mapped_p = 0;
   sct->ios = PVM_NULL;
   sct->offset = PVM_NULL;
   sct->mapper = PVM_NULL;
@@ -953,6 +955,7 @@ pvm_print_val_1 (pvm vm, int depth, int mode, int base, int 
indent,
       for (idx = 0; idx < nelem; idx++)
         {
           pvm_val elem_value = PVM_VAL_ARR_ELEM_VALUE (val, idx);
+          pvm_val elem_offset = PVM_VAL_ARR_ELEM_OFFSET (val, idx);
 
           if (idx != 0)
             pk_puts (",");
@@ -966,6 +969,15 @@ pvm_print_val_1 (pvm vm, int depth, int mode, int base, 
int indent,
             }
 
           PVM_PRINT_VAL_1 (elem_value, ndepth);
+
+          if (maps && elem_offset != PVM_NULL)
+            {
+              pk_puts (" @ ");
+              pk_term_class ("offset");
+              PVM_PRINT_VAL_1 (elem_offset, ndepth);
+              pk_puts ("#b");
+              pk_term_end_class ("offset");
+            }
         }
       pk_puts ("]");
 
@@ -1023,8 +1035,9 @@ pvm_print_val_1 (pvm vm, int depth, int mode, int base, 
int indent,
       nabsent = 0;
       for (idx = 0; idx < nelem; ++idx)
         {
-          pvm_val name = PVM_VAL_SCT_FIELD_NAME(val, idx);
-          pvm_val value = PVM_VAL_SCT_FIELD_VALUE(val, idx);
+          pvm_val name = PVM_VAL_SCT_FIELD_NAME (val, idx);
+          pvm_val value = PVM_VAL_SCT_FIELD_VALUE (val, idx);
+          pvm_val offset = PVM_VAL_SCT_FIELD_OFFSET (val, idx);
 
           if (PVM_VAL_SCT_FIELD_ABSENT_P (val, idx))
             nabsent++;
@@ -1045,6 +1058,15 @@ pvm_print_val_1 (pvm vm, int depth, int mode, int base, 
int indent,
                 }
               PVM_PRINT_VAL_1 (value, ndepth + 1);
             }
+
+          if (maps && offset != PVM_NULL)
+            {
+              pk_puts (" @ ");
+              pk_term_class ("offset");
+              PVM_PRINT_VAL_1 (offset, ndepth);
+              pk_puts ("#b");
+              pk_term_end_class ("offset");
+            }
         }
 
       if (mode == PVM_PRINT_TREE)
diff --git a/libpoke/pvm-val.h b/libpoke/pvm-val.h
index b464afa0..c75a0358 100644
--- a/libpoke/pvm-val.h
+++ b/libpoke/pvm-val.h
@@ -154,12 +154,15 @@ typedef struct pvm_val_box *pvm_val_box;
 /* Arrays values are boxed, and store sequences of homogeneous values
    called array "elements".  They can be mapped in IO, or unmapped.
 
+   MAPPED_P is 0 if the array value is not mapped, or has any other
+   value if it is mapped.
+
    IOS is an int<32> value that identifies the IO space where the
    value is mapped.  If the array is not mapped then this is PVM_NULL.
 
    OFFSET is an ulong<64> value with the bit offset in the current IO
    space where the array is mapped.  If the array is not mapped then
-   this is PVM_NULL.
+   this holds 0UL by convention.
 
    If the array is mapped, ELEMS_BOUND is an unsigned long containing
    the number of elements to which the map is bounded.  Similarly,
@@ -189,6 +192,7 @@ typedef struct pvm_val_box *pvm_val_box;
    relevant.  */
 
 #define PVM_VAL_ARR(V) (PVM_VAL_BOX_ARR (PVM_VAL_BOX ((V))))
+#define PVM_VAL_ARR_MAPPED_P(V) (PVM_VAL_ARR(V)->mapped_p)
 #define PVM_VAL_ARR_IOS(V) (PVM_VAL_ARR(V)->ios)
 #define PVM_VAL_ARR_OFFSET(V) (PVM_VAL_ARR(V)->offset)
 #define PVM_VAL_ARR_ELEMS_BOUND(V) (PVM_VAL_ARR(V)->elems_bound)
@@ -201,6 +205,7 @@ typedef struct pvm_val_box *pvm_val_box;
 
 struct pvm_array
 {
+  int mapped_p;
   pvm_val ios;
   pvm_val offset;
   pvm_val elems_bound;
@@ -238,12 +243,15 @@ struct pvm_array_elem
    called structure "elements".  They can be mapped in IO, or
    unmapped.
 
-   IO is an int<32> value that identifies the IO space where the value
+   MAPPED_P is 0 if the struct value is not mapped, or has any other
+   value if it is mapped.
+
+   IOS is an int<32> value that identifies the IO space where the value
    is mapped.  If the structure is not mapped then this is PVM_NULL.
 
    OFFSET is an ulong<64> value holding the bit offset of in the IO
    space where the structure is mapped.  If the structure is not
-   mapped then this is PVM_NULL.
+   mapped then this is 0UL by convention.
 
    TYPE is the type of the struct.  This includes the types of the
    struct fields.
@@ -259,6 +267,7 @@ struct pvm_array_elem
    irrelevant.  */
 
 #define PVM_VAL_SCT(V) (PVM_VAL_BOX_SCT (PVM_VAL_BOX ((V))))
+#define PVM_VAL_SCT_MAPPED_P(V) (PVM_VAL_SCT((V))->mapped_p)
 #define PVM_VAL_SCT_IOS(V) (PVM_VAL_SCT((V))->ios)
 #define PVM_VAL_SCT_OFFSET(V) (PVM_VAL_SCT((V))->offset)
 #define PVM_VAL_SCT_MAPPER(V) (PVM_VAL_SCT((V))->mapper)
@@ -271,6 +280,7 @@ struct pvm_array_elem
 
 struct pvm_struct
 {
+  int mapped_p;
   pvm_val ios;
   pvm_val offset;
   pvm_val mapper;
@@ -540,6 +550,21 @@ typedef struct pvm_off *pvm_off;
         PVM_VAL_SCT_IOS ((V)) = (I);             \
     } while (0)
 
+#define PVM_VAL_MAPPED_P(V)                             \
+  (PVM_IS_ARR ((V)) ? PVM_VAL_ARR_MAPPED_P ((V))        \
+   : PVM_IS_SCT ((V)) ? PVM_VAL_SCT_MAPPED_P ((V))      \
+   : 0)
+
+#define PVM_VAL_SET_MAPPED_P(V,I)               \
+  do                                            \
+    {                                           \
+      if (PVM_IS_ARR ((V)))                     \
+        PVM_VAL_ARR_MAPPED_P ((V)) = (I);       \
+      else if (PVM_IS_SCT ((V)))                \
+        PVM_VAL_SCT_MAPPED_P ((V)) = (I);       \
+    }                                           \
+  while (0)
+
 #define PVM_VAL_MAPPER(V)                               \
   (PVM_IS_ARR ((V)) ? PVM_VAL_ARR_MAPPER ((V))          \
    : PVM_IS_SCT ((V)) ? PVM_VAL_SCT_MAPPER ((V))        \
diff --git a/libpoke/pvm.jitter b/libpoke/pvm.jitter
index a5ebc29e..7cc4e825 100644
--- a/libpoke/pvm.jitter
+++ b/libpoke/pvm.jitter
@@ -3985,6 +3985,53 @@ end
 
 ## Instructions to handle mapped values
 
+# Instruction: mm
+#
+# Given a value, push 1 on the stack if the value is mapped.
+# Push 0 otherwise.
+#
+# Stack: ( VAL -- VAL INT )
+
+instruction mm ()
+  code
+    pvm_val mapped_p = pvm_make_int (PVM_VAL_MAPPED_P (JITTER_TOP_STACK ()),
+                                     32);
+    JITTER_PUSH_STACK (mapped_p);
+  end
+end
+
+# Instruction: map
+#
+# Given a value, mark it as as mapped.  If the value can't be
+# mapped then PVM_E_INVAL is raised.
+#
+# Stack: ( VAL -- VAL )
+# Exceptions: PVM_E_INVAL
+
+instruction map ()
+  code
+    pvm_val val = JITTER_TOP_STACK ();
+
+    if (!(PVM_IS_ARR (val) || PVM_IS_SCT (val)))
+      PVM_RAISE_DFL (PVM_E_INVAL);
+
+    PVM_VAL_SET_MAPPED_P (JITTER_TOP_STACK (), 1);
+  end
+end
+
+# Instruction: unmap
+#
+# Given a value, mark it as as not mapped.  If the value can't be
+# mapped then this is a no-operation.
+#
+# Stack: ( VAL -- VAL )
+
+instruction unmap ()
+  code
+    PVM_VAL_SET_MAPPED_P (JITTER_TOP_STACK (), 0);
+  end
+end
+
 # Instruction: mgeto
 #
 # Given a map-able value, push its bit-offset on the stack as an
diff --git a/testsuite/poke.cmd/set-omaps-1.pk 
b/testsuite/poke.cmd/set-omaps-1.pk
index e7a0eb52..682551b6 100644
--- a/testsuite/poke.cmd/set-omaps-1.pk
+++ b/testsuite/poke.cmd/set-omaps-1.pk
@@ -11,4 +11,4 @@ type Foo = struct { byte a; byte[2] b; };
 
 /* { dg-command { .set omaps yes } } */
 /* { dg-command { Foo @ 0#B } } */
-/* { dg-output "\nFoo \{a=0x10UB,b=\\\[0x20UB,0x30UB\\\] @ 0x8UL#b\} @ 
0x0UL#b" } */
+/* { dg-output "\nFoo \{a=0x10UB @ 0x0UL#b,b=\\\[0x20UB @ 0x8UL#b,0x30UB @ 
0x10UL#b\\\] @ 0x8UL#b @ 0x8UL#b\} @ 0x0UL#b" } */
-- 
2.25.0.2.g232378479e





reply via email to

[Prev in Thread] Current Thread [Next in Thread]