From: Peter Johnson Date: Mon, 22 May 2006 06:19:04 +0000 (-0000) Subject: * x86parse.gap: Update pushf generation to match popf for legalization and X-Git-Tag: v0.5.0~7^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d9deea532e8b6e3aee321eb554055178427fd36;p=yasm * x86parse.gap: Update pushf generation to match popf for legalization and prefix regarding pushfq vs 64-bit mode. * pushf.asm, pushf-err.asm: New tests for pushf and popf in all modes. Reported by: Vivek Mohan svn path=/trunk/yasm/; revision=1542 --- diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 037ec822..2e075691 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -130,6 +130,11 @@ EXTRA_DIST += modules/arch/x86/tests/pshift.hex EXTRA_DIST += modules/arch/x86/tests/push64.asm EXTRA_DIST += modules/arch/x86/tests/push64.errwarn EXTRA_DIST += modules/arch/x86/tests/push64.hex +EXTRA_DIST += modules/arch/x86/tests/pushf.asm +EXTRA_DIST += modules/arch/x86/tests/pushf.errwarn +EXTRA_DIST += modules/arch/x86/tests/pushf.hex +EXTRA_DIST += modules/arch/x86/tests/pushf-err.asm +EXTRA_DIST += modules/arch/x86/tests/pushf-err.errwarn EXTRA_DIST += modules/arch/x86/tests/pushnosize.asm EXTRA_DIST += modules/arch/x86/tests/pushnosize.errwarn EXTRA_DIST += modules/arch/x86/tests/pushnosize.hex diff --git a/modules/arch/x86/tests/pushf-err.asm b/modules/arch/x86/tests/pushf-err.asm new file mode 100644 index 00000000..13ea4977 --- /dev/null +++ b/modules/arch/x86/tests/pushf-err.asm @@ -0,0 +1,29 @@ +[bits 16] +pushf +pushfw +pushfd +pushfq +popf +popfw +popfd +popfq + +[bits 32] +pushf +pushfw +pushfd +pushfq +popf +popfw +popfd +popfq + +[bits 64] +pushf +pushfw +pushfd +pushfq +popf +popfw +popfd +popfq diff --git a/modules/arch/x86/tests/pushf-err.errwarn b/modules/arch/x86/tests/pushf-err.errwarn new file mode 100644 index 00000000..21e094f3 --- /dev/null +++ b/modules/arch/x86/tests/pushf-err.errwarn @@ -0,0 +1,10 @@ +-:5: warning: `pushfq' is an instruction in 64-bit mode +-:9: warning: `popfq' is an instruction in 64-bit mode +-:15: redefinition of `pushfq' +-:10: `pushfq' previously defined here +-:15: warning: `pushfq' is an instruction in 64-bit mode +-:19: redefinition of `popfq' +-:18: `popfq' previously defined here +-:19: warning: `popfq' is an instruction in 64-bit mode +-:24: `pushfd' invalid in 64-bit mode +-:28: `popfd' invalid in 64-bit mode diff --git a/modules/arch/x86/tests/pushf.asm b/modules/arch/x86/tests/pushf.asm new file mode 100644 index 00000000..35a504ef --- /dev/null +++ b/modules/arch/x86/tests/pushf.asm @@ -0,0 +1,29 @@ +[bits 16] +pushf +pushfw +pushfd +;pushfq +popf +popfw +popfd +;popfq + +[bits 32] +pushf +pushfw +pushfd +;pushfq +popf +popfw +popfd +;popfq + +[bits 64] +pushf +pushfw +;pushfd +pushfq +popf +popfw +;popfd +popfq diff --git a/modules/arch/x86/tests/pushf.errwarn b/modules/arch/x86/tests/pushf.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/arch/x86/tests/pushf.hex b/modules/arch/x86/tests/pushf.hex new file mode 100644 index 00000000..c34b407d --- /dev/null +++ b/modules/arch/x86/tests/pushf.hex @@ -0,0 +1,24 @@ +9c +9c +66 +9c +9d +9d +66 +9d +9c +66 +9c +9c +9d +66 +9d +9d +9c +66 +9c +9c +9d +66 +9d +9d diff --git a/modules/arch/x86/x86parse.gap b/modules/arch/x86/x86parse.gap index ffcc9bcb..82f4d3bf 100644 --- a/modules/arch/x86/x86parse.gap +++ b/modules/arch/x86/x86parse.gap @@ -80,11 +80,11 @@ INSN - clts NONE twobyte 0x0F06 CPU_286|CPU_Priv INSN - cmc NONE onebyte 0x00F5 CPU_Any INSN - lahf NONE onebyte 0x009F CPU_Any INSN - sahf NONE onebyte 0x009E CPU_Any -INSN - pushf NONE onebyte 0x009C CPU_Any -INSN nasm pushfd NONE onebyte 0x209C CPU_386 -INSN gas pushfl NONE onebyte 0x209C CPU_386 -INSN - pushfw NONE onebyte 0x109C CPU_Any -INSN - pushfq NONE onebyte 0x409C CPU_Hammer|CPU_64 +INSN - pushf NONE onebyte 0x40009C CPU_Any +INSN nasm pushfd NONE onebyte 0x00209C CPU_386|CPU_Not64 +INSN gas pushfl NONE onebyte 0x00209C CPU_386|CPU_Not64 +INSN - pushfw NONE onebyte 0x40109C CPU_Any +INSN - pushfq NONE onebyte 0x40409C CPU_Hammer|CPU_64 INSN - popf NONE onebyte 0x40009D CPU_Any INSN nasm popfd NONE onebyte 0x00209D CPU_386|CPU_Not64 INSN gas popfl NONE onebyte 0x00209D CPU_386|CPU_Not64