Closed Bug 491717 Opened 16 years ago Closed 15 years ago

asm_fneg in i386 assembler for SunPro CC is strange; thread safety concern

Categories

(Tamarin Graveyard :: Baseline JIT (CodegenLIR), defect, P2)

x86
Solaris
defect

Tracking

(Not tracked)

VERIFIED FIXED
flash10.1

People

(Reporter: lhansen, Assigned: lhansen)

References

Details

Attachments

(1 file)

The code: #if defined __SUNPRO_CC // from Sun Studio C++ Readme: #pragma align inside namespace requires // mangled names static uint32_t temp[] = {0, 0, 0, 0, 0, 0, 0}; static uint32_t *negateMask = (uint32_t *)alignUp(temp, 16); negateMask[1] = 0x80000000; #else static const AVMPLUS_ALIGN16(uint32_t) negateMask[] = {0,0x80000000,0,0}; #endif SSE_XORPD(rr, negateMask); The write to negateMask is probably OK in practice because every thread would write the same value at the same location and every thread would write before it reads; even so, is this code actually necessary? Selecting one of a short array of constant arrays would seem like the better code.
Blocks a P2/Flash10.x bug.
Priority: -- → P2
Target Milestone: --- → flash10.x
Assignee: nobody → lhansen
Attached patch PatchSplinter Review
Move the initialization to the global level, where (presumably) standard initialization of statics will ensure that it's initialized before a second thread is created.
Attachment #402827 - Flags: review?(edwsmith)
Attachment #402827 - Flags: review?(edwsmith) → review+
redux changeset: 2605:07a7e0e8361f
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: