MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / fill_memory_buffer

Function fill_memory_buffer

src/cputest.cpp:2141–2189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2139}
2140
2141static void fill_memory_buffer(uae_u8 *p, int size)
2142{
2143 uae_u8 *pend = p + size - 64;
2144 int i = 0;
2145 while (p < pend) {
2146 int x = (i & 3);
2147 if (x == 1) {
2148 floatx80 v = int32_to_floatx80(xorshift32());
2149 *p++ = v.high >> 8;
2150 *p++ = v.high >> 0;
2151 *p++ = 0;
2152 *p++ = 0;
2153 *p++ = (uae_u8)(v.low >> 56);
2154 *p++ = (uae_u8)(v.low >> 48);
2155 *p++ = (uae_u8)(v.low >> 40);
2156 *p++ = (uae_u8)(v.low >> 32);
2157 if ((i & 15) < 8) {
2158 *p++ = (uae_u8)(v.low >> 24);
2159 *p++ = (uae_u8)(v.low >> 16);
2160 *p++ = (uae_u8)(v.low >> 8);
2161 *p++ = (uae_u8)(v.low >> 0);
2162 } else {
2163 *p++ = frand8();
2164 *p++ = frand8();
2165 *p++ = frand8();
2166 *p++ = frand8();
2167 }
2168 } else if (x == 2) {
2169 floatx80 v = int32_to_floatx80(xorshift32());
2170 float64 v2 = floatx80_to_float64(v, &fpustatus);
2171 *p++ = (uae_u8)(v2 >> 56);
2172 *p++ = (uae_u8)(v2 >> 48);
2173 *p++ = (uae_u8)(v2 >> 40);
2174 *p++ = (uae_u8)(v2 >> 32);
2175 *p++ = (uae_u8)(v2 >> 24);
2176 *p++ = (uae_u8)(v2 >> 16);
2177 *p++ = (uae_u8)(v2 >> 8);
2178 *p++ = (uae_u8)(v2 >> 0);
2179 } else if (x == 3) {
2180 floatx80 v = int32_to_floatx80(xorshift32());
2181 float32 v2 = floatx80_to_float32(v, &fpustatus);
2182 *p++ = (uae_u8)(v2 >> 24);
2183 *p++ = (uae_u8)(v2 >> 16);
2184 *p++ = (uae_u8)(v2 >> 8);
2185 *p++ = (uae_u8)(v2 >> 0);
2186 }
2187 i++;
2188 }
2189}
2190
2191static void fill_memory(void)
2192{

Callers 1

fill_memoryFunction · 0.85

Calls 5

int32_to_floatx80Function · 0.85
frand8Function · 0.85
floatx80_to_float64Function · 0.85
floatx80_to_float32Function · 0.85
xorshift32Function · 0.70

Tested by

no test coverage detected