193 Commits

Author SHA1 Message Date
MerryMage
607dd2c95e mp/function_info: Add parameter_count_v 2020-04-02 13:33:53 +01:00
MerryMage
3315faf592 bit_util: Add CountLeadingZeros 2020-04-02 13:33:53 +01:00
Merry
313622a53a
Merge pull request #503 from lioncash/cmp
A64: Implement half-precision variants of FCMEQ
2019-05-30 00:58:57 +01:00
Lioncash
6d8c9a7dd9
common/fp/op: Add soft-float implementation of FPCompareEQ
This will be used to implement the half-precision floating-point
variants of FCMEQ in following changes.
2019-05-25 23:51:35 -04:00
Lioncash
a178031d6c
General: Remove unnecessary includes
Removes unnecessary header dependencies that have accumulated over time
as changes have been made. Lessens the amount of files that need to be
rebuilt when the headers change.
2019-05-23 21:43:10 -04:00
Lioncash
7fe1a40bf4
common/cast_util: Declare BitCast and BitCastPointee with the noexcept specifier
std::bit_cast is also defined with the noexcept specifier, so we can do
the same here to match up with it and stay similar with the standard
library.
2019-05-18 15:06:27 -04:00
Lioncash
4a7d62d528
common/fp/info: Make formatting of FPInfo struct member functions consistent
Orgranizes the functions to all be consistent with the half-precision
specialization.
2019-05-04 21:24:18 -04:00
Lioncash
3991361352
common/fp/util: Make ProcessNaN utility functions constexpr
Nothing in particular prevents these from being constexpr. Do so to make
them consistent with the bulk of other functions in this header that are
constexpr.
2019-05-04 21:20:43 -04:00
Lioncash
4cfd1f28cc
common/fp/op/FPNeg: Make FPNeg constexpr
Negation in (standard IEEE) floating-point is simply flipping the sign-bit, so this
operation will never be more complex than what is presented here, making
constexpr a reasonable allowance.
2019-05-04 21:07:49 -04:00
Lioncash
94717dc11a
general: Remove trailing spaces
General code-related cleanup. Gets rid of trailing spaces in the
codebase.
2019-05-04 21:03:34 -04:00
MerryMage
6bf0470e09 Suppress MSVC warning C4702: unreachable code 2019-05-02 21:41:22 +01:00
Lioncash
66e3b1c1eb
common/fp/op/FPConvert: Remove unnecessary casts in FPConvert()
These were made unnecessary in 2c2fdb435cf8e358a0c5b907ce8131e434df3f22,
but were missed during the initial removal.
2019-04-16 21:53:22 -04:00
Merry
6377fd9866
Merge pull request #482 from lioncash/fixedfp
A64: Handle half-precision variants of FP->Fixed instructions
2019-04-15 20:08:01 +01:00
Lioncash
2c2fdb435c
common/fp/info: Make half-precision info struct functions return correctly sized types
While initially done to potentially prevent creating bugs due to C++
having a silly type-promotion mechanism involving types < sizeof(int)
and unsignedness, given that the bulk of these functions' usages
are on exit paths, these can return the correct type to avoid the need
to cast at every usage point.
2019-04-15 04:55:00 -04:00
Lioncash
6c7de6c9c4
common/fp/op/FPToFixed: Add half-precision specialization of FPToFixed 2019-04-15 00:17:44 -04:00
Lioncash
cff4394717
common/fp/op/FPRSqrtStepFused: Add half-precision specialization for FPRSqrtStepFused 2019-04-14 20:51:58 -04:00
Merry
eea732febf
Merge pull request #478 from lioncash/stepfused
A64: Handle half-precision variants of FRECPE and FRECPS
2019-04-14 12:40:18 +01:00
Lioncash
e93161e25b
common/fp/op: Add half-precision specialization for FPRecipEstimate 2019-04-14 06:14:19 -04:00
Lioncash
408bbfb766
common/fp/op: Add half-precision specialization for FPRecipStepFused 2019-04-14 06:13:43 -04:00
Lioncash
9c9087ea47
common/fp/op/FPRSqrtEstimate: Add half-precision specialization for FPRSqrtEstimate 2019-04-14 06:10:27 -04:00
Lioncash
590388b9ec
fp/op/FPRoundInt: Add half-precision specialization of FPRoundInt 2019-04-13 17:37:45 -04:00
Lioncash
2ae0c4807a
fp/op/FPMulAdd: Add half-precision floating-point specialization 2019-04-13 00:07:34 -04:00
Lioncash
f4d63ff07d
common/fp/op/FPRecipExponent: Prevent undefined behavior from shifting a negative value
Due to promotion rules (types < int, even if unsigned, get promoted to
int when arithmetic is performed on them), this is a potential spot for
undefined behavior.
2019-04-01 19:51:52 -04:00
Lioncash
f74c9dad6f
common/fp/unpacked: Amend behavior of FPUnpackCV
This is supposed to call FPUnpackBase instead of FPUnpack. This would
result in alternate half-precision representations being misinterpreted
when it comes to dealing with NaNs.
2019-03-23 14:16:44 -04:00
Lioncash
36e739ba9b
common/fp/op/FPConvert: Amend off-by one in double NaN case in FPConvertNaN
Avoids potentially clobbering the intended sign bit value during
conversions to double-precision values. The other conversion types are
already properly handled, so those don't need to be addressed.
2019-03-23 14:16:44 -04:00
Lioncash
29e1a024c7
common/fp/op/FPConvert: Add half-precision instantiations to FPConvert 2019-03-23 14:16:37 -04:00
Lioncash
1e0933907a
common/fp/op/FPRecipExponent: Add half-precision floating point specialization 2019-03-09 20:07:53 -05:00
Lioncash
5117997cde
common/fp/unpacked: Correct edge-cases within FPUnpack for half-precision floating point
This corrects one case where floating-point exceptions could be set when
they're not supposed to be.

This also corrects a case where values were being treated as NaNs when
they weren't supposed to be.
2019-03-09 19:21:16 -05:00
Lioncash
1b66e43094
common/fp/process_nan: Add half-precision instantiations for NaN processing functions 2019-03-09 02:26:58 -05:00
Lioncash
2f7f75ff09
common/fp/unpacked: Add half-precision instantiation of FPRoundBase 2019-03-09 02:26:47 -05:00
Lioncash
74e230de9d
common/fp/unpacked: Handle half-precision unpacking in FPUnpackBase 2019-03-09 01:19:55 -05:00
Lioncash
9c96c4c9fc
common/fp/unpacked: Adjust FPUnpack to operate like ARM pseudocode
This function is defined as always disabling the AHP bit in the fpcr
before performing any operations.

At the same time, rename the original FPUnpack function to FPUnpackBase
to match the pseudocode in the ARM reference manual.
2019-03-09 00:08:12 -05:00
Merry
b3d6f40dbb
Merge pull request #449 from lioncash/hp
common/fp/info: Add specialization of FPInfo for half-precision floating point
2019-03-08 18:49:18 +00:00
Lioncash
6dad779547
common/fp/unpacked: Add FPRoundCV
Corresponds to the equivalent pseudocode within the ARMv8 reference
manual. This will be necessary for supporting half-precision
floating-point.

This also makes use of it within FPConvert
2019-03-08 06:24:54 -05:00
Lioncash
deca5e5dae
common/fp/unpacked: Add FPUnpackCV
Adds a template function that performs the same behavior as in the ARM
pseudocode, and utilizes it in FPConvert, which will be necessary for
half-float support.
2019-03-08 06:20:54 -05:00
Lioncash
d1a1434af6
common/fp/info: Add specialization of FPInfo for half-precision floating point
Puts the necessary info struct in place for further use.
2019-03-08 03:50:48 -05:00
Merry
04f09eb644
Merge pull request #442 from lioncash/fcvtxn
A64: Implement scalar and vector variants of FCVTXN
2019-03-06 20:27:59 +00:00
Merry
a5ce4c7831
Merge pull request #441 from lioncash/constexpr
common/bit_util: Mark a few functions as constexpr
2019-03-05 19:57:12 +00:00
Merry
fa1671b655
Merge pull request #440 from lioncash/include
common/fp: Remove unnecessary includes
2019-03-05 19:56:58 +00:00
Lioncash
9426cc9795
common/fp/op: Add FP conversion functions 2019-03-04 11:57:41 -05:00
Lioncash
e042c63de6
common/bit_util: Make a few functions as constexpr
These four functions can be made constexpr with no issue.
2019-03-04 09:21:29 -05:00
Lioncash
f01fca3bc3
common/fp: Remove unnecessary includes 2019-03-04 08:25:48 -05:00
Lioncash
78742a6aea
common/fp/op: Add operations for floating-point reciprocal exponents 2019-03-02 23:31:26 -05:00
Lioncash
18f5916e4d
common: Remove address_range.h
The AddressRange structure isn't used anywhere within the codebase, so
this can be removed. Particularly because there's no real appeal/heavy
potential use of it in the future that isn't trivial to add back if
needed.
2019-02-08 09:41:37 -05:00
Lioncash
75b8308cef
common: Move byte swapping functions to bit_utils.h
These are quite general functions, so they can just be moved into common
instead of recreating a namespace here.
2018-11-23 22:50:41 -05:00
Michał Janiszewski
a695635efd Add missing include guards 2018-10-31 22:54:17 +01:00
V.Kalyuzhny
05a2dbfce0 Switch boost::optional to std::optional 2018-10-24 15:02:39 +00:00
Lioncash
4f3bde5f12 ir: Add opcodes for performing unsigned reciprocal square root estimates 2018-09-09 00:37:28 +01:00
Lioncash
622b60efd6 ir: Add opcodes for unsigned reciprocal estimate 2018-09-09 00:37:28 +01:00
MerryMage
821cabac1b fp/info: Incorrect point_position in FPValue 2018-08-16 10:50:28 +01:00