Avoid is_constant calls in vectorizable_bswap
[official-gcc.git] / libgo / go / syscall / str.go
blob2ddf04b2275032e5fbbbd7acc060f60fcf7f026f
1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package syscall
7 func itoa(val int) string { // do it here rather than with fmt to avoid dependency
8 if val < 0 {
9 return "-" + uitoa(uint(-val))
11 return uitoa(uint(val))
14 func uitoa(val uint) string {
15 var buf [32]byte // big enough for int64
16 i := len(buf) - 1
17 for val >= 10 {
18 buf[i] = byte(val%10 + '0')
19 i--
20 val /= 10
22 buf[i] = byte(val + '0')
23 return string(buf[i:])