2011-10-08 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / libgo / runtime / go-rand.c
blob9632efc09cd03d6e5ae664b5f542db217d11cdf8
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 #include "runtime.h"
7 uint32
8 runtime_fastrand1(void)
10 uint32 x;
12 x = m->fastrand;
13 x += x;
14 if(x & 0x80000000L)
15 x ^= 0x88888eefUL;
16 m->fastrand = x;
17 return x;