Commit 5cd0d2b
committed
AK: Always use serenity's math routines, even in lagom builds
Some of the functions in AK/Math.h used to implement math routines if
AK_OS_SERENITY was defined, but called __builtin_foo() in lagom builds.
This was not done consistently. Many functions always implemented
math functions without this check, for example:
- copysign()
- acos(), asin()
- cosh(), sinh(), tanh(), acosh, asinh(), atanh()
- exp2(), log2(), pow()
Move the functions that did that check to not doing it as well.
This means these functions now use the same implementation in
serenity and lagom. Since lagom is for testing serenity code
outside serenity, this seems like a good change.
All these functions check for x86 for and use inline assembly
there, so this only affects non-x86 lagom builds. It affects
these functions:
- fmod()
- remainder() (now always a TODO(), not just in serenity)
- sin(), cos(), tan()
- atan(), atan2()
- log(), log10()
It changes but does not really affect sqrt() -- now a TODO() on non-x86
non-arm non-riscv lagom (i.e. nowhere).
As Serenity's implementations of these math functions are currently
lower-quality than what's usually in lagom libms, this regresses lagom
behavior (performance, precision) on non-x86 for these functions.
But only to the level they're at within serenity, and we'll have to
improve these functions there anyways.1 parent bed715c commit 5cd0d2b
1 file changed
+2
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
442 | | - | |
443 | 442 | | |
444 | 443 | | |
445 | 444 | | |
| |||
526 | 525 | | |
527 | 526 | | |
528 | 527 | | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | 528 | | |
538 | 529 | | |
539 | 530 | | |
| |||
553 | 544 | | |
554 | 545 | | |
555 | 546 | | |
556 | | - | |
557 | 547 | | |
558 | 548 | | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | 549 | | |
567 | 550 | | |
568 | 551 | | |
| |||
615 | 598 | | |
616 | 599 | | |
617 | 600 | | |
618 | | - | |
619 | 601 | | |
620 | 602 | | |
621 | | - | |
622 | | - | |
623 | 603 | | |
624 | 604 | | |
625 | 605 | | |
| |||
684 | 664 | | |
685 | 665 | | |
686 | 666 | | |
687 | | - | |
688 | 667 | | |
689 | 668 | | |
690 | 669 | | |
| |||
726 | 705 | | |
727 | 706 | | |
728 | 707 | | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | 708 | | |
733 | 709 | | |
734 | 710 | | |
| |||
745 | 721 | | |
746 | 722 | | |
747 | 723 | | |
748 | | - | |
749 | 724 | | |
750 | 725 | | |
751 | 726 | | |
| |||
789 | 764 | | |
790 | 765 | | |
791 | 766 | | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | 767 | | |
796 | 768 | | |
797 | 769 | | |
| |||
828 | 800 | | |
829 | 801 | | |
830 | 802 | | |
831 | | - | |
832 | 803 | | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | 804 | | |
837 | 805 | | |
838 | 806 | | |
| |||
898 | 866 | | |
899 | 867 | | |
900 | 868 | | |
901 | | - | |
902 | 869 | | |
903 | | - | |
904 | | - | |
905 | 870 | | |
906 | 871 | | |
907 | 872 | | |
| |||
918 | 883 | | |
919 | 884 | | |
920 | 885 | | |
921 | | - | |
922 | 886 | | |
923 | 887 | | |
924 | 888 | | |
| |||
978 | 942 | | |
979 | 943 | | |
980 | 944 | | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | 945 | | |
985 | 946 | | |
986 | 947 | | |
| |||
1094 | 1055 | | |
1095 | 1056 | | |
1096 | 1057 | | |
1097 | | - | |
| 1058 | + | |
1098 | 1059 | | |
1099 | 1060 | | |
1100 | | - | |
1101 | | - | |
1102 | 1061 | | |
1103 | 1062 | | |
1104 | 1063 | | |
| |||
1116 | 1075 | | |
1117 | 1076 | | |
1118 | 1077 | | |
1119 | | - | |
| 1078 | + | |
1120 | 1079 | | |
1121 | 1080 | | |
1122 | | - | |
1123 | | - | |
1124 | 1081 | | |
1125 | 1082 | | |
1126 | 1083 | | |
| |||
0 commit comments