This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: complex vs. __builtin_cpow


Gabriel Dos Reis <gdr@integrable-solutions.net> writes:

[...]

| | Is this supposed to be uncommented?
| 
| No, it is supposed to be in comment, awaiting for the resolution of
| the "clog" issue I alluded to in message
| 
|    http://gcc.gnu.org/ml/libstdc++/2004-05/msg00236.html
| 
| ans follow-ups (and I still have to send you several examples).
| 
| Until we resolve that issue.  The line in the patch
| 
|   template<typename _Tp>
|     inline complex<_Tp>
|     log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); }
| 
| should really have been
| 
|   template<typename _Tp>
|     inline complex<_Tp>
|     log(const complex<_Tp>& __z) { return __complex_log(__z); }
| 
| without call to .__rep().

Like this:


Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/ChangeLog,v
retrieving revision 1.2501
diff -p -r1.2501 ChangeLog
*** ChangeLog	31 May 2004 21:19:50 -0000	1.2501
--- ChangeLog	2 Jun 2004 21:01:26 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2004-06-02  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+ 
+ 	* include/std/std_complex.h (log): Tidy.
+ 
  2004-05-31  Benjamin Kosnik  <bkoz@redhat.com>
  
  	* config/linker-map.gnu (GLIBCXX_3.4.1): Add.
Index: include/std/std_complex.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_complex.h,v
retrieving revision 1.15
diff -p -r1.15 std_complex.h
*** include/std/std_complex.h	30 May 2004 14:41:39 -0000	1.15
--- include/std/std_complex.h	2 Jun 2004 21:01:26 -0000
*************** namespace std
*** 732,742 ****
  
    inline __complex__ long double
    __complex_log(const __complex__ long double& __z)
!   { return __builtin_clog(__z); } */
  
    template<typename _Tp>
      inline complex<_Tp>
!     log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); }
  
    template<typename _Tp>
      inline complex<_Tp>
--- 732,745 ----
  
    inline __complex__ long double
    __complex_log(const __complex__ long double& __z)
!   { return __builtin_clogl(__z); } */
  
+   // FIXME: Currently wer don't use built-ins for log() because of some
+   //        obscure user name-space issues.  So, we use the generic version
+   //        which is why we don't use __z.__rep() in the call below.
    template<typename _Tp>
      inline complex<_Tp>
!     log(const complex<_Tp>& __z) { return __complex_log(__z); }
  
    template<typename _Tp>
      inline complex<_Tp>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]