return s.newValue1(ssa.OpBitLen8, types.Types[types.TINT], args[0])
},
sys.AMD64, sys.ARM, sys.ARM64, sys.Loong64, sys.MIPS, sys.PPC64, sys.S390X, sys.Wasm)
- addF("math/bits", "Len",
- func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
- if s.config.PtrSize == 4 {
- return s.newValue1(ssa.OpBitLen32, types.Types[types.TINT], args[0])
- }
- return s.newValue1(ssa.OpBitLen64, types.Types[types.TINT], args[0])
- },
- sys.AMD64, sys.ARM, sys.ARM64, sys.Loong64, sys.MIPS, sys.PPC64, sys.S390X, sys.Wasm)
+ alias("math/bits", "Len", "math/bits", "Len64", p8...)
+ alias("math/bits", "Len", "math/bits", "Len32", p4...)
+
// LeadingZeros is handled because it trivially calls Len.
addF("math/bits", "Reverse64",
func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {