Skip to content

Commit

Permalink
Update default vector
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinWonho committed Feb 2, 2024
1 parent d82ff53 commit fba9908
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion spectec/spec/wasm-2.0/5-runtime-aux.watsup
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

;; Default values

def $vzero: c_vectype ;; HACK for algorithmic backend

def $default(valtype) : val hint(show $default_%)

def $default(I32) = (CONST I32 0)
def $default(I64) = (CONST I64 0)
def $default(F32) = (CONST F32 0)
def $default(F64) = (CONST F64 0)
def $default(V128) = (VVCONST V128 0)
def $default(V128) = (VVCONST V128 $vzero)
def $default(FUNCREF) = (REF.NULL FUNCREF)
def $default(EXTERNREF) = (REF.NULL EXTERNREF)

Expand Down
1 change: 0 additions & 1 deletion spectec/spec/wasm-2.0/8-reduction.watsup
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ rule Step_pure/vvternop:
-- if $vvternop(vvternop, V128, cv_1, cv_2, cv_3) = cv ;; TODO


def $vzero: c_vectype ;; HACK for algorithmic backend
rule Step_pure/vvtestop:
(VVCONST V128 cv_1) (VVTESTOP V128 (_VV ANY_TRUE)) ~> (CONST I32 i)
-- if i = $ine(128, cv_1, $vzero)
Expand Down
2 changes: 1 addition & 1 deletion spectec/test-prose/TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ default valty_u0
4. If (valty_u0 is F64), then:
a. Return (F64.CONST 0).
5. If (valty_u0 is V128), then:
a. Return (VVCONST V128 0).
a. Return (VVCONST V128 $vzero()).
6. If (valty_u0 is FUNCREF), then:
a. Return (REF.NULL FUNCREF).
7. Assert: Due to validation, (valty_u0 is EXTERNREF).
Expand Down

0 comments on commit fba9908

Please sign in to comment.