[PR #724] [MERGED] Set CF correctly on BLSR/BLSMSK patch #1739

Closed
opened 2026-02-27 21:13:46 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/724
Author: @OFFTKP
Created: 9/1/2024
Status: Merged
Merged: 9/3/2024
Merged by: @raphaelthegreat

Base: mainHead: blsr


📝 Commits (2)

  • afcdd26 Set CF correctly on BLSR patch
  • b7fea22 Set CF correctly on BLSMSK patch

📊 Changes

1 file changed (+34 additions, -0 deletions)

View changed files

📝 src/core/cpu_patches.cpp (+34 -0)

📄 Description

Similarly to BLSI, BLSR needs to modify CF.
If source is zero CF is set, otherwise it's cleared:

temp := (SRC-1) bitwiseAND ( SRC );
SF := temp[OperandSize -1];
ZF := (temp = 0);
IF SRC = 0
    CF := 1;
ELSE
    CF := 0;
FI
DEST := temp;

Also doing the same on BLSMSK


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/724 **Author:** [@OFFTKP](https://github.com/OFFTKP) **Created:** 9/1/2024 **Status:** ✅ Merged **Merged:** 9/3/2024 **Merged by:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Base:** `main` ← **Head:** `blsr` --- ### 📝 Commits (2) - [`afcdd26`](https://github.com/shadps4-emu/shadPS4/commit/afcdd269486fdf5e659fd89a0697e2c501f4e070) Set CF correctly on BLSR patch - [`b7fea22`](https://github.com/shadps4-emu/shadPS4/commit/b7fea22c7d5716f0f1b6094504f3bc9d9b84b553) Set CF correctly on BLSMSK patch ### 📊 Changes **1 file changed** (+34 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/core/cpu_patches.cpp` (+34 -0) </details> ### 📄 Description Similarly to BLSI, BLSR needs to modify CF. If source is zero CF is set, otherwise it's cleared: ``` temp := (SRC-1) bitwiseAND ( SRC ); SF := temp[OperandSize -1]; ZF := (temp = 0); IF SRC = 0 CF := 1; ELSE CF := 0; FI DEST := temp; ``` Also doing the same on BLSMSK --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:13:46 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#1739
No description provided.