adding big-endian support across compiler, runtime, and library modules

- adding Platform.LittleEndian to centralize endianness detection
- using SYSTEM.GET with correct byte offset for HUGEINT to smaller type reads on big-endian
- fixing Reals.BytesToHex iteration direction and InitEndian for big-endian
- fixing oocLowReal fraction, IsInfinity, IsNaN using Reals.Expo/SetExpo
- fixing Math.ToREAL and MathL.exponent for big-endian
- fixing In.Int and In.LongInt for big-endian
- fixing outtest.wh byte iteration direction for big-endian
- regenerating all bootstrap C sources
- tested on ppc32
This commit is contained in:
Norayr Chilingarian 2026-07-12 18:16:58 +04:00
parent 93c0198f18
commit 4dd3c395fe
198 changed files with 788 additions and 409 deletions

View file

@ -1,4 +1,4 @@
/* voc 2.1.0 [2026/07/10]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
/* voc 2.1.0 [2026/07/12]. Bootstrapping compiler for address size 8, alignment 8. xrtspaSF */
#define SHORTINT INT8
#define INTEGER INT16
@ -9,6 +9,7 @@
#include "OPM.h"
#include "OPS.h"
#include "OPT.h"
#include "Platform.h"
static INT16 OPB_exp;
@ -216,7 +217,11 @@ static void OPB_SetIntType (OPT_Node node)
static void OPB_SetSetType (OPT_Node node)
{
INT32 i32;
__GET((ADDRESS)&node->conval->setval + 4, i32, INT32);
if (Platform_LittleEndian) {
__GET((ADDRESS)&node->conval->setval + 4, i32, INT32);
} else {
__GET((ADDRESS)&node->conval->setval, i32, INT32);
}
if (i32 == 0) {
node->typ = OPT_set32typ;
} else {
@ -2584,6 +2589,7 @@ export void *OPB__init(void)
__MODULE_IMPORT(OPM);
__MODULE_IMPORT(OPS);
__MODULE_IMPORT(OPT);
__MODULE_IMPORT(Platform);
__REGMOD("OPB", 0);
/* BEGIN */
OPB_maxExp = OPB_log(4611686018427387904LL);