@@ -13797,6 +13797,45 @@ namespace ProviderImplementation.ProvidedTypes
13797
13797
| _ ->
13798
13798
invalidArg "templateParameter" "The parameter is not a recognized method name"
13799
13799
13800
+ let (|LessThan|_|) = (|SpecificCall|_|) <@ (<) @>
13801
+ let (|GreaterThan|_|) = (|SpecificCall|_|) <@ (>) @>
13802
+ let (|LessThanOrEqual|_|) = (|SpecificCall|_|) <@ (<=) @>
13803
+ let (|GreaterThanOrEqual|_|) = (|SpecificCall|_|) <@ (>=) @>
13804
+ let (|Equals|_|) = (|SpecificCall|_|) <@ (=) @>
13805
+ let (|NotEquals|_|) = (|SpecificCall|_|) <@ (<>) @>
13806
+ let (|Multiply|_|) = (|SpecificCall|_|) <@ (*) @>
13807
+ let (|Addition|_|) = (|SpecificCall|_|) <@ (+) @>
13808
+ let (|Subtraction|_|) = (|SpecificCall|_|) <@ (-) @>
13809
+ let (|UnaryNegation|_|) = (|SpecificCall|_|) <@ (~-) @>
13810
+ let (|Division|_|) = (|SpecificCall|_|) <@ (/) @>
13811
+ let (|UnaryPlus|_|) = (|SpecificCall|_|) <@ (~+) @>
13812
+ let (|Modulus|_|) = (|SpecificCall|_|) <@ (%) @>
13813
+ let (|LeftShift|_|) = (|SpecificCall|_|) <@ (<<<) @>
13814
+ let (|RightShift|_|) = (|SpecificCall|_|) <@ (>>>) @>
13815
+ let (|And|_|) = (|SpecificCall|_|) <@ (&&&) @>
13816
+ let (|Or|_|) = (|SpecificCall|_|) <@ (|||) @>
13817
+ let (|Xor|_|) = (|SpecificCall|_|) <@ (^^^) @>
13818
+ let (|Not|_|) = (|SpecificCall|_|) <@ (~~~) @>
13819
+ let (|CallByte|_|) = (|SpecificCall|_|) <@ byte @>
13820
+ let (|CallSByte|_|) = (|SpecificCall|_|) <@ sbyte @>
13821
+ let (|CallUInt16|_|) = (|SpecificCall|_|) <@ uint16 @>
13822
+ let (|CallInt16|_|) = (|SpecificCall|_|) <@ int16 @>
13823
+ let (|CallUInt32|_|) = (|SpecificCall|_|) <@ uint32 @>
13824
+ let (|CallInt|_|) = (|SpecificCall|_|) <@ int @>
13825
+ let (|CallInt32|_|) = (|SpecificCall|_|) <@ int32 @>
13826
+ let (|CallUInt64|_|) = (|SpecificCall|_|) <@ uint64 @>
13827
+ let (|CallInt64|_|) = (|SpecificCall|_|) <@ int64 @>
13828
+ let (|CallSingle|_|) = (|SpecificCall|_|) <@ single @>
13829
+ let (|CallFloat32|_|) = (|SpecificCall|_|) <@ float32 @>
13830
+ let (|CallDouble|_|) = (|SpecificCall|_|) <@ double @>
13831
+ let (|CallFloat|_|) = (|SpecificCall|_|) <@ float @>
13832
+ let (|CallDecimal|_|) = (|SpecificCall|_|) <@ decimal @>
13833
+ let (|CallChar|_|) = (|SpecificCall|_|) <@ char @>
13834
+ let (|Ignore|_|) = (|SpecificCall|_|) <@ ignore @>
13835
+ let (|GetArray|_|) = (|SpecificCall|_|) <@ LanguagePrimitives.IntrinsicFunctions.GetArray @>
13836
+ let (|GetArray2D|_|) = (|SpecificCall|_|) <@ LanguagePrimitives.IntrinsicFunctions.GetArray2D @>
13837
+ let (|GetArray3D|_|) = (|SpecificCall|_|) <@ LanguagePrimitives.IntrinsicFunctions.GetArray3D @>
13838
+ let (|GetArray4D|_|) = (|SpecificCall|_|) <@ LanguagePrimitives.IntrinsicFunctions.GetArray4D @>
13800
13839
13801
13840
let isEmpty s = (s = ExpectedStackState.Empty)
13802
13841
let isAddress s = (s = ExpectedStackState.Address)
@@ -13962,7 +14001,7 @@ namespace ProviderImplementation.ProvidedTypes
13962
14001
13963
14002
popIfEmptyExpected expectedState
13964
14003
13965
- | SpecificCall <@ (<) @> (None, [t1], [a1; a2]) ->
14004
+ | LessThan (None, [t1], [a1; a2]) ->
13966
14005
emitExpr ExpectedStackState.Value a1
13967
14006
emitExpr ExpectedStackState.Value a2
13968
14007
match t1 with
@@ -13980,7 +14019,7 @@ namespace ProviderImplementation.ProvidedTypes
13980
14019
| _ -> failwithf "Operator (<) not supported for type %s" t1.Name
13981
14020
13982
14021
13983
- | SpecificCall <@ (>) @> (None, [t1], [a1; a2]) ->
14022
+ | GreaterThan (None, [t1], [a1; a2]) ->
13984
14023
emitExpr ExpectedStackState.Value a1
13985
14024
emitExpr ExpectedStackState.Value a2
13986
14025
match t1 with
@@ -13998,7 +14037,7 @@ namespace ProviderImplementation.ProvidedTypes
13998
14037
| _ -> failwithf "Operator (>) not supported for type %s" t1.Name
13999
14038
14000
14039
14001
- | SpecificCall <@ (<=) @> (None, [t1], [a1; a2]) ->
14040
+ | LessThanOrEqual (None, [t1], [a1; a2]) ->
14002
14041
emitExpr ExpectedStackState.Value a1
14003
14042
emitExpr ExpectedStackState.Value a2
14004
14043
match t1 with
@@ -14024,7 +14063,7 @@ namespace ProviderImplementation.ProvidedTypes
14024
14063
| _ -> failwithf "Operator (<=) not supported for type %s" t1.Name
14025
14064
14026
14065
14027
- | SpecificCall <@ (>=) @> (None, [t1], [a1; a2]) ->
14066
+ | GreaterThanOrEqual (None, [t1], [a1; a2]) ->
14028
14067
emitExpr ExpectedStackState.Value a1
14029
14068
emitExpr ExpectedStackState.Value a2
14030
14069
match t1 with
@@ -14049,7 +14088,7 @@ namespace ProviderImplementation.ProvidedTypes
14049
14088
ilg.Emit(I_call(Normalcall, transMeth m, None))
14050
14089
| _ -> failwithf "Operator (>=) not supported for type %s" t1.Name
14051
14090
14052
- | SpecificCall <@ (=) @> (None, [t1], [a1; a2]) ->
14091
+ | Equals (None, [t1], [a1; a2]) ->
14053
14092
emitExpr ExpectedStackState.Value a1
14054
14093
emitExpr ExpectedStackState.Value a2
14055
14094
match t1 with
@@ -14064,7 +14103,7 @@ namespace ProviderImplementation.ProvidedTypes
14064
14103
ilg.Emit(I_call(Normalcall, transMeth m, None))
14065
14104
| _ -> failwithf "Operator (=) not supported for type %s" t1.Name
14066
14105
14067
- | SpecificCall <@ (<>) @> (None, [t1], [a1; a2]) ->
14106
+ | NotEquals (None, [t1], [a1; a2]) ->
14068
14107
emitExpr ExpectedStackState.Value a1
14069
14108
emitExpr ExpectedStackState.Value a2
14070
14109
match t1 with
@@ -14084,7 +14123,7 @@ namespace ProviderImplementation.ProvidedTypes
14084
14123
ilg.Emit(I_call(Normalcall, transMeth m, None))
14085
14124
| _ -> failwithf "Operator (<>) not supported for type %s" t1.Name
14086
14125
14087
- | SpecificCall <@ (*) @> (None, [t1; t2; _], [a1; a2]) ->
14126
+ | Multiply (None, [t1; t2; _], [a1; a2]) ->
14088
14127
emitExpr ExpectedStackState.Value a1
14089
14128
emitExpr ExpectedStackState.Value a2
14090
14129
match t1 with
@@ -14098,7 +14137,7 @@ namespace ProviderImplementation.ProvidedTypes
14098
14137
| _ -> failwithf "Operator (*) not supported for type %s" t1.Name
14099
14138
emitConvIfNecessary t1
14100
14139
14101
- | SpecificCall <@ (+) @> (None, [t1; t2; _], [a1; a2]) ->
14140
+ | Addition (None, [t1; t2; _], [a1; a2]) ->
14102
14141
emitExpr ExpectedStackState.Value a1
14103
14142
emitExpr ExpectedStackState.Value a2
14104
14143
match t1 with
@@ -14115,7 +14154,7 @@ namespace ProviderImplementation.ProvidedTypes
14115
14154
| _ -> failwithf "Operator (+) not supported for type %s" t1.Name
14116
14155
emitConvIfNecessary t1
14117
14156
14118
- | SpecificCall <@ (-) @> (None, [t1; t2; _], [a1; a2]) ->
14157
+ | Subtraction (None, [t1; t2; _], [a1; a2]) ->
14119
14158
emitExpr ExpectedStackState.Value a1
14120
14159
emitExpr ExpectedStackState.Value a2
14121
14160
match t1 with
@@ -14129,7 +14168,7 @@ namespace ProviderImplementation.ProvidedTypes
14129
14168
| _ -> failwithf "Operator (-) not supported for type %s" t1.Name
14130
14169
emitConvIfNecessary t1
14131
14170
14132
- | SpecificCall <@ (~-) @> (None, [t1], [a1]) ->
14171
+ | UnaryNegation (None, [t1], [a1]) ->
14133
14172
emitExpr ExpectedStackState.Value a1
14134
14173
match t1 with
14135
14174
| SByte
@@ -14140,7 +14179,7 @@ namespace ProviderImplementation.ProvidedTypes
14140
14179
ilg.Emit(I_call(Normalcall, transMeth m, None))
14141
14180
| _ -> failwithf "Operator (~-) not supported for type %s" t1.Name
14142
14181
14143
- | SpecificCall <@ (/) @> (None, [t1; t2; _], [a1; a2]) ->
14182
+ | Division (None, [t1; t2; _], [a1; a2]) ->
14144
14183
emitExpr ExpectedStackState.Value a1
14145
14184
emitExpr ExpectedStackState.Value a2
14146
14185
match t1 with
@@ -14154,15 +14193,15 @@ namespace ProviderImplementation.ProvidedTypes
14154
14193
| _ -> failwithf "Operator (/) not supported for type %s" t1.Name
14155
14194
emitConvIfNecessary t1
14156
14195
14157
- | SpecificCall <@ (~+) @> (None, [t1], [a1]) ->
14196
+ | UnaryPlus (None, [t1], [a1]) ->
14158
14197
match t1.GetMethod("op_UnaryPlus", [|t1|]) with
14159
14198
| null ->
14160
14199
emitExpr expectedState a1
14161
14200
| m ->
14162
14201
emitExpr ExpectedStackState.Value a1
14163
14202
ilg.Emit(I_call(Normalcall, transMeth m, None))
14164
14203
14165
- | SpecificCall <@ (%) @> (None, [t1; t2; _], [a1; a2]) ->
14204
+ | Modulus (None, [t1; t2; _], [a1; a2]) ->
14166
14205
emitExpr ExpectedStackState.Value a1
14167
14206
emitExpr ExpectedStackState.Value a2
14168
14207
match t1 with
@@ -14176,7 +14215,7 @@ namespace ProviderImplementation.ProvidedTypes
14176
14215
| _ -> failwithf "Operator (%%) not supported for type %s" t1.Name
14177
14216
emitConvIfNecessary t1
14178
14217
14179
- | SpecificCall <@ (<<<) @> (None, [t1], [a1; a2]) ->
14218
+ | LeftShift (None, [t1], [a1; a2]) ->
14180
14219
emitExpr ExpectedStackState.Value a1
14181
14220
let maskShift (x : int) =
14182
14221
match a2 with
@@ -14197,7 +14236,7 @@ namespace ProviderImplementation.ProvidedTypes
14197
14236
| _ -> failwithf "Operator (<<<) not supported for type %s" t1.Name
14198
14237
emitConvIfNecessary t1
14199
14238
14200
- | SpecificCall <@ (>>>) @> (None, [t1], [a1; a2]) ->
14239
+ | RightShift (None, [t1], [a1; a2]) ->
14201
14240
emitExpr ExpectedStackState.Value a1
14202
14241
let maskShift (x : int) =
14203
14242
match a2 with
@@ -14218,7 +14257,7 @@ namespace ProviderImplementation.ProvidedTypes
14218
14257
| _ -> failwithf "Operator (>>>) not supported for type %s" t1.Name
14219
14258
emitConvIfNecessary t1
14220
14259
14221
- | SpecificCall <@ (&&&) @> (None, [t1], [a1; a2]) ->
14260
+ | And (None, [t1], [a1; a2]) ->
14222
14261
emitExpr ExpectedStackState.Value a1
14223
14262
emitExpr ExpectedStackState.Value a2
14224
14263
match t1 with
@@ -14230,7 +14269,7 @@ namespace ProviderImplementation.ProvidedTypes
14230
14269
ilg.Emit(I_call(Normalcall, transMeth m, None))
14231
14270
| _ -> failwithf "Operator (&&&) not supported for type %s" t1.Name
14232
14271
14233
- | SpecificCall <@ (|||) @> (None, [t1], [a1; a2]) ->
14272
+ | Or (None, [t1], [a1; a2]) ->
14234
14273
emitExpr ExpectedStackState.Value a1
14235
14274
emitExpr ExpectedStackState.Value a2
14236
14275
match t1 with
@@ -14242,7 +14281,7 @@ namespace ProviderImplementation.ProvidedTypes
14242
14281
ilg.Emit(I_call(Normalcall, transMeth m, None))
14243
14282
| _ -> failwithf "Operator (|||) not supported for type %s" t1.Name
14244
14283
14245
- | SpecificCall <@ (^^^) @> (None, [t1], [a1; a2]) ->
14284
+ | Xor (None, [t1], [a1; a2]) ->
14246
14285
emitExpr ExpectedStackState.Value a1
14247
14286
emitExpr ExpectedStackState.Value a2
14248
14287
match t1 with
@@ -14254,7 +14293,7 @@ namespace ProviderImplementation.ProvidedTypes
14254
14293
ilg.Emit(I_call(Normalcall, transMeth m, None))
14255
14294
| _ -> failwithf "Operator (^^^) not supported for type %s" t1.Name
14256
14295
14257
- | SpecificCall <@ (~~~) @> (None, [t1], [a1]) ->
14296
+ | Not (None, [t1], [a1]) ->
14258
14297
emitExpr ExpectedStackState.Value a1
14259
14298
match t1 with
14260
14299
| Int32 | UInt32
@@ -14265,7 +14304,7 @@ namespace ProviderImplementation.ProvidedTypes
14265
14304
ilg.Emit(I_call(Normalcall, transMeth m, None))
14266
14305
| _ -> failwithf "Operator (~~~) not supported for type %s" t1.Name
14267
14306
14268
- | SpecificCall <@ byte @> (None, [t1], [a1]) ->
14307
+ | CallByte (None, [t1], [a1]) ->
14269
14308
emitExpr ExpectedStackState.Value a1
14270
14309
match t1 with
14271
14310
| Char
@@ -14282,7 +14321,7 @@ namespace ProviderImplementation.ProvidedTypes
14282
14321
ilg.Emit(I_call(Normalcall, transMeth m, None))
14283
14322
| _ -> failwithf "Operator 'byte' not supported for type %s" t1.Name
14284
14323
14285
- | SpecificCall <@ sbyte @> (None, [t1], [a1]) ->
14324
+ | CallSByte (None, [t1], [a1]) ->
14286
14325
emitExpr ExpectedStackState.Value a1
14287
14326
match t1 with
14288
14327
| Char
@@ -14299,7 +14338,7 @@ namespace ProviderImplementation.ProvidedTypes
14299
14338
ilg.Emit(I_call(Normalcall, transMeth m, None))
14300
14339
| _ -> failwithf "Operator 'sbyte' not supported for type %s" t1.Name
14301
14340
14302
- | SpecificCall <@ uint16 @> (None, [t1], [a1]) ->
14341
+ | CallUInt16 (None, [t1], [a1]) ->
14303
14342
emitExpr ExpectedStackState.Value a1
14304
14343
match t1 with
14305
14344
| Char
@@ -14316,7 +14355,7 @@ namespace ProviderImplementation.ProvidedTypes
14316
14355
ilg.Emit(I_call(Normalcall, transMeth m, None))
14317
14356
| _ -> failwithf "Operator 'uint16' not supported for type %s" t1.Name
14318
14357
14319
- | SpecificCall <@ int16 @> (None, [t1], [a1]) ->
14358
+ | CallInt16 (None, [t1], [a1]) ->
14320
14359
emitExpr ExpectedStackState.Value a1
14321
14360
match t1 with
14322
14361
| Char
@@ -14333,7 +14372,7 @@ namespace ProviderImplementation.ProvidedTypes
14333
14372
ilg.Emit(I_call(Normalcall, transMeth m, None))
14334
14373
| _ -> failwithf "Operator 'int16' not supported for type %s" t1.Name
14335
14374
14336
- | SpecificCall <@ uint32 @> (None, [t1], [a1]) ->
14375
+ | CallUInt32 (None, [t1], [a1]) ->
14337
14376
emitExpr ExpectedStackState.Value a1
14338
14377
match t1 with
14339
14378
| Char
@@ -14349,8 +14388,8 @@ namespace ProviderImplementation.ProvidedTypes
14349
14388
ilg.Emit(I_call(Normalcall, transMeth m, None))
14350
14389
| _ -> failwithf "Operator 'uint32' not supported for type %s" t1.Name
14351
14390
14352
- | SpecificCall <@ int @> (None, [t1], [a1])
14353
- | SpecificCall <@ int32 @> (None, [t1], [a1]) ->
14391
+ | CallInt (None, [t1], [a1])
14392
+ | CallInt32 (None, [t1], [a1]) ->
14354
14393
emitExpr ExpectedStackState.Value a1
14355
14394
match t1 with
14356
14395
| Char
@@ -14366,7 +14405,7 @@ namespace ProviderImplementation.ProvidedTypes
14366
14405
ilg.Emit(I_call(Normalcall, transMeth m, None))
14367
14406
| _ -> failwithf "Operator 'int32' not supported for type %s" t1.Name
14368
14407
14369
- | SpecificCall <@ uint64 @> (None, [t1], [a1]) ->
14408
+ | CallUInt64 (None, [t1], [a1]) ->
14370
14409
emitExpr ExpectedStackState.Value a1
14371
14410
match t1 with
14372
14411
| Char
@@ -14382,7 +14421,7 @@ namespace ProviderImplementation.ProvidedTypes
14382
14421
ilg.Emit(I_call(Normalcall, transMeth m, None))
14383
14422
| _ -> failwithf "Operator 'uint64' not supported for type %s" t1.Name
14384
14423
14385
- | SpecificCall <@ int64 @> (None, [t1], [a1]) ->
14424
+ | CallInt64 (None, [t1], [a1]) ->
14386
14425
emitExpr ExpectedStackState.Value a1
14387
14426
match t1 with
14388
14427
| Double | Single
@@ -14398,8 +14437,8 @@ namespace ProviderImplementation.ProvidedTypes
14398
14437
ilg.Emit(I_call(Normalcall, transMeth m, None))
14399
14438
| _ -> failwithf "Operator 'int64' not supported for type %s" t1.Name
14400
14439
14401
- | SpecificCall <@ single @> (None, [t1], [a1])
14402
- | SpecificCall <@ float32 @> (None, [t1], [a1]) ->
14440
+ | CallSingle (None, [t1], [a1])
14441
+ | CallFloat32 (None, [t1], [a1]) ->
14403
14442
emitExpr ExpectedStackState.Value a1
14404
14443
match t1 with
14405
14444
| Double | Single
@@ -14416,8 +14455,8 @@ namespace ProviderImplementation.ProvidedTypes
14416
14455
ilg.Emit(I_call(Normalcall, transMeth m, None))
14417
14456
| _ -> failwithf "Operator 'float32' not supported for type %s" t1.Name
14418
14457
14419
- | SpecificCall <@ double @> (None, [t1], [a1])
14420
- | SpecificCall <@ float @> (None, [t1], [a1]) ->
14458
+ | CallDouble (None, [t1], [a1])
14459
+ | CallFloat (None, [t1], [a1]) ->
14421
14460
emitExpr ExpectedStackState.Value a1
14422
14461
match t1 with
14423
14462
| Double | Single
@@ -14434,7 +14473,7 @@ namespace ProviderImplementation.ProvidedTypes
14434
14473
ilg.Emit(I_call(Normalcall, transMeth m, None))
14435
14474
| _ -> failwithf "Operator 'float' not supported for type %s" t1.Name
14436
14475
14437
- | SpecificCall <@ decimal @> (None, [t1], [a1]) ->
14476
+ | CallDecimal (None, [t1], [a1]) ->
14438
14477
emitExpr ExpectedStackState.Value a1
14439
14478
let rtTgt = decimalTypeTgt
14440
14479
if t1 = stringTypeTgt then
@@ -14457,7 +14496,7 @@ namespace ProviderImplementation.ProvidedTypes
14457
14496
ilg.Emit(I_call(Normalcall, transMeth m, None))
14458
14497
| toDecimal -> ilg.Emit(I_call(Normalcall, transMeth toDecimal, None))
14459
14498
14460
- | SpecificCall <@ char @> (None, [t1], [a1]) ->
14499
+ | CallChar (None, [t1], [a1]) ->
14461
14500
emitExpr ExpectedStackState.Value a1
14462
14501
match t1 with
14463
14502
| Double | Single
@@ -14472,9 +14511,9 @@ namespace ProviderImplementation.ProvidedTypes
14472
14511
ilg.Emit(I_call(Normalcall, transMeth m, None))
14473
14512
| _ -> failwithf "Operator 'char' not supported for type %s" t1.Name
14474
14513
14475
- | SpecificCall <@ ignore @> (None, [t1], [a1]) -> emitExpr expectedState a1
14514
+ | Ignore (None, [t1], [a1]) -> emitExpr expectedState a1
14476
14515
14477
- | SpecificCall <@ LanguagePrimitives.IntrinsicFunctions. GetArray @> (None, [ty], [arr; index]) ->
14516
+ | GetArray(None, [ty], [arr; index]) ->
14478
14517
// observable side-effect - IndexOutOfRangeException
14479
14518
emitExpr ExpectedStackState.Value arr
14480
14519
emitExpr ExpectedStackState.Value index
@@ -14485,9 +14524,9 @@ namespace ProviderImplementation.ProvidedTypes
14485
14524
14486
14525
popIfEmptyExpected expectedState
14487
14526
14488
- | SpecificCall <@ LanguagePrimitives.IntrinsicFunctions. GetArray2D @> (None, _ty, arr::indices)
14489
- | SpecificCall <@ LanguagePrimitives.IntrinsicFunctions. GetArray3D @> (None, _ty, arr::indices)
14490
- | SpecificCall <@ LanguagePrimitives.IntrinsicFunctions. GetArray4D @> (None, _ty, arr::indices) ->
14527
+ | GetArray2D(None, _ty, arr::indices)
14528
+ | GetArray3D(None, _ty, arr::indices)
14529
+ | GetArray4D(None, _ty, arr::indices) ->
14491
14530
14492
14531
let meth =
14493
14532
let name = if isAddress expectedState then "Address" else "Get"
0 commit comments