Skip to content

Commit

Permalink
Finish __gttf2
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Nov 17, 2023
1 parent f280fcb commit 24b933c
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/soft_float/comparison/__gttf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "gcc_vr4300/types.h"
#include "gcc_vr4300/export.h"
#include "gcc_vr4300/soft_float.h"

#if ABI_N32 || ABI_N64
EXPORT(__gttf2);
Expand Down Expand Up @@ -122,8 +123,26 @@ fcmp __gttf2(float128 a, float128 b) {

// Both exponents are the same

// TODO
if (argA.hex.upper > argB.hex.upper) {
// The upper part of the mantissa of A is greater
return 1;
}
if (argB.hex.upper > argA.hex.upper) {
// The upper part of the mantissa of B is greater
return 0;
}

// The upper part of both mantissas are the same

if (argA.hex.lower > argB.hex.lower) {
// The lower part of the mantissa of A is greater
return 1;
}
if (argB.hex.lower > argA.hex.lower) {
// The lower part of the mantissa of B is greater
return 0;
}

__asm__("break;");
return 0;
}
#endif

0 comments on commit 24b933c

Please sign in to comment.