@@ -257,44 +257,6 @@ extension NumericInstruction {
257
257
}
258
258
}
259
259
260
- public enum Binary : Equatable {
261
- // binop
262
- case add( NumericType )
263
- case sub( NumericType )
264
- case mul( NumericType )
265
-
266
- // relop
267
- case eq( NumericType )
268
- case ne( NumericType )
269
-
270
- var type : NumericType {
271
- switch self {
272
- case let . add( type) ,
273
- let . sub( type) ,
274
- let . mul( type) ,
275
- let . eq( type) ,
276
- let . ne( type) :
277
- return type
278
- }
279
- }
280
-
281
- func callAsFunction( _ value1: Value , _ value2: Value ) -> Value {
282
- switch self {
283
- case . add:
284
- return value1 + value2
285
- case . sub:
286
- return value1 - value2
287
- case . mul:
288
- return value1 * value2
289
-
290
- case . eq:
291
- return value1 == value2 ? true : false
292
- case . ne:
293
- return value1 == value2 ? false : true
294
- }
295
- }
296
- }
297
-
298
260
public enum IntBinary : Equatable {
299
261
// ibinop
300
262
case divS( IntValueType )
@@ -883,72 +845,3 @@ extension NumericInstruction {
883
845
}
884
846
}
885
847
}
886
- //
887
- //extension NumericInstruction: CustomStringConvertible {
888
- // public var description: String {
889
- // switch self {
890
- // case let .const(v):
891
- // switch v {
892
- // case let .f32(f32): return "f32.const \(f32)"
893
- // case let .f64(f64): return "f64.const \(f64)"
894
- // case let .i32(i32): return "i32.const \(i32.signed)"
895
- // case let .i64(i64): return "i64.const \(i64.signed)"
896
- // case let .ref(.function(f?)): return "ref.func \(f)"
897
- // case .ref(.function(nil)): return "ref.null funcref"
898
- // case .ref(.extern(nil)): return "ref.null externref"
899
- // default: fatalError("unsuppported const instruction for value \(v)")
900
- // }
901
- //
902
- // case let .binary(b):
903
- // switch b {
904
- // case let .add(t):
905
- // return "\(t).add"
906
- //
907
- // case let .eq(t):
908
- // return "\(t).eq"
909
- //
910
- // case let .mul(t):
911
- // return "\(t).mul"
912
- //
913
- // case let .ne(t):
914
- // return "\(t).ne"
915
- //
916
- // case let .sub(t):
917
- // return "\(t).sub"
918
- // }
919
- //
920
- // case let .intBinary(ib):
921
- // switch ib {
922
- // case let .and(it): return "\(it).and"
923
- // case let .xor(it): return "\(it).xor"
924
- // case let .or(it): return "\(it).or"
925
- // case let .shl(it): return "\(it).shl"
926
- // case let .shrS(it): return "\(it).shr_s"
927
- // case let .shrU(it): return "\(it).shr_u"
928
- // case let .rotl(it): return "\(it).rotl"
929
- // case let .rotr(it): return "\(it).rotr"
930
- // case let .remS(it): return "\(it).rem_s"
931
- // case let .remU(it): return "\(it).rem_u"
932
- // case let .divS(it): return "\(it).div_s"
933
- // case let .divU(it): return "\(it).div_u"
934
- // case let .ltS(it): return "\(it).lt_s"
935
- // case let .ltU(it): return "\(it).lt_u"
936
- // case let .gtS(it): return "\(it).gt_s"
937
- // case let .gtU(it): return "\(it).gt_u"
938
- // case let .leS(it): return "\(it).le_s"
939
- // case let .leU(it): return "\(it).le_u"
940
- // case let .geS(it): return "\(it).ge_s"
941
- // case let .geU(it): return "\(it).ge_u"
942
- // }
943
- //
944
- // case let .conversion(c):
945
- // return String(reflecting: c)
946
- // case let .intUnary(iu):
947
- // return String(reflecting: iu)
948
- // case let .floatUnary(fu):
949
- // return String(reflecting: fu)
950
- // case let .floatBinary(fb):
951
- // return String(reflecting: fb)
952
- // }
953
- // }
954
- //}
0 commit comments