<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Hypervisor",
  "identifier" : "/documentation/Hypervisor/hv_vcpu_write_fpstate(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Hypervisor"
    ],
    "preciseIdentifier" : "c:@F@hv_vcpu_write_fpstate"
  },
  "title" : "hv_vcpu_write_fpstate(_:_:_:)"
}
-->

# hv_vcpu_write_fpstate(_:_:_:)

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

```
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

[`HV_SUCCESS`](/documentation/Hypervisor/HV_SUCCESS) if the operation was successful, otherwise an error code specified in [`hv_return_t`](/documentation/Hypervisor/hv_return_t).

## 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)