# shz_sq_memcpy32

Source: https://sh4zam.com/api/memory/shz_sq_memcpy32/

> Copies bytes from src to dst in 32-byte chunks, using the Store Queues

```c
SHZ_INLINE void* shz_sq_memcpy32( void* SHZ_RESTRICT dst, const void* SHZ_RESTRICT src, size_t bytes) SHZ_NOEXCEPT;
```

Copies `bytes` from `src` to `dst` in 32-byte chunks, using the Store Queues.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `dst` | `void *SHZ_RESTRICT` |  |
| `src` | `const void *SHZ_RESTRICT` |  |
| `bytes` | `size_t` |  |

## Returns

`void *`

## Details

Transfers from 8-byte aligned buffer, `src` to 4-byte aligned address, `dst`, 32 bytes at a time, writing through the cache, using the SH4's Store Queues. Returns the `dst` address.

## Notes

- This is the quickest way to move 32-byte chunks of data to *external memory*. When copying to cached memory, you must invalidate the cache lines containing `dst` before initiating the copy... Which means this routine becomes slower than doing memory-to-memory copies with `shz_memcpy32()`.

## Warnings

- `src` must be at least 8-byte aligned, while `dst` can be only 4-byte aligned. `bytes` must be a multiple of 32.

## Naming and requirements

- `sq_`: Writes through the SH4 store queues (burst writes to memory or the PVR). ([Naming and Suffixes](https://sh4zam.com/concepts/naming-and-suffixes/))

## Availability

- **C++ equivalent:** [`shz::sq_memcpy32`](https://sh4zam.com/api/cpp/#shzsq_memcpy32)
- **Type-generic form:** none
- **Back-ends:** SH4: dedicated SH4 implementation · SW: portable C · SPU: shared C implementation
- **Defined in:** [`sh4zam/shz_mem.h:211`](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_mem.h#L211)
- **Module:** [Memory](https://sh4zam.com/api/memory/), section "Specializations"

## See also

[`shz_memcpy32`](https://sh4zam.com/api/memory/shz_memcpy32/), [`shz_sq_memcpy32_1`](https://sh4zam.com/api/memory/shz_sq_memcpy32_1/)
