[PR #347] [CLOSED] Op arg float as default #1500

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/347
Author: @viniciuslrangel
Created: 7/31/2024
Status: Closed

Base: mainHead: op-arg-float-as-default


📝 Commits (3)

  • 501bc70 shader_recompiler: GetSrc as float by default except when explicit
  • 523fc24 shader_recompiler: rewrite GetSrc api to allow compile-time check of types
  • 813e1ef shader_recompiler: renamed SrcValue to SrcValue & added simple docs

📊 Changes

7 files changed (+258 additions, -191 deletions)

View changed files

📝 src/shader_recompiler/frontend/translate/data_share.cpp (+3 -3)
📝 src/shader_recompiler/frontend/translate/scalar_alu.cpp (+4 -4)
📝 src/shader_recompiler/frontend/translate/translate.cpp (+85 -35)
📝 src/shader_recompiler/frontend/translate/translate.h (+30 -4)
📝 src/shader_recompiler/frontend/translate/vector_alu.cpp (+69 -63)
📝 src/shader_recompiler/ir/ir_emitter.cpp (+53 -75)
📝 src/shader_recompiler/ir/ir_emitter.h (+14 -7)

📄 Description

After removing the 'force_flt' assumption based on input modifications, some games stopped running due to an early MOV operation that restricted the parser from inferring the value as a float, so I thought we should keep all values as float by default and force to integer only when needed by I32 OPs.

However I started getting a lot of errors from invalid types and had to run, wait to crash, and fix. So I changed the GetSrc implementation to infer the correct value based on return type, not only cleaning the code but making it easier for new OP to be implemented without needing to handle type conversion from GetSrc, including 64-bit types.


🔄 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/347 **Author:** [@viniciuslrangel](https://github.com/viniciuslrangel) **Created:** 7/31/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `op-arg-float-as-default` --- ### 📝 Commits (3) - [`501bc70`](https://github.com/shadps4-emu/shadPS4/commit/501bc704bf7e25d23a7280cdef87ab74a13d00ce) shader_recompiler: GetSrc as float by default except when explicit - [`523fc24`](https://github.com/shadps4-emu/shadPS4/commit/523fc24fb10a955b331d502621177becffcd9aad) shader_recompiler: rewrite GetSrc api to allow compile-time check of types - [`813e1ef`](https://github.com/shadps4-emu/shadPS4/commit/813e1ef1a3a76e704006e7cbeb348e9fb9881877) shader_recompiler: renamed SrcValue to SrcValue & added simple docs ### 📊 Changes **7 files changed** (+258 additions, -191 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/frontend/translate/data_share.cpp` (+3 -3) 📝 `src/shader_recompiler/frontend/translate/scalar_alu.cpp` (+4 -4) 📝 `src/shader_recompiler/frontend/translate/translate.cpp` (+85 -35) 📝 `src/shader_recompiler/frontend/translate/translate.h` (+30 -4) 📝 `src/shader_recompiler/frontend/translate/vector_alu.cpp` (+69 -63) 📝 `src/shader_recompiler/ir/ir_emitter.cpp` (+53 -75) 📝 `src/shader_recompiler/ir/ir_emitter.h` (+14 -7) </details> ### 📄 Description After removing the 'force_flt' assumption based on input modifications, some games stopped running due to an early MOV operation that restricted the parser from inferring the value as a float, so I thought we should keep all values as float by default and force to integer only when needed by I32 OPs. However I started getting a lot of errors from invalid types and had to run, wait to crash, and fix. So I changed the GetSrc implementation to infer the correct value based on return type, not only cleaning the code but making it easier for new OP to be implemented without needing to handle type conversion from GetSrc, including 64-bit types. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:12:50 +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#1500
No description provided.