xenia-project/xenia

DIV_I32 and others don't handle INT_MIN / -1

Open

#1085 opened on Feb 12, 2018

View on GitHub
 (2 comments) (5 reactions) (0 assignees)C++ (7,418 stars) (1,077 forks)batch import
cpugood first issue

Description

https://github.com/benvanik/xenia/blob/190108dab6732d9db5c8595e1358b7b034cb5a14/src/xenia/cpu/backend/x64/x64_sequences.cc#L4332

It was pointed out to me that x86 will raise an exception when dividing INT_MIN by -1. I haven't encountered any games doing this yet - but it could potentially be an issue.

According to PowerPC docs, the output is undefined if this condition occurs.

Could be worth investigating if you're a new contributor.

Contributor guide