0

tan(pi)X87 FPTAN と FDIVR で計算したい:

#include <stdio.h>
int main(){

  double answer,angle=3.14;
  __asm__ ("FPTAN;"
       "FDIVR;"
       : "=t" (answer) : "0" (angle));
  printf ("angle = %g\n",angle);
  printf ("answer = %g\n",answer);

}

しかし、コンパイルエラーが発生します

error: unknown use of instruction mnemonic without a size suffix
      __asm__ ("FPTAN;"
               ^
<inline asm>:1:8: note: instantiated into assembly here
        FPTAN;FDIVR;
              ^
1 error generated.

どうすればエラーを乗り切ることができますか? サイズのサフィックスが必要なようですが、命令の作成方法がわかりません。

詳細については、「gcc -v」が返されます

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
4

0 に答える 0