]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: replace int32(b2i(x)) with b2i32(x) in rules
authorAlberto Donizetti <alb.donizetti@gmail.com>
Tue, 27 Oct 2020 13:04:10 +0000 (14:04 +0100)
committerAlberto Donizetti <alb.donizetti@gmail.com>
Tue, 27 Oct 2020 20:04:19 +0000 (20:04 +0000)
Change-Id: I7fbb0c1ead6e29a7445c8ab43f7050947597f3e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/265497
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/gen/386.rules
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/MIPS.rules
src/cmd/compile/internal/ssa/rewrite386.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/rewriteMIPS.go

index 6a0b87cab422b183dcaacbd89e6e7b1a8f3ba8aa..4e6cc8c692bf05f566d80cb6c44f11d6230b8527 100644 (file)
 (Const32  ...) => (MOVLconst ...)
 (Const(32|64)F ...) => (MOVS(S|D)const ...)
 (ConstNil) => (MOVLconst [0])
-(ConstBool [c]) => (MOVLconst [int32(b2i(c))])
+(ConstBool [c]) => (MOVLconst [b2i32(c)])
 
 // Lowering calls
 (StaticCall ...) => (CALLstatic ...)
index 8742c49ebd96124640fa6eb1f2b904f5cb32e466..934e7dfdb60062b055834ffca4c9fe85f7757f06 100644 (file)
 (Const32F ...) => (MOVSSconst ...)
 (Const64F ...) => (MOVSDconst ...)
 (ConstNil    ) => (MOVQconst [0])
-(ConstBool [c]) => (MOVLconst [int32(b2i(c))])
+(ConstBool [c]) => (MOVLconst [b2i32(c)])
 
 // Lowering calls
 (StaticCall ...) => (CALLstatic ...)
index ba3e8cc000b25a33657dc205b7331bd802c5d138..b6e5312224ee91689b90e88adb02ead8df8251ea 100644 (file)
 (Const(32|16|8) [val]) => (MOVWconst [int32(val)])
 (Const(32|64)F ...) => (MOV(F|D)const ...)
 (ConstNil) => (MOVWconst [0])
-(ConstBool [b]) => (MOVWconst [int32(b2i(b))])
+(ConstBool [b]) => (MOVWconst [b2i32(b)])
 
 // truncations
 // Because we ignore high parts of registers, truncates are just copies.
index 0f08160f44df46e117f8f7a47d226ea5adabbe34..afce14fa76caa760370beb31536f94ee978dcfe1 100644 (file)
@@ -8696,11 +8696,11 @@ func rewriteValue386_OpConst8(v *Value) bool {
 }
 func rewriteValue386_OpConstBool(v *Value) bool {
        // match: (ConstBool [c])
-       // result: (MOVLconst [int32(b2i(c))])
+       // result: (MOVLconst [b2i32(c)])
        for {
                c := auxIntToBool(v.AuxInt)
                v.reset(Op386MOVLconst)
-               v.AuxInt = int32ToAuxInt(int32(b2i(c)))
+               v.AuxInt = int32ToAuxInt(b2i32(c))
                return true
        }
 }
index 833470ea6633ca8c5c72eb214999049663150a1c..ed84812a03bdb3c59314b45d73541fe92328628c 100644 (file)
@@ -29719,11 +29719,11 @@ func rewriteValueAMD64_OpConst8(v *Value) bool {
 }
 func rewriteValueAMD64_OpConstBool(v *Value) bool {
        // match: (ConstBool [c])
-       // result: (MOVLconst [int32(b2i(c))])
+       // result: (MOVLconst [b2i32(c)])
        for {
                c := auxIntToBool(v.AuxInt)
                v.reset(OpAMD64MOVLconst)
-               v.AuxInt = int32ToAuxInt(int32(b2i(c)))
+               v.AuxInt = int32ToAuxInt(b2i32(c))
                return true
        }
 }
index 175ba770c282234c8f8005724bd7165390e1d72f..0f0954fb83328e02b27d82d40bccd42c8fc31ad9 100644 (file)
@@ -868,11 +868,11 @@ func rewriteValueMIPS_OpConst8(v *Value) bool {
 }
 func rewriteValueMIPS_OpConstBool(v *Value) bool {
        // match: (ConstBool [b])
-       // result: (MOVWconst [int32(b2i(b))])
+       // result: (MOVWconst [b2i32(b)])
        for {
                b := auxIntToBool(v.AuxInt)
                v.reset(OpMIPSMOVWconst)
-               v.AuxInt = int32ToAuxInt(int32(b2i(b)))
+               v.AuxInt = int32ToAuxInt(b2i32(b))
                return true
        }
 }