From: Peter Johnson Date: Thu, 15 Jun 2006 04:55:47 +0000 (-0000) Subject: Fix farith and farithp instructions for GAS mode (e.g. fsubr). X-Git-Tag: v0.5.0~1^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=447aa4a55c228c761d8e810e1abe5214cc03402e;p=yasm Fix farith and farithp instructions for GAS mode (e.g. fsubr). The easiest way to fix these was to adjust the GAP input file to have NASM and GAS versions of these instructions. Tests added to check both NASM and GAS (farith.asm and gas-farithr.asm respectively). svn path=/trunk/yasm/; revision=1579 --- diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index a70b470c..c2c79ccb 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -48,6 +48,9 @@ EXTRA_DIST += modules/arch/x86/tests/far64.hex EXTRA_DIST += modules/arch/x86/tests/farbasic.asm EXTRA_DIST += modules/arch/x86/tests/farbasic.errwarn EXTRA_DIST += modules/arch/x86/tests/farbasic.hex +EXTRA_DIST += modules/arch/x86/tests/farithr.asm +EXTRA_DIST += modules/arch/x86/tests/farithr.errwarn +EXTRA_DIST += modules/arch/x86/tests/farithr.hex EXTRA_DIST += modules/arch/x86/tests/fcmov.asm EXTRA_DIST += modules/arch/x86/tests/fcmov.errwarn EXTRA_DIST += modules/arch/x86/tests/fcmov.hex diff --git a/modules/arch/x86/tests/farithr.asm b/modules/arch/x86/tests/farithr.asm new file mode 100644 index 00000000..6b004dad --- /dev/null +++ b/modules/arch/x86/tests/farithr.asm @@ -0,0 +1,9 @@ + fsub st1 + fsubp st1 + fsubr st1 + fsubrp st1 + fdiv st1 + fdivp st1 + fdivr st1 + fdivrp st1 + diff --git a/modules/arch/x86/tests/farithr.errwarn b/modules/arch/x86/tests/farithr.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/arch/x86/tests/farithr.hex b/modules/arch/x86/tests/farithr.hex new file mode 100644 index 00000000..7d06b3c1 --- /dev/null +++ b/modules/arch/x86/tests/farithr.hex @@ -0,0 +1,16 @@ +d8 +e1 +de +e9 +d8 +e9 +de +e1 +d8 +f1 +de +f9 +d8 +f9 +de +f1 diff --git a/modules/arch/x86/tests/gas32/Makefile.inc b/modules/arch/x86/tests/gas32/Makefile.inc index e8b5d1d2..7d8b122b 100644 --- a/modules/arch/x86/tests/gas32/Makefile.inc +++ b/modules/arch/x86/tests/gas32/Makefile.inc @@ -6,6 +6,9 @@ EXTRA_DIST += modules/arch/x86/tests/gas32/x86_gas32_test.sh EXTRA_DIST += modules/arch/x86/tests/gas32/align32.asm EXTRA_DIST += modules/arch/x86/tests/gas32/align32.errwarn EXTRA_DIST += modules/arch/x86/tests/gas32/align32.hex +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farithr.asm +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farithr.errwarn +EXTRA_DIST += modules/arch/x86/tests/gas32/gas-farithr.hex EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.asm EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.errwarn EXTRA_DIST += modules/arch/x86/tests/gas32/gas-movdq32.hex diff --git a/modules/arch/x86/tests/gas32/gas-farithr.asm b/modules/arch/x86/tests/gas32/gas-farithr.asm new file mode 100644 index 00000000..ded3800b --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-farithr.asm @@ -0,0 +1,10 @@ +.text + fsub %st(0),%st(1) + fsubp %st(0),%st(1) + fsubr %st(0),%st(1) + fsubrp %st(0),%st(1) + fdiv %st(0),%st(1) + fdivp %st(0),%st(1) + fdivr %st(0),%st(1) + fdivrp %st(0),%st(1) + diff --git a/modules/arch/x86/tests/gas32/gas-farithr.errwarn b/modules/arch/x86/tests/gas32/gas-farithr.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/arch/x86/tests/gas32/gas-farithr.hex b/modules/arch/x86/tests/gas32/gas-farithr.hex new file mode 100644 index 00000000..8b802893 --- /dev/null +++ b/modules/arch/x86/tests/gas32/gas-farithr.hex @@ -0,0 +1,376 @@ +7f +45 +4c +46 +01 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +03 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +b0 +00 +00 +00 +00 +00 +00 +00 +34 +00 +00 +00 +00 +00 +28 +00 +05 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +dc +e1 +de +e1 +dc +e9 +de +e9 +dc +f1 +de +f1 +dc +f9 +de +f9 +00 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +50 +00 +00 +00 +21 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +74 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +78 +00 +00 +00 +30 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +04 +00 +00 +00 +10 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/arch/x86/x86parse.gap b/modules/arch/x86/x86parse.gap index 5dc170c4..b8b5e3cb 100644 --- a/modules/arch/x86/x86parse.gap +++ b/modules/arch/x86/x86parse.gap @@ -347,21 +347,29 @@ INSN - fldz NONE twobyte 0xD9EE CPU_FPU INSN - fadd "ls" farith 0x00C0C0 CPU_FPU INSN - faddp NONE farithp 0xC0 CPU_FPU INSN - fiadd "ls" fiarith 0x00DA CPU_FPU -INSN - fsub "ls" farith 0x04E0E8 CPU_FPU +INSN nasm fsub NONE farith 0x04E0E8 CPU_FPU +INSN gas fsub "ls" farith 0x04E8E0 CPU_FPU INSN - fisub "ls" fiarith 0x04DA CPU_FPU -INSN - fsubp NONE farithp 0xE8 CPU_FPU -INSN - fsubr "ls" farith 0x05E8E0 CPU_FPU +INSN nasm fsubp NONE farithp 0xE8 CPU_FPU +INSN gas fsubp NONE farithp 0xE0 CPU_FPU +INSN nasm fsubr NONE farith 0x05E8E0 CPU_FPU +INSN gas fsubr "ls" farith 0x05E0E8 CPU_FPU INSN - fisubr "ls" fiarith 0x05DA CPU_FPU -INSN - fsubrp NONE farithp 0xE0 CPU_FPU +INSN nasm fsubrp NONE farithp 0xE0 CPU_FPU +INSN gas fsubrp NONE farithp 0xE8 CPU_FPU INSN - fmul "ls" farith 0x01C8C8 CPU_FPU INSN - fimul "ls" fiarith 0x01DA CPU_FPU INSN - fmulp NONE farithp 0xC8 CPU_FPU -INSN - fdiv "ls" farith 0x06F0F8 CPU_FPU +INSN nasm fdiv NONE farith 0x06F0F8 CPU_FPU +INSN gas fdiv "ls" farith 0x06F8F0 CPU_FPU INSN - fidiv "ls" fiarith 0x06DA CPU_FPU -INSN - fdivp NONE farithp 0xF8 CPU_FPU -INSN - fdivr "ls" farith 0x07F8F0 CPU_FPU +INSN nasm fdivp NONE farithp 0xF8 CPU_FPU +INSN gas fdivp NONE farithp 0xF0 CPU_FPU +INSN nasm fdivr NONE farith 0x07F8F0 CPU_FPU +INSN gas fdivr "ls" farith 0x07F0F8 CPU_FPU INSN - fidivr "ls" fiarith 0x07DA CPU_FPU -INSN - fdivrp NONE farithp 0xF0 CPU_FPU +INSN nasm fdivrp NONE farithp 0xF0 CPU_FPU +INSN gas fdivrp NONE farithp 0xF8 CPU_FPU INSN - f2xm1 NONE twobyte 0xD9F0 CPU_FPU INSN - fyl2x NONE twobyte 0xD9F1 CPU_FPU INSN - fptan NONE twobyte 0xD9F2 CPU_FPU