]> granicus.if.org Git - yasm/commitdiff
* x86parse.gap: Update pushf generation to match popf for legalization and
authorPeter Johnson <peter@tortall.net>
Mon, 22 May 2006 06:19:04 +0000 (06:19 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 22 May 2006 06:19:04 +0000 (06:19 -0000)
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 <vivek.mt@gmail.com>

svn path=/trunk/yasm/; revision=1542

modules/arch/x86/tests/Makefile.inc
modules/arch/x86/tests/pushf-err.asm [new file with mode: 0644]
modules/arch/x86/tests/pushf-err.errwarn [new file with mode: 0644]
modules/arch/x86/tests/pushf.asm [new file with mode: 0644]
modules/arch/x86/tests/pushf.errwarn [new file with mode: 0644]
modules/arch/x86/tests/pushf.hex [new file with mode: 0644]
modules/arch/x86/x86parse.gap

index 037ec8228bd84a9fca3c1b51e37a12a153e6ce7f..2e0756914492b2439bbeb2f271f058e7d4ffa3a8 100644 (file)
@@ -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 (file)
index 0000000..13ea497
--- /dev/null
@@ -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 (file)
index 0000000..21e094f
--- /dev/null
@@ -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 (file)
index 0000000..35a504e
--- /dev/null
@@ -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 (file)
index 0000000..e69de29
diff --git a/modules/arch/x86/tests/pushf.hex b/modules/arch/x86/tests/pushf.hex
new file mode 100644 (file)
index 0000000..c34b407
--- /dev/null
@@ -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 
index ffcc9bcb23359fbc0bb4bf0f156dd605b5821093..82f4d3bf13b94182e4892a9b4c2d1ddd62edcc4d 100644 (file)
@@ -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