---
title: "hv_vcpu_write_fpstate(_:_:_:)"
framework: Hypervisor
role: symbol
role_heading: Function
platforms: [macOS 10.10+]
path: "hypervisor/hv_vcpu_write_fpstate(_:_:_:)"
---

# hv_vcpu_write_fpstate(_:_:_:)

Sets the architectural x86 floating point and SIMD state of a vCPU.

## Declaration

```swift
func hv_vcpu_write_fpstate(_ vcpu: hv_vcpuid_t, _ buffer: UnsafeMutableRawPointer, _ size: Int) -> hv_return_t
```

## Parameters

- `vcpu`: The instance of the vCPU.
- `buffer`: The new floating point and SIMD state.
- `size`: Size of the memory buffer in bytes.

## Return Value

Return Value HV_SUCCESS if the operation was successful, otherwise an error code specified in hv_return_t.

## Discussion

Discussion The XSAVE feature set of the host processor defines the structure and size of the returned buffer. important: This function must be called by the owning thread.

## See Also

### Floating Point (FP) State

- [hv_vcpu_read_fpstate(_:_:_:)](hypervisor/hv_vcpu_read_fpstate(_:_:_:).md)
