diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2018-02-14 11:09:07 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2018-02-14 11:09:07 -0800 |
commit | 8524e163033c9b2fd7c2559f584b7c88fc15ccff (patch) | |
tree | e1c0c416ee8ec2585b257c2c83f2b825b3e67995 | |
parent | 9f45a77f46829e666b35530939b9237cf978d4dc (diff) | |
download | nasm-8524e163033c9b2fd7c2559f584b7c88fc15ccff.tar.gz |
insns.dat: add aliases of the RET instruction with explicit operand size
Make it possible to generate variants of RET(F) with explicit operand
size specified without having to use o16/o32/o64.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | doc/changes.src | 6 | ||||
-rw-r--r-- | test/ret.asm | 56 | ||||
-rw-r--r-- | x86/insns.dat | 20 |
3 files changed, 81 insertions, 1 deletions
diff --git a/doc/changes.src b/doc/changes.src index e72457c2..ddfe6b38 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -7,6 +7,12 @@ The NASM 2 series supports x86-64, and is the production version of NASM since 2007. +\S{cl-2.13.04} Version 2.13.04 + +\b Added \c{-W}, \c{-D}, and \c{-Q} suffix aliases for \c{RET} + instructions so the operand sizes of these instructions can be + encoded without using \c{o16}, \c{o32} or \c{o64}. + \S{cl-2.13.03} Version 2.13.03 \b Added AVX and AVX512 \c{VAES*} and \c{VPCLMULQDQ} instructions. diff --git a/test/ret.asm b/test/ret.asm new file mode 100644 index 00000000..a6aa5332 --- /dev/null +++ b/test/ret.asm @@ -0,0 +1,56 @@ + ;; All the flavors of RET +%ifndef ERROR + %define ERROR 0 +%endif + + + bits 16 + + ret + retn + retf + retw + retnw + retfw + retd + retnd + retfd +%if ERROR + retq + retnq + retfq +%endif + + bits 32 + + ret + retn + retf + retw + retnw + retfw + retd + retnd + retfd +%if ERROR + retq + retnq + retfq +%endif + + bits 64 + + ret + retn + retf ; Probably should have been RETFQ, but: legacy... + retw + retnw + retfw +%if ERROR + retd + retnd +%endif + retfd + retq + retnq + retfq diff --git a/x86/insns.dat b/x86/insns.dat index a05fdc7e..28f591b5 100644 --- a/x86/insns.dat +++ b/x86/insns.dat @@ -1,6 +1,6 @@ ;; -------------------------------------------------------------------------- ;; -;; Copyright 1996-2017 The NASM Authors - All Rights Reserved +;; Copyright 1996-2018 The NASM Authors - All Rights Reserved ;; See the file AUTHORS included with the NASM distribution for ;; the specific copyright holders. ;; @@ -1127,6 +1127,24 @@ RETF void [ cb] 8086 RETF imm [i: ca iw] 8086,SW RETN void [ c3] 8086,BND RETN imm [i: c2 iw] 8086,SW,BND +RETW void [ o16 c3] 8086,BND +RETW imm [i: c2 iw] 8086,SW,BND +RETFW void [ o16 cb] 8086 +RETFW imm [i: o16 ca iw] 8086,SW +RETNW void [ o16 c3] 8086,BND +RETNW imm [i: o16 c2 iw] 8086,SW,BND +RETD void [ o32 c3] 8086,BND,NOLONG +RETD imm [i: o32 c2 iw] 8086,SW,BND,NOLONG +RETFD void [ o32 cb] 8086 +RETFD imm [i: o32 ca iw] 8086,SW +RETND void [ o32 c3] 8086,BND,NOLONG +RETND imm [i: o32 c2 iw] 8086,SW,BND,NOLONG +RETQ void [ o64nw c3] X64,BND +RETQ imm [i: o64nw c2 iw] X64,SW,BND +RETFQ void [ o64 cb] X64 +RETFQ imm [i: o64 ca iw] X64,SW +RETNQ void [ o64nw c3] X64,BND +RETNQ imm [i: o64nw c2 iw] X64,SW,BND ROL rm8,unity [m-: d0 /0] 8086 ROL rm8,reg_cl [m-: d2 /0] 8086 |