Add support for 32/16-bit mem-mode truncation through assigning 32/16-bit ID#13
Draft
MinliLiao wants to merge 12 commits into
Draft
Add support for 32/16-bit mem-mode truncation through assigning 32/16-bit ID#13MinliLiao wants to merge 12 commits into
MinliLiao wants to merge 12 commits into
Conversation
…al behavior to 32-bit float instead of bypassing
…arbageCollection.cpp
…GCFloatTy destruction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To retain
__raptor_fpfor native floating point variables across function boundaries, mem-mode stores the address of the__raptor_fpinto the native floating point value to retrieve__raptor_fp.However, this limits the mem-mode support to truncate from floating point types as large as a pointer (i.e.
doubleon a 64-bit machine), since floating point types of smaller bit width is not able to hold the address of the__raptor_fp.This pull request adds support for mem-mode truncation from floating point types that have smaller bit width than a pointer through assigning unique IDs as wide as the floating point type:
__raptor_fp *is added per C++ floating point types.__raptor_fpfor a C++ floating point value is created, the address of the__raptor_fpis added to the vector for the corresponding C++ floating point type.__raptor_fp *is stored into the C++ floating point value as an ID.__raptor_fp *.Since the unique IDs are as wide as the floating point type, this limits the number of floating point values that can be truncated. To handle this limitation:
__raptor_fpwould exceed the limit of the corresponding native floating point type bit width, an error message will be printed before sending an abort signal.GCFloatTy, the address of the__raptor_fpit contains is removed from the vector of__raptor_fp *, freeing up it's corresponding ID.__raptor_fpinstead of incrementing the size of the__raptor_fp *vector to obtain new ID.Compile-time constraints have also been added to check if the type used as input for mem-mode truncation is supported.
Compile-time constraints also make sure that ID is not used when truncating from types as wide as a pointer, preserving the 64-bit truncation behavior.
Using mem-mode truncation on unsupported types will result in compile time error (instead of the previous behavior of runtime abort).
While this pull request is independent, testing this feature with any floating point operations or standard math lib functions requires applying fixes for issue #10.