From 6437dd3b09467a3f6cc6a907e24149975c534784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandro=20S=C3=A1nchez=20Bach?= Date: Sat, 24 May 2014 03:20:36 -0700 Subject: [PATCH] Updated Developer Information (markdown) --- Developer-Information.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Developer-Information.md b/Developer-Information.md index 102ec13..5daa2dd 100644 --- a/Developer-Information.md +++ b/Developer-Information.md @@ -28,8 +28,18 @@ Best wishes and happy coding! ## Information -#### Size of PS3 basic types -Checked with [PSL1GHT](http://psl1ght.com). +####OE bit +Some instructions contain an optional `OE`(overflow excpetion) flag. We currently do not implement those versions of the instructions. For example we emulate `add`, `addze`, `subfme` but not `addo`, `addzeo`, `subfmo` which are just the prior operations with the `OE` flag set. + +This flag writes to the `OV` and `SO` (overflow and summary overflow) bits of the XER (Fixed-Point Exception Register) register. The reason why it's not implemented is that the [GCC code emitter](http://repo.or.cz/w/official-gcc.git/blob_plain/c2c80e70905bc2e5dedf8352588fc8cb10e3ec7d:/gcc/config/rs6000/rs6000.md) does not use these instructions and so we haven't found any PS3 software that uses it. + +If we find some software that has some handwritten assembly that use those instructions we'll need to implement it (or just for completeness). A good reference for XER bits can be found in [PowerPC Microprocessor Family: The Programmer's Reference Guide ](https://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/852569B20050FF778525699600741775) chapter 1.3 and other linked references. + +For the implementation of the interpreter it would probably be best to refrain from x86 assembly or compiler intrinsics like `__readeflags` to determine a overflow. Probably something from the [answers to this SO question](http://stackoverflow.com/questions/199333/best-way-to-detect-integer-overflow-in-c-c) is what we should consider. + + +####Misc +(Some of this information can be deleted, or at least properly organized). * `sizeof(char)` = 1 (= 8 bits) * `sizeof(short)` = 2 * `sizeof(int)` = 4 @@ -38,11 +48,4 @@ Checked with [PSL1GHT](http://psl1ght.com). * `sizeof(size_t)` = 4 * `sizeof(void*)` = 4 -####OE bit -Some instructions contain an optional `OE`(overflow excpetion) flag. We currently do not implement those versions of the instructions. For example we emulate `add, addze, subfme` but not `addo, addzeo, subfmo` which are just the prior operations with the `OE` flag set. - -This flag writes to the `OV` and `SO` (overflow and summary overflow) bits of the XER (Fixed-Point Exception Register) register. The reason why it's not implemented is that the [GCC code emitter](http://repo.or.cz/w/official-gcc.git/blob_plain/c2c80e70905bc2e5dedf8352588fc8cb10e3ec7d:/gcc/config/rs6000/rs6000.md) does not use these instructions and so we haven't found any PS3 software that uses it. - -If we find some software that has some handwritten assembly that use those instructions we'll need to implement it (or just for completeness). A good reference for XER bits can be found in [PowerPC Microprocessor Family: The Programmer's Reference Guide ](https://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/852569B20050FF778525699600741775) chapter 1.3 and other linked references. - -For the implementation of the interpreter it would probably be best to refrain from x86 assembly or compiler intrinsics like `__readeflags` to determine a overflow. Probably something from the [answers to this SO question](http://stackoverflow.com/questions/199333/best-way-to-detect-integer-overflow-in-c-c) is what we should consider \ No newline at end of file +Reading from invalid addresses / Trying to execute code from invalid addresses (e.g. stack) / Trying to write to invalid addresses (e.g. functions) makes the application exit on real PS3s. \ No newline at end of file