[jira] [Created] (ZOOKEEPER-1635) Support x64 architecture for Windows

2013-01-30 Thread Tomas Gutierrez (JIRA)
Tomas Gutierrez created ZOOKEEPER-1635:
--

 Summary: Support x64 architecture for Windows
 Key: ZOOKEEPER-1635
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1635
 Project: ZooKeeper
  Issue Type: Improvement
 Environment: Windows x64 systems.
Reporter: Tomas Gutierrez


x64 target does not support _asm inline  (See: 
http://msdn.microsoft.com/en-us/library/4ks26t93(v=vs.80).aspx)

The proposal is to use native windows function which still valid for i386 and 
x64 architecture.

In order to avoid any potential break, a compilation directive has been added. 
But, the best should be the removal of the asm part.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (ZOOKEEPER-1635) Support x64 architecture for Windows

2013-01-30 Thread Tomas Gutierrez (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tomas Gutierrez updated ZOOKEEPER-1635:
---

Description: 
x64 target does not support _asm inline  (See: 
http://msdn.microsoft.com/en-us/library/4ks26t93(v=vs.80).aspx)

The proposal is to use native windows function which still valid for i386 and 
x64 architecture.

In order to avoid any potential break, a compilation directive has been added. 
But, the best should be the removal of the asm part.


---
sample code
---


int32_t fetch_and_add(volatile int32_t* operand, int incr)
{
#ifndef WIN32
int32_t result;
asm __volatile__(
 "lock xaddl %0,%1\n"
 : "=r"(result), "=m"(*(int *)operand)
 : "0"(incr)
 : "memory");
   return result;
#else

#ifdef WIN32_NOASM
InterlockedExchangeAdd(operand, incr);
return *operand;
#else
volatile int32_t result;
_asm
{
mov eax, operand; //eax = v;
   mov ebx, incr; // ebx = i;
mov ecx, 0x0; // ecx = 0;
lock xadd dword ptr [eax], ecx; 
   lock xadd dword ptr [eax], ebx; 
mov result, ecx; // result = ebx;
 }
 return result;*/
#endif

#endif
}


  was:
x64 target does not support _asm inline  (See: 
http://msdn.microsoft.com/en-us/library/4ks26t93(v=vs.80).aspx)

The proposal is to use native windows function which still valid for i386 and 
x64 architecture.

In order to avoid any potential break, a compilation directive has been added. 
But, the best should be the removal of the asm part.



> Support x64 architecture for Windows
> 
>
> Key: ZOOKEEPER-1635
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1635
> Project: ZooKeeper
>  Issue Type: Improvement
> Environment: Windows x64 systems.
>Reporter: Tomas Gutierrez
>
> x64 target does not support _asm inline  (See: 
> http://msdn.microsoft.com/en-us/library/4ks26t93(v=vs.80).aspx)
> The proposal is to use native windows function which still valid for i386 and 
> x64 architecture.
> In order to avoid any potential break, a compilation directive has been 
> added. But, the best should be the removal of the asm part.
> ---
> sample code
> ---
> int32_t fetch_and_add(volatile int32_t* operand, int incr)
> {
> #ifndef WIN32
> int32_t result;
> asm __volatile__(
>  "lock xaddl %0,%1\n"
>  : "=r"(result), "=m"(*(int *)operand)
>  : "0"(incr)
>  : "memory");
>return result;
> #else
> #ifdef WIN32_NOASM
> InterlockedExchangeAdd(operand, incr);
> return *operand;
> #else
> volatile int32_t result;
> _asm
> {
> mov eax, operand; //eax = v;
>mov ebx, incr; // ebx = i;
> mov ecx, 0x0; // ecx = 0;
> lock xadd dword ptr [eax], ecx; 
>lock xadd dword ptr [eax], ebx; 
> mov result, ecx; // result = ebx;
>  }
>  return result;*/
> #endif
> #endif
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (ZOOKEEPER-1635) Support x64 architecture for Windows

2013-02-01 Thread Tomas Gutierrez (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tomas Gutierrez updated ZOOKEEPER-1635:
---

Fix Version/s: 3.5.0

> Support x64 architecture for Windows
> 
>
> Key: ZOOKEEPER-1635
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1635
> Project: ZooKeeper
>  Issue Type: Improvement
> Environment: Windows x64 systems.
>Reporter: Tomas Gutierrez
> Fix For: 3.5.0
>
>
> x64 target does not support _asm inline  (See: 
> http://msdn.microsoft.com/en-us/library/4ks26t93(v=vs.80).aspx)
> The proposal is to use native windows function which still valid for i386 and 
> x64 architecture.
> In order to avoid any potential break, a compilation directive has been 
> added. But, the best should be the removal of the asm part.
> ---
> sample code
> ---
> int32_t fetch_and_add(volatile int32_t* operand, int incr)
> {
> #ifndef WIN32
> int32_t result;
> asm __volatile__(
>  "lock xaddl %0,%1\n"
>  : "=r"(result), "=m"(*(int *)operand)
>  : "0"(incr)
>  : "memory");
>return result;
> #else
> #ifdef WIN32_NOASM
> InterlockedExchangeAdd(operand, incr);
> return *operand;
> #else
> volatile int32_t result;
> _asm
> {
> mov eax, operand; //eax = v;
>mov ebx, incr; // ebx = i;
> mov ecx, 0x0; // ecx = 0;
> lock xadd dword ptr [eax], ecx; 
>lock xadd dword ptr [eax], ebx; 
> mov result, ecx; // result = ebx;
>  }
>  return result;*/
> #endif
> #endif
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (ZOOKEEPER-1635) Support x64 architecture for Windows

2013-10-15 Thread Tomas Gutierrez (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13795764#comment-13795764
 ] 

Tomas Gutierrez commented on ZOOKEEPER-1635:


It should be both I think. Not really sure why this matter

> Support x64 architecture for Windows
> 
>
> Key: ZOOKEEPER-1635
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1635
> Project: ZooKeeper
>  Issue Type: Improvement
> Environment: Windows x64 systems.
>Reporter: Tomas Gutierrez
> Fix For: 3.5.0
>
>
> x64 target does not support _asm inline  (See: 
> http://msdn.microsoft.com/en-us/library/4ks26t93(v=vs.80).aspx)
> The proposal is to use native windows function which still valid for i386 and 
> x64 architecture.
> In order to avoid any potential break, a compilation directive has been 
> added. But, the best should be the removal of the asm part.
> ---
> sample code
> ---
> int32_t fetch_and_add(volatile int32_t* operand, int incr)
> {
> #ifndef WIN32
> int32_t result;
> asm __volatile__(
>  "lock xaddl %0,%1\n"
>  : "=r"(result), "=m"(*(int *)operand)
>  : "0"(incr)
>  : "memory");
>return result;
> #else
> #ifdef WIN32_NOASM
> InterlockedExchangeAdd(operand, incr);
> return *operand;
> #else
> volatile int32_t result;
> _asm
> {
> mov eax, operand; //eax = v;
>mov ebx, incr; // ebx = i;
> mov ecx, 0x0; // ecx = 0;
> lock xadd dword ptr [eax], ecx; 
>lock xadd dword ptr [eax], ebx; 
> mov result, ecx; // result = ebx;
>  }
>  return result;*/
> #endif
> #endif
> }



--
This message was sent by Atlassian JIRA
(v6.1#6144)