Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1222 (closed defect: fixed)

Opened 16 years ago

Last modified 15 years ago

Atomic: various 64bit issues

Reported by: od Assigned to: fawzi
Priority: major Milestone: 0.99.9
Component: Core Functionality Version: 0.99.7 Dominik
Keywords: atomic, 64bit Cc:

Description

First: 64Bit Increments/Decrements are not supported in tango on x86. However longs are fully supported.

  long x = long.max-1;
  Stdout(x).newline; // 9223372036854775806
  asm { inc qword ptr x; }
  assert (x==long.max);
  Stdout(x).newline; // 9223372036854775807

Second: Currently the adress of the referenced variable is moved into EAX if it is a 1,2,4 byte type or into RAX if it is a 8 byte type. Seems it is messed up a bit, since it'd make more sense to use E*X on X86 and R*X on X86_64 for the adress, regardless of the referenced variable size.

Change History

(in reply to: ↑ description ) 07/31/08 22:00:45 changed by od

Replying to od:

First: 64Bit Increments/Decrements are not supported in tango on x86. However longs are fully supported.

Ok, that one was an illusion. Incrementing 8 bytes on x86 is not directly supported (one would use inc lower32, adc upper32). Also qword ptr behaves like byte ptr on DMD - it is not documented but compiles, so it seems to be a stub in DMD. So incrementing a long value of 255 with qword ptr becomes 0.

09/08/08 20:38:28 changed by sean

  • status changed from new to assigned.

Yeah, x86_64 support is totally messed up right now, for the reason you mention. I'm kicking myself for not realizing it sooner. I'll take care of it.

01/28/09 12:23:50 changed by larsivi

  • status changed from assigned to new.
  • owner changed from sean to fawzi.

03/28/09 12:06:30 changed by larsivi

  • milestone changed from 0.99.8 to 0.99.9.

08/25/09 18:42:02 changed by fawzi

  • status changed from new to closed.
  • resolution set to fixed.

in r4880 the new Atomic module implements add 64 bit add using CAS on i686