Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jul 31, 2024
1 parent 4db87d3 commit eb4af8c
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lib/valtype.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
#if !defined(_TOYWASM_VALTYPE_H)
#define _TOYWASM_VALTYPE_H

/*
* Note: these values are sN-encoded negative values so that
* they can be distinguished from typeidx in eg. block types.
*/

enum valtype {
/* numtype */
TYPE_i32 = 0x7f,
TYPE_i64 = 0x7e,
TYPE_f32 = 0x7d,
TYPE_f64 = 0x7c,
TYPE_i32 = 0x7f, /* -0x01 */
TYPE_i64 = 0x7e, /* -0x02 */
TYPE_f32 = 0x7d, /* -0x03 */
TYPE_f64 = 0x7c, /* -0x04 */

/* vectype */
TYPE_v128 = 0x7b,
TYPE_v128 = 0x7b, /* -0x05 */

/* reftype */
TYPE_EXNREF = 0x69,
TYPE_FUNCREF = 0x70,
TYPE_EXTERNREF = 0x6f,
TYPE_EXNREF = 0x69, /* -0x17 */
TYPE_FUNCREF = 0x70, /* -0x10 */
TYPE_EXTERNREF = 0x6f, /* -0x11 */

/* pseudo types for validation logic */
TYPE_ANYREF = 0xfe, /* any reftype */
Expand Down

0 comments on commit eb4af8c

Please sign in to comment.