From nobody@FreeBSD.org  Fri May 13 20:14:50 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E405106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 May 2011 20:14:50 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 633658FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 May 2011 20:14:50 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DKEndJ082591
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 May 2011 20:14:49 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p4DKEnCc082590;
	Fri, 13 May 2011 20:14:49 GMT
	(envelope-from nobody)
Message-Id: <201105132014.p4DKEnCc082590@red.freebsd.org>
Date: Fri, 13 May 2011 20:14:49 GMT
From: Ivan Klymenko <fidaj@ukr.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] audio/soundtouch remove broken status for amd64 arch
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         157016
>Category:       ports
>Synopsis:       [patch] audio/soundtouch remove broken status for amd64 arch
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    danfe
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 13 20:20:08 UTC 2011
>Closed-Date:    Sat May 14 19:04:43 UTC 2011
>Last-Modified:  Sat May 14 19:04:43 UTC 2011
>Originator:     Ivan Klymenko
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
individual
>Environment:
>Description:
This patch allows you to remove the error:

  {standard input}: Assembler messages:
  {standard input}:28: Error: suffix or operands invalid for `pop'
  {standard input}:31: Error: suffix or operands invalid for `push'

>How-To-Repeat:

>Fix:
create patch file audio/soundtouch/files/patch-cpu_detect_x86_gcc.cpp


--- ./source/SoundTouch/cpu_detect_x86_gcc.cpp.orig	2009-01-25 18:32:53.000000000 +0200
+++ ./source/SoundTouch/cpu_detect_x86_gcc.cpp	2011-05-13 23:03:42.000000000 +0300
@@ -79,6 +79,11 @@
 

 #else

     uint res = 0;

+#ifdef __x86_64__
+    int64_t edx, eax, ecx;
+#else
+    int edx, eax, ecx;
+#endif
 

     if (_dwDisabledISA == 0xffffffff) return 0;

 

@@ -86,42 +91,55 @@
         "\n\txor     %%esi, %%esi"       // clear %%esi = result register

         // check if 'cpuid' instructions is available by toggling eflags bit 21

 

+#ifdef __x86_64__
+
         "\n\tpushf"                      // save eflags to stack

-        "\n\tpop     %%eax"              // load eax from stack (with eflags)

-        "\n\tmovl    %%eax, %%ecx"       // save the original eflags values to ecx

-        "\n\txor     $0x00200000, %%eax" // toggle bit 21

-        "\n\tpush    %%eax"              // store toggled eflags to stack

+        "\n\tpop     %2"              // load eax from stack (with eflags)

+        "\n\tmov    %2, %3"       // save the original eflags values to ecx

+        "\n\txor     $0x00200000, %2" // toggle bit 21

+        "\n\tpush    %2"              // store toggled eflags to stack

         "\n\tpopf"                       // load eflags from stack

         "\n\tpushf"                      // save updated eflags to stack

-        "\n\tpop     %%eax"              // load from stack

-        "\n\txor     %%edx, %%edx"       // clear edx for defaulting no mmx

-        "\n\tcmp     %%ecx, %%eax"       // compare to original eflags values

+        "\n\tpop     %2"              // load from stack

+#else
+
+        "\n\tpushf"                      // save eflags to stack

+        "\n\tpopl     %2"              // load eax from stack (with eflags)

+        "\n\tmovl    %2, %3"       // save the original eflags values to ecx

+        "\n\txor     $0x00200000, %2" // toggle bit 21

+        "\n\tpush    %2"              // store toggled eflags to stack

+        "\n\tpopf"                       // load eflags from stack

+        "\n\tpushf"                      // save updated eflags to stack

+        "\n\tpopl     %2"              // load from stack

+#endif
+        "\n\txor     %1, %1"       // clear edx for defaulting no mmx

+        "\n\tcmp     %3, %2"       // compare to original eflags values

         "\n\tjz      end"                // jumps to 'end' if cpuid not present

 

         // cpuid instruction available, test for presence of mmx instructions

 

-        "\n\tmovl    $1, %%eax"

+        "\n\tmov    $1, %2"

         "\n\tcpuid"

-//        movl       $0x00800000, %edx   // force enable MMX

-        "\n\ttest    $0x00800000, %%edx"

+//        movl       $0x00800000, %1   // force enable MMX

+        "\n\ttest    $0x00800000, %1"

         "\n\tjz      end"                // branch if MMX not available

 

         "\n\tor      $0x01, %%esi"       // otherwise add MMX support bit

 

-        "\n\ttest    $0x02000000, %%edx"

+        "\n\ttest    $0x02000000, %1"

         "\n\tjz      test3DNow"          // branch if SSE not available

 

         "\n\tor      $0x08, %%esi"       // otherwise add SSE support bit

 

     "\n\ttest3DNow:"

         // test for precense of AMD extensions

-        "\n\tmov     $0x80000000, %%eax"

+        "\n\tmov     $0x80000000, %2"

         "\n\tcpuid"

         "\n\tcmp     $0x80000000, %%eax"

         "\n\tjbe     end"                 // branch if no AMD extensions detected

 

         // test for precense of 3DNow! extension

-        "\n\tmov     $0x80000001, %%eax"

+        "\n\tmov     $0x80000001, %2"

         "\n\tcpuid"

         "\n\ttest    $0x80000000, %%edx"

         "\n\tjz      end"                  // branch if 3DNow! not detected

@@ -132,9 +150,9 @@
 

         "\n\tmov     %%esi, %0"

 

-      : "=r" (res)

+      : "=r" (res), "=d" (edx), "=a" (eax), "=c" (ecx)
       : /* no inputs */

-      : "%edx", "%eax", "%ecx", "%esi" );

+      : "%esi");

       

     return res & ~_dwDisabledISA;

 #endif



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->danfe 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri May 13 20:20:17 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157016 

From: Ivan Klymenko <fidaj@ukr.net>
To: bug-followup@FreeBSD.org, fidaj@ukr.net
Cc:  
Subject: Re: ports/157016: [patch] audio/soundtouch remove broken status for
 amd64 arch
Date: Fri, 13 May 2011 23:34:04 +0300

 --MP_/7q2ugY3RfXPz=aR=E1FncLZ
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 I do not understand that constantly occurs after moderation with my
 patches :(
 
 Patch file in attachment...
 --MP_/7q2ugY3RfXPz=aR=E1FncLZ
 Content-Type: text/plain
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=patch-cpu_detect_x86_gcc.cpp.txt
 
 --- ./source/SoundTouch/cpu_detect_x86_gcc.cpp.orig	2009-01-25 18:32:53.000000000 +0200
 +++ ./source/SoundTouch/cpu_detect_x86_gcc.cpp	2011-05-13 23:03:42.000000000 +0300
 @@ -79,6 +79,11 @@
  
  #else
      uint res = 0;
 +#ifdef __x86_64__
 +    int64_t edx, eax, ecx;
 +#else
 +    int edx, eax, ecx;
 +#endif
  
      if (_dwDisabledISA == 0xffffffff) return 0;
  
 @@ -86,42 +91,55 @@
          "\n\txor     %%esi, %%esi"       // clear %%esi = result register
          // check if 'cpuid' instructions is available by toggling eflags bit 21
  
 +#ifdef __x86_64__
 +
          "\n\tpushf"                      // save eflags to stack
 -        "\n\tpop     %%eax"              // load eax from stack (with eflags)
 -        "\n\tmovl    %%eax, %%ecx"       // save the original eflags values to ecx
 -        "\n\txor     $0x00200000, %%eax" // toggle bit 21
 -        "\n\tpush    %%eax"              // store toggled eflags to stack
 +        "\n\tpop     %2"              // load eax from stack (with eflags)
 +        "\n\tmov    %2, %3"       // save the original eflags values to ecx
 +        "\n\txor     $0x00200000, %2" // toggle bit 21
 +        "\n\tpush    %2"              // store toggled eflags to stack
          "\n\tpopf"                       // load eflags from stack
          "\n\tpushf"                      // save updated eflags to stack
 -        "\n\tpop     %%eax"              // load from stack
 -        "\n\txor     %%edx, %%edx"       // clear edx for defaulting no mmx
 -        "\n\tcmp     %%ecx, %%eax"       // compare to original eflags values
 +        "\n\tpop     %2"              // load from stack
 +#else
 +
 +        "\n\tpushf"                      // save eflags to stack
 +        "\n\tpopl     %2"              // load eax from stack (with eflags)
 +        "\n\tmovl    %2, %3"       // save the original eflags values to ecx
 +        "\n\txor     $0x00200000, %2" // toggle bit 21
 +        "\n\tpush    %2"              // store toggled eflags to stack
 +        "\n\tpopf"                       // load eflags from stack
 +        "\n\tpushf"                      // save updated eflags to stack
 +        "\n\tpopl     %2"              // load from stack
 +#endif
 +        "\n\txor     %1, %1"       // clear edx for defaulting no mmx
 +        "\n\tcmp     %3, %2"       // compare to original eflags values
          "\n\tjz      end"                // jumps to 'end' if cpuid not present
  
          // cpuid instruction available, test for presence of mmx instructions
  
 -        "\n\tmovl    $1, %%eax"
 +        "\n\tmov    $1, %2"
          "\n\tcpuid"
 -//        movl       $0x00800000, %edx   // force enable MMX
 -        "\n\ttest    $0x00800000, %%edx"
 +//        movl       $0x00800000, %1   // force enable MMX
 +        "\n\ttest    $0x00800000, %1"
          "\n\tjz      end"                // branch if MMX not available
  
          "\n\tor      $0x01, %%esi"       // otherwise add MMX support bit
  
 -        "\n\ttest    $0x02000000, %%edx"
 +        "\n\ttest    $0x02000000, %1"
          "\n\tjz      test3DNow"          // branch if SSE not available
  
          "\n\tor      $0x08, %%esi"       // otherwise add SSE support bit
  
      "\n\ttest3DNow:"
          // test for precense of AMD extensions
 -        "\n\tmov     $0x80000000, %%eax"
 +        "\n\tmov     $0x80000000, %2"
          "\n\tcpuid"
          "\n\tcmp     $0x80000000, %%eax"
          "\n\tjbe     end"                 // branch if no AMD extensions detected
  
          // test for precense of 3DNow! extension
 -        "\n\tmov     $0x80000001, %%eax"
 +        "\n\tmov     $0x80000001, %2"
          "\n\tcpuid"
          "\n\ttest    $0x80000000, %%edx"
          "\n\tjz      end"                  // branch if 3DNow! not detected
 @@ -132,9 +150,9 @@
  
          "\n\tmov     %%esi, %0"
  
 -      : "=r" (res)
 +      : "=r" (res), "=d" (edx), "=a" (eax), "=c" (ecx)
        : /* no inputs */
 -      : "%edx", "%eax", "%ecx", "%esi" );
 +      : "%esi");
        
      return res & ~_dwDisabledISA;
  #endif
 
 --MP_/7q2ugY3RfXPz=aR=E1FncLZ--

From: Ivan Klymenko <fidaj@ukr.net>
To: bug-followup@FreeBSD.org, fidaj@ukr.net
Cc:  
Subject: Re: ports/157016: [patch] audio/soundtouch remove broken status for
 amd64 arch
Date: Fri, 13 May 2011 23:55:07 +0300

 Oh my God!...
 
 See the patch here:
 http://pazzle.otdux.com.ua/patch-cpu_detect_x86_gcc.cpp.txt

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/157016: commit references a PR
Date: Sat, 14 May 2011 09:31:06 +0000 (UTC)

 danfe       2011-05-14 09:30:51 UTC
 
   FreeBSD ports repository
 
   Modified files:
     audio/soundtouch     Makefile 
   Added files:
     audio/soundtouch/files patch-cpu_detect_x86_gcc.cpp 
   Log:
   - Fix the build on recent -CURRENT/amd64 [1]
   - While here, add LICENSE (LGPL21)
   
   PR:             ports/157016 [1]
   Submitted by:   Ivan Klymenko
   
   Revision  Changes    Path
   1.22      +3 -7      ports/audio/soundtouch/Makefile
   1.1       +95 -0     ports/audio/soundtouch/files/patch-cpu_detect_x86_gcc.cpp (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: danfe 
State-Changed-When: Sat May 14 19:04:15 UTC 2011 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157016 
>Unformatted:
