@@ -9801,6 +9801,19 @@ func rewriteValuegeneric_OpRsh8x8(v *Value, config *Config) bool {
9801
9801
func rewriteValuegeneric_OpSignExt16to32 (v * Value , config * Config ) bool {
9802
9802
b := v .Block
9803
9803
_ = b
9804
+ // match: (SignExt16to32 (Const16 [c]))
9805
+ // cond:
9806
+ // result: (Const32 [int64( int16(c))])
9807
+ for {
9808
+ v_0 := v .Args [0 ]
9809
+ if v_0 .Op != OpConst16 {
9810
+ break
9811
+ }
9812
+ c := v_0 .AuxInt
9813
+ v .reset (OpConst32 )
9814
+ v .AuxInt = int64 (int16 (c ))
9815
+ return true
9816
+ }
9804
9817
// match: (SignExt16to32 (Trunc32to16 x:(Rsh32x64 _ (Const64 [s]))))
9805
9818
// cond: s >= 16
9806
9819
// result: x
@@ -9831,6 +9844,19 @@ func rewriteValuegeneric_OpSignExt16to32(v *Value, config *Config) bool {
9831
9844
func rewriteValuegeneric_OpSignExt16to64 (v * Value , config * Config ) bool {
9832
9845
b := v .Block
9833
9846
_ = b
9847
+ // match: (SignExt16to64 (Const16 [c]))
9848
+ // cond:
9849
+ // result: (Const64 [int64( int16(c))])
9850
+ for {
9851
+ v_0 := v .Args [0 ]
9852
+ if v_0 .Op != OpConst16 {
9853
+ break
9854
+ }
9855
+ c := v_0 .AuxInt
9856
+ v .reset (OpConst64 )
9857
+ v .AuxInt = int64 (int16 (c ))
9858
+ return true
9859
+ }
9834
9860
// match: (SignExt16to64 (Trunc64to16 x:(Rsh64x64 _ (Const64 [s]))))
9835
9861
// cond: s >= 48
9836
9862
// result: x
@@ -9861,6 +9887,19 @@ func rewriteValuegeneric_OpSignExt16to64(v *Value, config *Config) bool {
9861
9887
func rewriteValuegeneric_OpSignExt32to64 (v * Value , config * Config ) bool {
9862
9888
b := v .Block
9863
9889
_ = b
9890
+ // match: (SignExt32to64 (Const32 [c]))
9891
+ // cond:
9892
+ // result: (Const64 [int64( int32(c))])
9893
+ for {
9894
+ v_0 := v .Args [0 ]
9895
+ if v_0 .Op != OpConst32 {
9896
+ break
9897
+ }
9898
+ c := v_0 .AuxInt
9899
+ v .reset (OpConst64 )
9900
+ v .AuxInt = int64 (int32 (c ))
9901
+ return true
9902
+ }
9864
9903
// match: (SignExt32to64 (Trunc64to32 x:(Rsh64x64 _ (Const64 [s]))))
9865
9904
// cond: s >= 32
9866
9905
// result: x
@@ -9891,6 +9930,19 @@ func rewriteValuegeneric_OpSignExt32to64(v *Value, config *Config) bool {
9891
9930
func rewriteValuegeneric_OpSignExt8to16 (v * Value , config * Config ) bool {
9892
9931
b := v .Block
9893
9932
_ = b
9933
+ // match: (SignExt8to16 (Const8 [c]))
9934
+ // cond:
9935
+ // result: (Const16 [int64( int8(c))])
9936
+ for {
9937
+ v_0 := v .Args [0 ]
9938
+ if v_0 .Op != OpConst8 {
9939
+ break
9940
+ }
9941
+ c := v_0 .AuxInt
9942
+ v .reset (OpConst16 )
9943
+ v .AuxInt = int64 (int8 (c ))
9944
+ return true
9945
+ }
9894
9946
// match: (SignExt8to16 (Trunc16to8 x:(Rsh16x64 _ (Const64 [s]))))
9895
9947
// cond: s >= 8
9896
9948
// result: x
@@ -9921,6 +9973,19 @@ func rewriteValuegeneric_OpSignExt8to16(v *Value, config *Config) bool {
9921
9973
func rewriteValuegeneric_OpSignExt8to32 (v * Value , config * Config ) bool {
9922
9974
b := v .Block
9923
9975
_ = b
9976
+ // match: (SignExt8to32 (Const8 [c]))
9977
+ // cond:
9978
+ // result: (Const32 [int64( int8(c))])
9979
+ for {
9980
+ v_0 := v .Args [0 ]
9981
+ if v_0 .Op != OpConst8 {
9982
+ break
9983
+ }
9984
+ c := v_0 .AuxInt
9985
+ v .reset (OpConst32 )
9986
+ v .AuxInt = int64 (int8 (c ))
9987
+ return true
9988
+ }
9924
9989
// match: (SignExt8to32 (Trunc32to8 x:(Rsh32x64 _ (Const64 [s]))))
9925
9990
// cond: s >= 24
9926
9991
// result: x
@@ -9951,6 +10016,19 @@ func rewriteValuegeneric_OpSignExt8to32(v *Value, config *Config) bool {
9951
10016
func rewriteValuegeneric_OpSignExt8to64 (v * Value , config * Config ) bool {
9952
10017
b := v .Block
9953
10018
_ = b
10019
+ // match: (SignExt8to64 (Const8 [c]))
10020
+ // cond:
10021
+ // result: (Const64 [int64( int8(c))])
10022
+ for {
10023
+ v_0 := v .Args [0 ]
10024
+ if v_0 .Op != OpConst8 {
10025
+ break
10026
+ }
10027
+ c := v_0 .AuxInt
10028
+ v .reset (OpConst64 )
10029
+ v .AuxInt = int64 (int8 (c ))
10030
+ return true
10031
+ }
9954
10032
// match: (SignExt8to64 (Trunc64to8 x:(Rsh64x64 _ (Const64 [s]))))
9955
10033
// cond: s >= 56
9956
10034
// result: x
@@ -12225,6 +12303,19 @@ func rewriteValuegeneric_OpZero(v *Value, config *Config) bool {
12225
12303
func rewriteValuegeneric_OpZeroExt16to32 (v * Value , config * Config ) bool {
12226
12304
b := v .Block
12227
12305
_ = b
12306
+ // match: (ZeroExt16to32 (Const16 [c]))
12307
+ // cond:
12308
+ // result: (Const32 [int64(uint16(c))])
12309
+ for {
12310
+ v_0 := v .Args [0 ]
12311
+ if v_0 .Op != OpConst16 {
12312
+ break
12313
+ }
12314
+ c := v_0 .AuxInt
12315
+ v .reset (OpConst32 )
12316
+ v .AuxInt = int64 (uint16 (c ))
12317
+ return true
12318
+ }
12228
12319
// match: (ZeroExt16to32 (Trunc32to16 x:(Rsh32Ux64 _ (Const64 [s]))))
12229
12320
// cond: s >= 16
12230
12321
// result: x
@@ -12255,6 +12346,19 @@ func rewriteValuegeneric_OpZeroExt16to32(v *Value, config *Config) bool {
12255
12346
func rewriteValuegeneric_OpZeroExt16to64 (v * Value , config * Config ) bool {
12256
12347
b := v .Block
12257
12348
_ = b
12349
+ // match: (ZeroExt16to64 (Const16 [c]))
12350
+ // cond:
12351
+ // result: (Const64 [int64(uint16(c))])
12352
+ for {
12353
+ v_0 := v .Args [0 ]
12354
+ if v_0 .Op != OpConst16 {
12355
+ break
12356
+ }
12357
+ c := v_0 .AuxInt
12358
+ v .reset (OpConst64 )
12359
+ v .AuxInt = int64 (uint16 (c ))
12360
+ return true
12361
+ }
12258
12362
// match: (ZeroExt16to64 (Trunc64to16 x:(Rsh64Ux64 _ (Const64 [s]))))
12259
12363
// cond: s >= 48
12260
12364
// result: x
@@ -12285,6 +12389,19 @@ func rewriteValuegeneric_OpZeroExt16to64(v *Value, config *Config) bool {
12285
12389
func rewriteValuegeneric_OpZeroExt32to64 (v * Value , config * Config ) bool {
12286
12390
b := v .Block
12287
12391
_ = b
12392
+ // match: (ZeroExt32to64 (Const32 [c]))
12393
+ // cond:
12394
+ // result: (Const64 [int64(uint32(c))])
12395
+ for {
12396
+ v_0 := v .Args [0 ]
12397
+ if v_0 .Op != OpConst32 {
12398
+ break
12399
+ }
12400
+ c := v_0 .AuxInt
12401
+ v .reset (OpConst64 )
12402
+ v .AuxInt = int64 (uint32 (c ))
12403
+ return true
12404
+ }
12288
12405
// match: (ZeroExt32to64 (Trunc64to32 x:(Rsh64Ux64 _ (Const64 [s]))))
12289
12406
// cond: s >= 32
12290
12407
// result: x
@@ -12315,6 +12432,19 @@ func rewriteValuegeneric_OpZeroExt32to64(v *Value, config *Config) bool {
12315
12432
func rewriteValuegeneric_OpZeroExt8to16 (v * Value , config * Config ) bool {
12316
12433
b := v .Block
12317
12434
_ = b
12435
+ // match: (ZeroExt8to16 (Const8 [c]))
12436
+ // cond:
12437
+ // result: (Const16 [int64( uint8(c))])
12438
+ for {
12439
+ v_0 := v .Args [0 ]
12440
+ if v_0 .Op != OpConst8 {
12441
+ break
12442
+ }
12443
+ c := v_0 .AuxInt
12444
+ v .reset (OpConst16 )
12445
+ v .AuxInt = int64 (uint8 (c ))
12446
+ return true
12447
+ }
12318
12448
// match: (ZeroExt8to16 (Trunc16to8 x:(Rsh16Ux64 _ (Const64 [s]))))
12319
12449
// cond: s >= 8
12320
12450
// result: x
@@ -12345,6 +12475,19 @@ func rewriteValuegeneric_OpZeroExt8to16(v *Value, config *Config) bool {
12345
12475
func rewriteValuegeneric_OpZeroExt8to32 (v * Value , config * Config ) bool {
12346
12476
b := v .Block
12347
12477
_ = b
12478
+ // match: (ZeroExt8to32 (Const8 [c]))
12479
+ // cond:
12480
+ // result: (Const32 [int64( uint8(c))])
12481
+ for {
12482
+ v_0 := v .Args [0 ]
12483
+ if v_0 .Op != OpConst8 {
12484
+ break
12485
+ }
12486
+ c := v_0 .AuxInt
12487
+ v .reset (OpConst32 )
12488
+ v .AuxInt = int64 (uint8 (c ))
12489
+ return true
12490
+ }
12348
12491
// match: (ZeroExt8to32 (Trunc32to8 x:(Rsh32Ux64 _ (Const64 [s]))))
12349
12492
// cond: s >= 24
12350
12493
// result: x
@@ -12375,6 +12518,19 @@ func rewriteValuegeneric_OpZeroExt8to32(v *Value, config *Config) bool {
12375
12518
func rewriteValuegeneric_OpZeroExt8to64 (v * Value , config * Config ) bool {
12376
12519
b := v .Block
12377
12520
_ = b
12521
+ // match: (ZeroExt8to64 (Const8 [c]))
12522
+ // cond:
12523
+ // result: (Const64 [int64( uint8(c))])
12524
+ for {
12525
+ v_0 := v .Args [0 ]
12526
+ if v_0 .Op != OpConst8 {
12527
+ break
12528
+ }
12529
+ c := v_0 .AuxInt
12530
+ v .reset (OpConst64 )
12531
+ v .AuxInt = int64 (uint8 (c ))
12532
+ return true
12533
+ }
12378
12534
// match: (ZeroExt8to64 (Trunc64to8 x:(Rsh64Ux64 _ (Const64 [s]))))
12379
12535
// cond: s >= 56
12380
12536
// result: x
0 commit comments