# aarch64: check lo/cc flag for unsigned sub_with_overflow · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/97816e3cb826b64df578baa72781caba93252fd0)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 97816e3cb826b64df578baa72781caba93252fd0

Requested commit: 97816e3cb826b64df578baa72781caba93252fd0

Commit: 97816e3cb826b64df578baa72781caba93252fd0

Tree: a113dc2423916bd14066156855a2af6ecad2b7f3

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
aarch64: check lo/cc flag for unsigned sub_with_overflow

With this change, we are now correctly lowering `sub_with_overflow`
for signed and unsigned integers of register-sized integers (32-
or 64-bit precisely). We also match LLVM's behavior and so, the
condition flags we now set are:

* unsigned:
  - `add_with_overflow`: `hs`/`cs` (carry set)
  - `sub_with_overflow`: `lo`/`cc` (carry clear)
* signed:
  - `add_with_overflow`/`sub_with_overflow`: `vs` (overflow)

```

## Parents

- [39ebfedd2bea7ebb8630f8593ae59538969bfea7](https://git.cafe/gitcafe/zig/commit/39ebfedd2bea7ebb8630f8593ae59538969bfea7?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/97816e3cb826b64df578baa72781caba93252fd0?format=markdown)
