Browse Source

* Better fix for atomic operations on wasm

Michaël Van Canneyt 7 months ago
parent
commit
3f0593b554
3 changed files with 7 additions and 7 deletions
  1. 1 1
      compiler/fpcdefs.inc
  2. 1 1
      compiler/ncginl.pas
  3. 5 5
      rtl/inc/systemh.inc

+ 1 - 1
compiler/fpcdefs.inc

@@ -437,7 +437,7 @@
 {$ifdef wasm32}
   {$define wasm}
   {$define cpu32bit}
-  {$define cpu64bitalu}
+  {$define cpu32bitalu}
   {$define cpu32bitaddr}
   {$define cpuhighleveltarget}
   {$define cpurox}

+ 1 - 1
compiler/ncginl.pas

@@ -632,7 +632,7 @@ implementation
 
           location_reset(location,LOC_VOID,OS_NO);
 
-{$ifndef cpu64bitalu}
+{$if not defined(cpu64bitalu) and not defined(cpuhighleveltarget)}
           if (def_cgsize(left.resultdef) in [OS_64,OS_S64]) and (left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_REFERENCE,LOC_CREFERENCE]) then
             cg64.a_op64_loc(current_asmdata.CurrAsmList,negnotop[inlinenumber],def_cgsize(left.resultdef),left.location)
           else

+ 5 - 5
rtl/inc/systemh.inc

@@ -500,19 +500,19 @@ Type
   TExitCode = Word;
 {$endif CPU16}
 
-{$if defined(CPU8)}
+{$if defined(CPUINT8)}
   ALUSInt = ShortInt;
   ALUUInt = Byte;
-{$elseif defined(CPU16)}
+{$elseif defined(CPUINT16)}
   ALUSInt = SmallInt;
   ALUUInt = Word;
-{$elseif defined(CPU32)}
+{$elseif defined(CPUINT32)}
   ALUSInt = Longint;
   ALUUInt = DWord;
-{$elseif defined(CPU64)}
+{$elseif defined(CPUINT64)}
   ALUSInt = Int64;
   ALUUInt = QWord;
-{$endif defined(CPU64)}
+{$endif defined(CPUINT64)}
 
   { NativeInt and NativeUInt are Delphi compatibility types. Even though Delphi
     has IntPtr and UIntPtr, the Delphi documentation for NativeInt states that