@@ -705,7 +705,7 @@ export class Compiler extends DiagnosticEmitter {
705
705
for ( let i = 0 , k = functionTable . length ; i < k ; ++ i ) {
706
706
functionTableNames [ i ] = functionTable [ i ] . internalName ;
707
707
}
708
- module . setFunctionTable ( tableBase + functionTable . length , Module . UNLIMITED_TABLE , functionTableNames , module . i32 ( tableBase ) ) ;
708
+ module . addFunctionTable ( "0" , tableBase + functionTable . length , Module . UNLIMITED_TABLE , functionTableNames , module . i32 ( tableBase ) ) ;
709
709
710
710
// expose the arguments length helper if there are varargs exports
711
711
if ( this . runtimeFeatures & RuntimeFeatures . setArgumentsLength ) {
@@ -3604,14 +3604,14 @@ export class Compiler extends DiagnosticEmitter {
3604
3604
3605
3605
// f32 to f64
3606
3606
if ( toType . kind == TypeKind . F64 ) {
3607
- expr = module . unary ( UnaryOp . PromoteF32 , expr ) ;
3607
+ expr = module . unary ( UnaryOp . PromoteF32ToF64 , expr ) ;
3608
3608
}
3609
3609
3610
3610
// otherwise f32 to f32
3611
3611
3612
3612
// f64 to f32
3613
3613
} else if ( toType . kind == TypeKind . F32 ) {
3614
- expr = module . unary ( UnaryOp . DemoteF64 , expr ) ;
3614
+ expr = module . unary ( UnaryOp . DemoteF64ToF32 , expr ) ;
3615
3615
}
3616
3616
3617
3617
// otherwise f64 to f64
@@ -3626,16 +3626,16 @@ export class Compiler extends DiagnosticEmitter {
3626
3626
} else if ( toType . isSignedIntegerValue ) {
3627
3627
let saturating = this . options . hasFeature ( Feature . NONTRAPPING_F2I ) ;
3628
3628
if ( toType . isLongIntegerValue ) {
3629
- expr = module . unary ( saturating ? UnaryOp . TruncF32ToI64Sat : UnaryOp . TruncF32ToI64 , expr ) ;
3629
+ expr = module . unary ( saturating ? UnaryOp . TruncSatF32ToI64 : UnaryOp . TruncF32ToI64 , expr ) ;
3630
3630
} else {
3631
- expr = module . unary ( saturating ? UnaryOp . TruncF32ToI32Sat : UnaryOp . TruncF32ToI32 , expr ) ;
3631
+ expr = module . unary ( saturating ? UnaryOp . TruncSatF32ToI32 : UnaryOp . TruncF32ToI32 , expr ) ;
3632
3632
}
3633
3633
} else {
3634
3634
let saturating = this . options . hasFeature ( Feature . NONTRAPPING_F2I ) ;
3635
3635
if ( toType . isLongIntegerValue ) {
3636
- expr = module . unary ( saturating ? UnaryOp . TruncF32ToU64Sat : UnaryOp . TruncF32ToU64 , expr ) ;
3636
+ expr = module . unary ( saturating ? UnaryOp . TruncSatF32ToU64 : UnaryOp . TruncF32ToU64 , expr ) ;
3637
3637
} else {
3638
- expr = module . unary ( saturating ? UnaryOp . TruncF32ToU32Sat : UnaryOp . TruncF32ToU32 , expr ) ;
3638
+ expr = module . unary ( saturating ? UnaryOp . TruncSatF32ToU32 : UnaryOp . TruncF32ToU32 , expr ) ;
3639
3639
}
3640
3640
}
3641
3641
@@ -3646,16 +3646,16 @@ export class Compiler extends DiagnosticEmitter {
3646
3646
} else if ( toType . isSignedIntegerValue ) {
3647
3647
let saturating = this . options . hasFeature ( Feature . NONTRAPPING_F2I ) ;
3648
3648
if ( toType . isLongIntegerValue ) {
3649
- expr = module . unary ( saturating ? UnaryOp . TruncF64ToI64Sat : UnaryOp . TruncF64ToI64 , expr ) ;
3649
+ expr = module . unary ( saturating ? UnaryOp . TruncSatF64ToI64 : UnaryOp . TruncF64ToI64 , expr ) ;
3650
3650
} else {
3651
- expr = module . unary ( saturating ? UnaryOp . TruncF64ToI32Sat : UnaryOp . TruncF64ToI32 , expr ) ;
3651
+ expr = module . unary ( saturating ? UnaryOp . TruncSatF64ToI32 : UnaryOp . TruncF64ToI32 , expr ) ;
3652
3652
}
3653
3653
} else {
3654
3654
let saturating = this . options . hasFeature ( Feature . NONTRAPPING_F2I ) ;
3655
3655
if ( toType . isLongIntegerValue ) {
3656
- expr = module . unary ( saturating ? UnaryOp . TruncF64ToU64Sat : UnaryOp . TruncF64ToU64 , expr ) ;
3656
+ expr = module . unary ( saturating ? UnaryOp . TruncSatF64ToU64 : UnaryOp . TruncF64ToU64 , expr ) ;
3657
3657
} else {
3658
- expr = module . unary ( saturating ? UnaryOp . TruncF64ToU32Sat : UnaryOp . TruncF64ToU32 , expr ) ;
3658
+ expr = module . unary ( saturating ? UnaryOp . TruncSatF64ToU32 : UnaryOp . TruncF64ToU32 , expr ) ;
3659
3659
}
3660
3660
}
3661
3661
}
@@ -3715,13 +3715,13 @@ export class Compiler extends DiagnosticEmitter {
3715
3715
if ( toType . isBooleanValue ) {
3716
3716
expr = module . binary ( BinaryOp . NeI64 , expr , module . i64 ( 0 ) ) ;
3717
3717
} else if ( ! toType . isLongIntegerValue ) {
3718
- expr = module . unary ( UnaryOp . WrapI64 , expr ) ; // discards upper bits
3718
+ expr = module . unary ( UnaryOp . WrapI64ToI32 , expr ) ; // discards upper bits
3719
3719
}
3720
3720
3721
3721
// i32 or smaller to i64
3722
3722
} else if ( toType . isLongIntegerValue ) {
3723
3723
expr = module . unary (
3724
- fromType . isSignedIntegerValue ? UnaryOp . ExtendI32 : UnaryOp . ExtendU32 ,
3724
+ fromType . isSignedIntegerValue ? UnaryOp . ExtendI32ToI64 : UnaryOp . ExtendU32ToU64 ,
3725
3725
this . ensureSmallIntegerWrap ( expr , fromType ) // must clear garbage bits
3726
3726
) ;
3727
3727
@@ -5013,7 +5013,7 @@ export class Compiler extends DiagnosticEmitter {
5013
5013
return module . binary ( BinaryOp . NeF64 , leftExpr , rightExpr ) ;
5014
5014
}
5015
5015
case TypeKind . V128 : {
5016
- return module . unary ( UnaryOp . AnyTrueI8x16 ,
5016
+ return module . unary ( UnaryOp . AnyTrueV128 ,
5017
5017
module . binary ( BinaryOp . NeI8x16 , leftExpr , rightExpr )
5018
5018
) ;
5019
5019
}
@@ -9827,7 +9827,7 @@ export class Compiler extends DiagnosticEmitter {
9827
9827
case TypeKind . I8 : {
9828
9828
if ( flow . canOverflow ( expr , type ) ) {
9829
9829
expr = this . options . hasFeature ( Feature . SIGN_EXTENSION )
9830
- ? module . unary ( UnaryOp . ExtendI8ToI32 , expr )
9830
+ ? module . unary ( UnaryOp . Extend8I32 , expr )
9831
9831
: module . binary ( BinaryOp . ShrI32 ,
9832
9832
module . binary ( BinaryOp . ShlI32 ,
9833
9833
expr ,
@@ -9841,7 +9841,7 @@ export class Compiler extends DiagnosticEmitter {
9841
9841
case TypeKind . I16 : {
9842
9842
if ( flow . canOverflow ( expr , type ) ) {
9843
9843
expr = this . options . hasFeature ( Feature . SIGN_EXTENSION )
9844
- ? module . unary ( UnaryOp . ExtendI16ToI32 , expr )
9844
+ ? module . unary ( UnaryOp . Extend16I32 , expr )
9845
9845
: module . binary ( BinaryOp . ShrI32 ,
9846
9846
module . binary ( BinaryOp . ShlI32 ,
9847
9847
expr ,
@@ -10101,7 +10101,7 @@ export class Compiler extends DiagnosticEmitter {
10101
10101
return module . binary ( BinaryOp . LeU32 ,
10102
10102
module . binary ( BinaryOp . SubI32 ,
10103
10103
module . binary ( BinaryOp . ShlI32 ,
10104
- module . unary ( UnaryOp . ReinterpretF32 , expr ) ,
10104
+ module . unary ( UnaryOp . ReinterpretF32ToI32 , expr ) ,
10105
10105
module . i32 ( 1 )
10106
10106
) ,
10107
10107
module . i32 ( 2 ) // 1 << 1
@@ -10118,7 +10118,7 @@ export class Compiler extends DiagnosticEmitter {
10118
10118
return module . binary ( BinaryOp . LeU64 ,
10119
10119
module . binary ( BinaryOp . SubI64 ,
10120
10120
module . binary ( BinaryOp . ShlI64 ,
10121
- module . unary ( UnaryOp . ReinterpretF64 , expr ) ,
10121
+ module . unary ( UnaryOp . ReinterpretF64ToI64 , expr ) ,
10122
10122
module . i64 ( 1 )
10123
10123
) ,
10124
10124
module . i64 ( 2 ) // 1 << 1
0 commit comments