[uim-commit] r1857 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Mon Oct 17 15:27:59 PDT 2005


Author: yamaken
Date: 2005-10-17 15:27:54 -0700 (Mon, 17 Oct 2005)
New Revision: 1857

Modified:
   branches/r5rs/sigscheme/sigschemetype-compact.h
Log:
* sigscheme/sigschemetype-compact.h
  - (SCM_WORD_WIDTH): New macro
  - (SCM_VALUE_WIDTH): Rewrite with SCM_WORD_WIDTH
  - Add some FIXME comments
  - (SCM_OTHERS_CDR_TAG_WIDTH, SCM_OTHERS_CDR_TAG_OFFSET,
    SCM_OTHERS_CDR_TAG_MASK, SCM_OTHERS_CDR_TAG_SYMBOL,
    SCM_OTHERS_CDR_TAG_STRING, SCM_OTHERS_CDR_TAG_VECTOR,
    SCM_OTHERS_CDR_TAG_EXT, SCM_OTHERS_CDR_SUB_TAG_WIDTH,
    SCM_OTHERS_CDR_SUB_TAG_OFFSET, SCM_OTHERS_CDR_SUB_TAG_MASK,
    SCM_OTHERS_CDR_SUB_TAG_VALUES, SCM_OTHERS_CDR_SUB_TAG_FUNC,
    SCM_OTHERS_CDR_SUB_TAG_PORT, SCM_OTHERS_CDR_SUB_TAG_CONTINUATION,
    SCM_OTHERS_CDR_SUB_TAG_C_POINTER,
    SCM_OTHERS_CDR_SUB_TAG_RESERVED5,
    SCM_OTHERS_CDR_SUB_TAG_RESERVED6, SCM_OTHERS_CDR_SUB_TAG_FREECELL,
    SCM_OTHERS_CDR_EXT_TAG_WIDTH, SCM_OTHERS_CDR_EXT_TAG_OFFSET,
    SCM_OTHERS_CDR_EXT_TAG_MASK, SCM_OTHERS_CDR_EXT_TAG_VALUES,
    SCM_OTHERS_CDR_EXT_TAG_FUNC, SCM_OTHERS_CDR_EXT_TAG_PORT,
    SCM_OTHERS_CDR_EXT_TAG_CONTINUATION,
    SCM_OTHERS_CDR_EXT_TAG_C_POINTER,
    SCM_OTHERS_CDR_EXT_TAG_RESERVED5,
    SCM_OTHERS_CDR_EXT_TAG_RESERVED6, SCM_OTHERS_CDR_EXT_TAG_FREECELL,
    SCM_OTHERS_CDR_VALUE_WIDTH, SCM_OTHERS_CDR_VALUE_OFFSET,
    SCM_OTHERS_CDR_VALUE_MASK, SCM_OTHERS_CDR_NARROW_VALUE_WIDTH,
    SCM_OTHERS_CDR_NARROW_VALUE_OFFSET,
    SCM_OTHERS_CDR_NARROW_VALUE_MASK, SCM_OTHERS_CDR_TAG_WIDTH_SYMBOL,
    SCM_OTHERS_CDR_TAG_OFFSET_SYMBOL, SCM_OTHERS_CDR_TAG_MASK_SYMBOL,
    SCM_OTHERS_CDR_VALUE_WIDTH_SYMBOL,
    SCM_OTHERS_CDR_VALUE_OFFSET_SYMBOL,
    SCM_OTHERS_CDR_VALUE_MASK_SYMBOL, SCM_OTHERS_CDR_TAG_WIDTH_STRING,
    SCM_OTHERS_CDR_TAG_OFFSET_STRING, SCM_OTHERS_CDR_TAG_MASK_STRING,
    SCM_OTHERS_CDR_VALUE_WIDTH_STRING,
    SCM_OTHERS_CDR_VALUE_OFFSET_STRING,
    SCM_OTHERS_CDR_VALUE_MASK_STRING, SCM_OTHERS_CDR_TAG_WIDTH_VECTOR,
    SCM_OTHERS_CDR_TAG_OFFSET_VECTOR, SCM_OTHERS_CDR_TAG_MASK_VECTOR,
    SCM_OTHERS_CDR_VALUE_WIDTH_VECTOR,
    SCM_OTHERS_CDR_VALUE_OFFSET_VECTOR,
    SCM_OTHERS_CDR_VALUE_MASK_VECTOR, SCM_OTHERS_CDR_TAG_WIDTH_VALUES,
    SCM_OTHERS_CDR_TAG_OFFSET_VALUES, SCM_OTHERS_CDR_TAG_MASK_VALUES,
    SCM_OTHERS_CDR_VALUE_WIDTH_VALUES,
    SCM_OTHERS_CDR_VALUE_OFFSET_VALUES,
    SCM_OTHERS_CDR_VALUE_MASK_VALUES): New macro. See the comment
    around them


Modified: branches/r5rs/sigscheme/sigschemetype-compact.h
===================================================================
--- branches/r5rs/sigscheme/sigschemetype-compact.h	2005-10-17 20:39:30 UTC (rev 1856)
+++ branches/r5rs/sigscheme/sigschemetype-compact.h	2005-10-17 22:27:54 UTC (rev 1857)
@@ -220,6 +220,9 @@
 /*=======================================
    Masks and Offsets
 =======================================*/
+/* FIXME: hardcoded width 32 */
+#define SCM_WORD_WIDTH      32
+
 #define SCM_GCBIT_WIDTH     1
 #define SCM_GCBIT_OFFSET    0
 #define SCM_GCBIT_MASK      (0x1 << SCM_GCBIT_OFFSET)
@@ -235,11 +238,173 @@
 #define SCM_TAG_OTHERS      (0x2 << SCM_TAG_OFFSET)
 #define SCM_TAG_IMM         (0x3 << SCM_TAG_OFFSET)
 
-/* FIXME: hardcoded width 32 */
-#define SCM_VALUE_WIDTH     (32 - (SCM_TAG_WIDTH + SCM_GCBIT_WIDTH))
+#define SCM_VALUE_WIDTH     (SCM_WORD_WIDTH                                  \
+                             - (SCM_TAG_WIDTH + SCM_GCBIT_WIDTH))
 #define SCM_VALUE_OFFSET    (SCM_TAG_WIDTH + SCM_GCBIT_WIDTH)
 #define SCM_VALUE_MASK      (~0U << SCM_VALUE_OFFSET)
 
+#if YAMAKEN
+/*
+ * I suggest these macro defining convention to achieve:
+ *   - making names consistent
+ *   - avoiding misunderstanding of names
+ *   - magic number-free obvious meaning on value definition
+ *   - hiding bitwise representation from accessor layer
+ *
+ * Rewrite the immediate type and special constants likewise if the convention
+ * is felt reasonable.  -- YamaKen 2005-10-18
+ */
+
+/* primary tag */
+#define SCM_OTHERS_CDR_TAG_WIDTH         2
+#define SCM_OTHERS_CDR_TAG_OFFSET        SCM_GCBIT_WIDTH
+#define SCM_OTHERS_CDR_TAG_MASK          (0x3 << SCM_OTHERS_CDR_TAG_OFFSET)
+#define SCM_OTHERS_CDR_TAG_SYMBOL        (0x0 << SCM_OTHERS_CDR_TAG_OFFSET)
+#define SCM_OTHERS_CDR_TAG_STRING        (0x1 << SCM_OTHERS_CDR_TAG_OFFSET)
+#define SCM_OTHERS_CDR_TAG_VECTOR        (0x2 << SCM_OTHERS_CDR_TAG_OFFSET)
+#define SCM_OTHERS_CDR_TAG_EXT           (0x3 << SCM_OTHERS_CDR_TAG_OFFSET)
+
+/* subtag */
+#define SCM_OTHERS_CDR_SUB_TAG_WIDTH     3
+#define SCM_OTHERS_CDR_SUB_TAG_OFFSET    (SCM_OTHERS_CDR_TAG_OFFSET          \
+                                          + SCM_OTHERS_CDR_TAG_WIDTH)
+#define SCM_OTHERS_CDR_SUB_TAG_MASK      (0x7 << SCM_OTHERS_CDR_SUB_TAG_OFFSET)
+#define SCM_OTHERS_CDR_SUB_TAG_VALUES    (0x0 << SCM_OTHERS_CDR_SUB_TAG_OFFSET)
+#define SCM_OTHERS_CDR_SUB_TAG_FUNC      (0x1 << SCM_OTHERS_CDR_SUB_TAG_OFFSET)
+#define SCM_OTHERS_CDR_SUB_TAG_PORT      (0x2 << SCM_OTHERS_CDR_SUB_TAG_OFFSET)
+#define SCM_OTHERS_CDR_SUB_TAG_CONTINUATION (0x3 << SCM_OTHERS_CDR_SUB_TAG_OFFSET)
+#define SCM_OTHERS_CDR_SUB_TAG_C_POINTER (0x4 << SCM_OTHERS_CDR_SUB_TAG_OFFSET)
+#define SCM_OTHERS_CDR_SUB_TAG_RESERVED5 (0x5 << SCM_OTHERS_CDR_SUB_TAG_OFFSET)
+#define SCM_OTHERS_CDR_SUB_TAG_RESERVED6 (0x6 << SCM_OTHERS_CDR_SUB_TAG_OFFSET)
+#define SCM_OTHERS_CDR_SUB_TAG_FREECELL  (0x7 << SCM_OTHERS_CDR_SUB_TAG_OFFSET)
+
+/* extended tag combines primary tag and subtag */
+#define SCM_OTHERS_CDR_EXT_TAG_WIDTH     (SCM_OTHERS_CDR_TAG_WIDTH           \
+                                          + SCM_OTHERS_CDR_SUB_TAG_WIDTH)
+#define SCM_OTHERS_CDR_EXT_TAG_OFFSET    (SCM_OTHERS_CDR_TAG_OFFSET          \
+                                          + SCM_OTHERS_CDR_SUB_TAG_OFFSET)
+#define SCM_OTHERS_CDR_EXT_TAG_MASK      (SCM_OTHERS_CDR_TAG_MASK            \
+                                          + SCM_OTHERS_CDR_SUB_TAG_MASK)
+#define SCM_OTHERS_CDR_EXT_TAG_VALUES    (SCM_OTHERS_CDR_SUB_TAG_VALUES      \
+                                          | SCM_OTHERS_CDR_TAG_EXT)
+#define SCM_OTHERS_CDR_EXT_TAG_FUNC      (SCM_OTHERS_CDR_SUB_TAG_FUNC        \
+                                          | SCM_OTHERS_CDR_TAG_EXT)
+#define SCM_OTHERS_CDR_EXT_TAG_PORT      (SCM_OTHERS_CDR_SUB_TAG_PORT        \
+                                          | SCM_OTHERS_CDR_TAG_EXT)
+#define SCM_OTHERS_CDR_EXT_TAG_CONTINUATION (SCM_OTHERS_CDR_SUB_TAG_CONTINUATION \
+                                             | SCM_OTHERS_CDR_TAG_EXT)
+#define SCM_OTHERS_CDR_EXT_TAG_C_POINTER (SCM_OTHERS_CDR_SUB_TAG_C_POINTER   \
+                                          | SCM_OTHERS_CDR_TAG_EXT)
+#define SCM_OTHERS_CDR_EXT_TAG_RESERVED5 (SCM_OTHERS_CDR_SUB_TAG_RESERVED5   \
+                                          | SCM_OTHERS_CDR_TAG_EXT)
+#define SCM_OTHERS_CDR_EXT_TAG_RESERVED6 (SCM_OTHERS_CDR_SUB_TAG_RESERVED6   \
+                                          | SCM_OTHERS_CDR_TAG_EXT)
+#define SCM_OTHERS_CDR_EXT_TAG_FREECELL  (SCM_OTHERS_CDR_SUB_TAG_FREECELL    \
+                                          | SCM_OTHERS_CDR_TAG_EXT)
+
+/* value field for primary tag */
+#define SCM_OTHERS_CDR_VALUE_WIDTH   (SCM_WORD_WIDTH                         \
+                                      - (SCM_OTHERS_CDR_TAG_WIDTH            \
+                                         + SCM_GCBIT_WIDTH))
+#define SCM_OTHERS_CDR_VALUE_OFFSET  (SCM_OTHERS_CDR_TAG_WIDTH               \
+                                      + SCM_GCBIT_WIDTH)
+#define SCM_OTHERS_CDR_VALUE_MASK    (~0U << SCM_OTHERS_CDR_VALUE_OFFSET)
+
+/* value field for extended tag */
+#define SCM_OTHERS_CDR_NARROW_VALUE_WIDTH  (SCM_WORD_WIDTH                   \
+                                            - (SCM_OTHERS_CDR_SUB_TAG_WIDTH  \
+                                               + SCM_OTHERS_CDR_TAG_WIDTH    \
+                                               + SCM_GCBIT_WIDTH))
+#define SCM_OTHERS_CDR_NARROW_VALUE_OFFSET (SCM_OTHERS_CDR_SUB_TAG_WIDTH     \
+                                            + SCM_OTHERS_CDR_TAG_WIDTH       \
+                                            + SCM_GCBIT_WIDTH)
+#define SCM_OTHERS_CDR_NARROW_VALUE_MASK   (~0U << SCM_OTHERS_CDR_VALUE_OFFSET)
+
+/* for specific types */
+#define SCM_OTHERS_CDR_TAG_WIDTH_SYMBOL     SCM_OTHERS_CDR_TAG_WIDTH
+#define SCM_OTHERS_CDR_TAG_OFFSET_SYMBOL    SCM_OTHERS_CDR_TAG_OFFSET
+#define SCM_OTHERS_CDR_TAG_MASK_SYMBOL      SCM_OTHERS_CDR_TAG_MASK
+#define SCM_OTHERS_CDR_VALUE_WIDTH_SYMBOL   SCM_OTHERS_CDR_VALUE_WIDTH
+#define SCM_OTHERS_CDR_VALUE_OFFSET_SYMBOL  SCM_OTHERS_CDR_VALUE_OFFSET
+#define SCM_OTHERS_CDR_VALUE_MASK_SYMBOL    SCM_OTHERS_CDR_VALUE_MASK
+
+#define SCM_OTHERS_CDR_TAG_WIDTH_STRING     SCM_OTHERS_CDR_TAG_WIDTH
+#define SCM_OTHERS_CDR_TAG_OFFSET_STRING    SCM_OTHERS_CDR_TAG_OFFSET
+#define SCM_OTHERS_CDR_TAG_MASK_STRING      SCM_OTHERS_CDR_TAG_MASK
+#define SCM_OTHERS_CDR_VALUE_WIDTH_STRING   SCM_OTHERS_CDR_VALUE_WIDTH
+#define SCM_OTHERS_CDR_VALUE_OFFSET_STRING  SCM_OTHERS_CDR_VALUE_OFFSET
+#define SCM_OTHERS_CDR_VALUE_MASK_STRING    SCM_OTHERS_CDR_VALUE_MASK
+
+#define SCM_OTHERS_CDR_TAG_WIDTH_VECTOR     SCM_OTHERS_CDR_TAG_WIDTH
+#define SCM_OTHERS_CDR_TAG_OFFSET_VECTOR    SCM_OTHERS_CDR_TAG_OFFSET
+#define SCM_OTHERS_CDR_TAG_MASK_VECTOR      SCM_OTHERS_CDR_TAG_MASK
+#define SCM_OTHERS_CDR_VALUE_WIDTH_VECTOR   SCM_OTHERS_CDR_VALUE_WIDTH
+#define SCM_OTHERS_CDR_VALUE_OFFSET_VECTOR  SCM_OTHERS_CDR_VALUE_OFFSET
+#define SCM_OTHERS_CDR_VALUE_MASK_VECTOR    SCM_OTHERS_CDR_VALUE_MASK
+
+#define SCM_OTHERS_CDR_TAG_WIDTH_VALUES     SCM_OTHERS_CDR_EXT_TAG_WIDTH
+#define SCM_OTHERS_CDR_TAG_OFFSET_VALUES    SCM_OTHERS_CDR_EXT_TAG_OFFSET
+#define SCM_OTHERS_CDR_TAG_MASK_VALUES      SCM_OTHERS_CDR_EXT_TAG_MASK
+#define SCM_OTHERS_CDR_VALUE_WIDTH_VALUES   SCM_OTHERS_CDR_NARROW_VALUE_WIDTH
+#define SCM_OTHERS_CDR_VALUE_OFFSET_VALUES  SCM_OTHERS_CDR_NARROW_VALUE_OFFSET
+#define SCM_OTHERS_CDR_VALUE_MASK_VALUES    SCM_OTHERS_CDR_NARROW_VALUE_MASK
+
+#define SCM_OTHERS_CDR_TAG_WIDTH_FUNC       SCM_OTHERS_CDR_EXT_TAG_WIDTH
+#define SCM_OTHERS_CDR_TAG_OFFSET_FUNC      SCM_OTHERS_CDR_EXT_TAG_OFFSET
+#define SCM_OTHERS_CDR_TAG_MASK_FUNC        SCM_OTHERS_CDR_EXT_TAG_MASK
+#define SCM_OTHERS_CDR_VALUE_WIDTH_FUNC     SCM_OTHERS_CDR_NARROW_VALUE_WIDTH
+#define SCM_OTHERS_CDR_VALUE_OFFSET_FUNC    SCM_OTHERS_CDR_NARROW_VALUE_OFFSET
+#define SCM_OTHERS_CDR_VALUE_MASK_FUNC      SCM_OTHERS_CDR_NARROW_VALUE_MASK
+
+#define SCM_OTHERS_CDR_TAG_WIDTH_PORT       SCM_OTHERS_CDR_EXT_TAG_WIDTH
+#define SCM_OTHERS_CDR_TAG_OFFSET_PORT      SCM_OTHERS_CDR_EXT_TAG_OFFSET
+#define SCM_OTHERS_CDR_TAG_MASK_PORT        SCM_OTHERS_CDR_EXT_TAG_MASK
+#define SCM_OTHERS_CDR_VALUE_WIDTH_PORT     SCM_OTHERS_CDR_NARROW_VALUE_WIDTH
+#define SCM_OTHERS_CDR_VALUE_OFFSET_PORT    SCM_OTHERS_CDR_NARROW_VALUE_OFFSET
+#define SCM_OTHERS_CDR_VALUE_MASK_PORT      SCM_OTHERS_CDR_NARROW_VALUE_MASK
+
+#define SCM_OTHERS_CDR_TAG_WIDTH_CONTINUATION    SCM_OTHERS_CDR_EXT_TAG_WIDTH
+#define SCM_OTHERS_CDR_TAG_OFFSET_CONTINUATION   SCM_OTHERS_CDR_EXT_TAG_OFFSET
+#define SCM_OTHERS_CDR_TAG_MASK_CONTINUATION     SCM_OTHERS_CDR_EXT_TAG_MASK
+#define SCM_OTHERS_CDR_VALUE_WIDTH_CONTINUATION  SCM_OTHERS_CDR_NARROW_VALUE_WIDTH
+#define SCM_OTHERS_CDR_VALUE_OFFSET_CONTINUATION SCM_OTHERS_CDR_NARROW_VALUE_OFFSET
+#define SCM_OTHERS_CDR_VALUE_MASK_CONTINUATION   SCM_OTHERS_CDR_NARROW_VALUE_MASK
+
+#define SCM_OTHERS_CDR_TAG_WIDTH_C_POINTER    SCM_OTHERS_CDR_EXT_TAG_WIDTH
+#define SCM_OTHERS_CDR_TAG_OFFSET_C_POINTER   SCM_OTHERS_CDR_EXT_TAG_OFFSET
+#define SCM_OTHERS_CDR_TAG_MASK_C_POINTER     SCM_OTHERS_CDR_EXT_TAG_MASK
+#define SCM_OTHERS_CDR_VALUE_WIDTH_C_POINTER  SCM_OTHERS_CDR_NARROW_VALUE_WIDTH
+#define SCM_OTHERS_CDR_VALUE_OFFSET_C_POINTER SCM_OTHERS_CDR_NARROW_VALUE_OFFSET
+#define SCM_OTHERS_CDR_VALUE_MASK_C_POINTER   SCM_OTHERS_CDR_NARROW_VALUE_MASK
+
+#define SCM_OTHERS_CDR_TAG_WIDTH_RESERVED5    SCM_OTHERS_CDR_EXT_TAG_WIDTH
+#define SCM_OTHERS_CDR_TAG_OFFSET_RESERVED5   SCM_OTHERS_CDR_EXT_TAG_OFFSET
+#define SCM_OTHERS_CDR_TAG_MASK_RESERVED5     SCM_OTHERS_CDR_EXT_TAG_MASK
+#define SCM_OTHERS_CDR_VALUE_WIDTH_RESERVED5  SCM_OTHERS_CDR_NARROW_VALUE_WIDTH
+#define SCM_OTHERS_CDR_VALUE_OFFSET_RESERVED5 SCM_OTHERS_CDR_NARROW_VALUE_OFFSET
+#define SCM_OTHERS_CDR_VALUE_MASK_RESERVED5   SCM_OTHERS_CDR_NARROW_VALUE_MASK
+
+#define SCM_OTHERS_CDR_TAG_WIDTH_RESERVED6    SCM_OTHERS_CDR_EXT_TAG_WIDTH
+#define SCM_OTHERS_CDR_TAG_OFFSET_RESERVED6   SCM_OTHERS_CDR_EXT_TAG_OFFSET
+#define SCM_OTHERS_CDR_TAG_MASK_RESERVED6     SCM_OTHERS_CDR_EXT_TAG_MASK
+#define SCM_OTHERS_CDR_VALUE_WIDTH_RESERVED6  SCM_OTHERS_CDR_NARROW_VALUE_WIDTH
+#define SCM_OTHERS_CDR_VALUE_OFFSET_RESERVED6 SCM_OTHERS_CDR_NARROW_VALUE_OFFSET
+#define SCM_OTHERS_CDR_VALUE_MASK_RESERVED6   SCM_OTHERS_CDR_NARROW_VALUE_MASK
+
+#define SCM_OTHERS_CDR_TAG_WIDTH_FREECELL     SCM_OTHERS_CDR_EXT_TAG_WIDTH
+#define SCM_OTHERS_CDR_TAG_OFFSET_FREECELL    SCM_OTHERS_CDR_EXT_TAG_OFFSET
+#define SCM_OTHERS_CDR_TAG_MASK_FREECELL      SCM_OTHERS_CDR_EXT_TAG_MASK
+#define SCM_OTHERS_CDR_VALUE_WIDTH_FREECELL   SCM_OTHERS_CDR_NARROW_VALUE_WIDTH
+#define SCM_OTHERS_CDR_VALUE_OFFSET_FREECELL  SCM_OTHERS_CDR_NARROW_VALUE_OFFSET
+#define SCM_OTHERS_CDR_VALUE_MASK_FREECELL    SCM_OTHERS_CDR_NARROW_VALUE_MASK
+
+#else /* YAMAKEN */
+
+/* FIXME:
+ * - Rid the offset values of magic numbers
+ * - Move misunderstood pointer type field definition for C_POINTER ('+ 1'). It
+ *   is originally intended to be stored to value field
+ */
 #define SCM_TAG_OTHERS_VALUE_OFFSET_SYMBOL       SCM_GCBIT_WIDTH + 2
 #define SCM_TAG_OTHERS_VALUE_OFFSET_STRING       SCM_GCBIT_WIDTH + 2
 #define SCM_TAG_OTHERS_VALUE_OFFSET_VECTOR       SCM_GCBIT_WIDTH + 2
@@ -258,6 +423,12 @@
 #define SCM_TAG_OTHERS_MASK_CONTINUATION         ((0x1 << SCM_TAG_OTHERS_VALUE_OFFSET_CONTINUATION) - 1)
 #define SCM_TAG_OTHERS_MASK_C_POINTER            ((0x1 << SCM_TAG_OTHERS_VALUE_OFFSET_C_POINTER)    - 1)
 #define SCM_TAG_OTHERS_MASK_FREECELL             ((0x1 << SCM_TAG_OTHERS_VALUE_OFFSET_FREECELL)     - 1)
+
+/*
+ * FIXME:
+ * - Rid the values of magic numbers
+ * - Remove inappropriate direct use of SCM_GCBIT_WIDTH
+ */
 #define SCM_TAG_OTHERS_SYMBOL                    (SCM_TAG_OTHERS | (0x0 << SCM_GCBIT_WIDTH))
 #define SCM_TAG_OTHERS_STRING                    (SCM_TAG_OTHERS | (0x1 << SCM_GCBIT_WIDTH))
 #define SCM_TAG_OTHERS_VECTOR                    (SCM_TAG_OTHERS | (0x2 << SCM_GCBIT_WIDTH))
@@ -269,6 +440,9 @@
 #define SCM_TAG_OTHERS_C_FUNC_POINTER            (SCM_TAG_OTHERS | (0x3 << SCM_GCBIT_WIDTH) | (0x4 << 6) | (0x1 << 7))
 #define SCM_TAG_OTHERS_FREECELL                  (SCM_TAG_OTHERS | (0x3 << SCM_GCBIT_WIDTH) | (0x7 << 6))
 
+#endif /* YAMAKEN */
+
+/* FIXME: Rid the offset values of magic numbers */
 #define SCM_TAG_IMM_VALUE_OFFSET_INT             SCM_GCBIT_WIDTH + 2 + 1
 #define SCM_TAG_IMM_VALUE_OFFSET_CHAR            SCM_GCBIT_WIDTH + 2 + 2
 #define SCM_TAG_IMM_VALUE_OFFSET_CONST           SCM_GCBIT_WIDTH + 2 + 2 + 3
@@ -277,6 +451,14 @@
 #define SCM_TAG_IMM_MASK_CONST                   ((0x1 << SCM_TAG_IMM_VALUE_OFFSET_CONST) - 1)
 #define SCM_TAG_IMM_INT                          (SCM_TAG_IMM | (0x0 << 3))
 #define SCM_TAG_IMM_CHAR                         (SCM_TAG_IMM | (0x1 << 3))
+
+/*
+ * FIXME:
+ * - Rename prefix appropriately since these are NOT TAG but concrete constant
+ *   value
+ * - Replace value definitions with meaningful symbolic form using mask, offset
+ *   and tags. Rid the values of magic numbers
+ */
 #define SCM_TAG_IMM_NULL                         (SCM_TAG_IMM | (0x3 << 3) | (0x0 << 5))
 #define SCM_TAG_IMM_INVALID                      (SCM_TAG_IMM | (0x3 << 3) | (0x1 << 5))
 #define SCM_TAG_IMM_UNBOUND                      (SCM_TAG_IMM | (0x3 << 3) | (0x2 << 5))



More information about the uim-commit mailing list