Hide V128 from public packages (#575)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
12
api/wasm.go
12
api/wasm.go
@@ -59,7 +59,6 @@ func ExternTypeName(et ExternType) string {
|
|||||||
// * ValueTypeI64 - uint64(int64)
|
// * ValueTypeI64 - uint64(int64)
|
||||||
// * ValueTypeF32 - EncodeF32 DecodeF32 from float32
|
// * ValueTypeF32 - EncodeF32 DecodeF32 from float32
|
||||||
// * ValueTypeF64 - EncodeF64 DecodeF64 from float64
|
// * ValueTypeF64 - EncodeF64 DecodeF64 from float64
|
||||||
// * ValueTypeV128 TODO:
|
|
||||||
// * ValueTypeExternref - unintptr(unsafe.Pointer(p)) where p is any pointer type in Go (e.g. *string)
|
// * ValueTypeExternref - unintptr(unsafe.Pointer(p)) where p is any pointer type in Go (e.g. *string)
|
||||||
//
|
//
|
||||||
// Ex. Given a Text Format type use (param i64) (result i64), no conversion is necessary.
|
// Ex. Given a Text Format type use (param i64) (result i64), no conversion is necessary.
|
||||||
@@ -85,15 +84,6 @@ const (
|
|||||||
ValueTypeF32 ValueType = 0x7d
|
ValueTypeF32 ValueType = 0x7d
|
||||||
// ValueTypeF64 is a 64-bit floating point number.
|
// ValueTypeF64 is a 64-bit floating point number.
|
||||||
ValueTypeF64 ValueType = 0x7c
|
ValueTypeF64 ValueType = 0x7c
|
||||||
// ValueTypeV128 is a 128-bit vector value.
|
|
||||||
//
|
|
||||||
// The type corresponds to a 128 bit vector of packed integer or floating-point data.
|
|
||||||
// The packed data can be interpreted as signed or unsigned integers, single or double
|
|
||||||
// precision floating-point values, or a single 128 bit type. The interpretation is
|
|
||||||
// determined by individual operations.
|
|
||||||
//
|
|
||||||
// See https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/syntax/types.html#syntax-vectype
|
|
||||||
ValueTypeV128 ValueType = 0x7b
|
|
||||||
// ValueTypeExternref is a externref type.
|
// ValueTypeExternref is a externref type.
|
||||||
//
|
//
|
||||||
// Note: in wazero, externref type value are opaque raw 64-bit pointers, and the ValueTypeExternref type
|
// Note: in wazero, externref type value are opaque raw 64-bit pointers, and the ValueTypeExternref type
|
||||||
@@ -122,8 +112,6 @@ func ValueTypeName(t ValueType) string {
|
|||||||
return "f32"
|
return "f32"
|
||||||
case ValueTypeF64:
|
case ValueTypeF64:
|
||||||
return "f64"
|
return "f64"
|
||||||
case ValueTypeV128:
|
|
||||||
return "v128"
|
|
||||||
case ValueTypeExternref:
|
case ValueTypeExternref:
|
||||||
return "externref"
|
return "externref"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1001,21 +1001,23 @@ func SectionIDName(sectionID SectionID) string {
|
|||||||
type ValueType = api.ValueType
|
type ValueType = api.ValueType
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ValueTypeI32 = api.ValueTypeI32
|
ValueTypeI32 = api.ValueTypeI32
|
||||||
ValueTypeI64 = api.ValueTypeI64
|
ValueTypeI64 = api.ValueTypeI64
|
||||||
ValueTypeF32 = api.ValueTypeF32
|
ValueTypeF32 = api.ValueTypeF32
|
||||||
ValueTypeF64 = api.ValueTypeF64
|
ValueTypeF64 = api.ValueTypeF64
|
||||||
ValueTypeV128 = api.ValueTypeV128
|
// TODO: ValueTypeV128 is not exposed in the api pkg yet.
|
||||||
|
ValueTypeV128 = 0x7b
|
||||||
// TODO: ValueTypeFuncref is not exposed in the api pkg yet.
|
// TODO: ValueTypeFuncref is not exposed in the api pkg yet.
|
||||||
ValueTypeFuncref ValueType = 0x70
|
ValueTypeFuncref ValueType = 0x70
|
||||||
ValueTypeExternref ValueType = api.ValueTypeExternref
|
ValueTypeExternref = api.ValueTypeExternref
|
||||||
)
|
)
|
||||||
|
|
||||||
// ValueTypeName is an alias of api.ValueTypeName defined to simplify imports.
|
// ValueTypeName is an alias of api.ValueTypeName defined to simplify imports.
|
||||||
func ValueTypeName(t ValueType) string {
|
func ValueTypeName(t ValueType) string {
|
||||||
if t == ValueTypeFuncref {
|
if t == ValueTypeFuncref {
|
||||||
// TODO: funcref is not exposed in the API pkg yet.
|
|
||||||
return "funcref"
|
return "funcref"
|
||||||
|
} else if t == ValueTypeV128 {
|
||||||
|
return "v128"
|
||||||
}
|
}
|
||||||
return api.ValueTypeName(t)
|
return api.ValueTypeName(t)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user