Commit Graph

106 Commits

Author SHA1 Message Date
H. Peter Anvin
7c71949931 AVX: instruction table up to PE
Complete the instruction table up to and including PE (document
319433-002, start next on page 5-330).
2008-05-21 23:21:57 -07:00
H. Peter Anvin
895f56b611 Add legacy blendvpd to avx.asm, as a disassembler test. 2008-05-21 15:03:26 -07:00
H. Peter Anvin
52dc353868 Handle is4 bytes without meaningful information in the bottom bits
Support is4 bytes without meaningful information in the bottom bits.
This is equivalent to /is4=0 for the assembler, but makes the bottom
bits don't care for the disassembler.
2008-05-20 19:29:04 -07:00
H. Peter Anvin
e303936391 Fix encoding of VPERMIL2PS instructions 2008-05-06 20:06:14 -07:00
H. Peter Anvin
7334e3ac23 Initial NDISASM support for AVX instructions/VEX prefixes
Initial NDISASM support for AVX instructions and VEX prefixes.  It
doesn't mean it's correct, but it seems to match my current
understanding.  It can disassemble *some*, but not *all*, of the AVX
test cases (which are known to be at least partially incorrect...)
2008-05-05 18:47:27 -07:00
H. Peter Anvin
d85d250fa2 First cut at AVX machinery.
First cut at AVX machinery support.  The only instruction implemented
is VPERMIL2PS, and it's probably buggy.  I'm checking this in with the
hope that other people can start helping out with (a) testing this,
and (b) adding instructions.

NDISASM support is not there yet.
2008-05-04 17:53:31 -07:00
H. Peter Anvin
accf94ea24 Better handling of 32-bit imms in 64-bit moves
A much better way to handle the 32-bit immediates in 64-bit moves.
Add a test file.
2008-03-19 14:52:27 -07:00
H. Peter Anvin
134b94665d Add %ifempty and variants 2008-02-16 17:01:40 -08:00
H. Peter Anvin
cbf768d67d Implement %iftoken, test for a single token
Implement %iftoken, a test for a single token.  This is useful in
cases using %+ to splice a macro-provided token.
2008-02-16 16:41:25 -08:00
H. Peter Anvin
6b18bcce46 BR 774131: date and time macros
This checkin creates the following date and time macros:

__DATE__, __TIME__, __UTC_DATE__, __UTC_TIME__: strings

__DATE_NUM__, __TIME_NUM__, __UTC_DATE_NUM__, __UTC_TIME_NUM__:
civil dates in digit-string formats

__POSIX_TIME__: time in POSIX time_t format
2008-02-16 14:54:10 -08:00
H. Peter Anvin
053a01f143 Test for BR 1879590 2008-01-30 14:13:46 -08:00
Beroset
095e6a2973 regularized spelling of license to match name of LICENSE file 2007-12-29 09:44:23 -05:00
H. Peter Anvin
7812644665 BR 993895: Support zero-operand floating-point insn
Support the zero-operand form of floating-point instructions.  Note
that in most cases, the form generated is actually the "popping" form,
e.g. "FADD" becomes "FADDP st0,st1".  This is in accordance with the
Intel documentation.  "FADDP" is also supported.
2007-11-15 14:38:19 -08:00
H. Peter Anvin
bb72f7f111 Un-special-case "xchg rax,rax"; disassemble o64
Un-special-case "xchg rax,rax"; allow it to be encoded as 48 90 for
orthogonality's sake.  It's a no-op, to be sure, but so are many other
instructions.

"xchg eax,eax" is still special-cased in 64-bit mode since it is not a
no-op; unadorned opcode 90 is now simply "nop" and nothing else.

Make the disassembler detect unused REX.W and display them as an "o64"
prefix.
2007-11-12 22:56:07 -08:00
H. Peter Anvin
4b3390eb47 BR 1828866: fix handling of LAR/LSL
Fix handling of LAR/LSL with various sized operands
2007-11-12 22:05:31 -08:00
H. Peter Anvin
f72151f43e Test of XCHG
Test for XCHG
2007-11-12 20:18:33 -08:00
H. Peter Anvin
8781cb0d00 BR 1828103: Fix %arg and %local
Correct the implementation of %arg and %local.

It's questionable how much they make sense for 64-bit mode; even in
32-bit mode one normally make references off the stack pointer instead
of the base pointer (frame pointer), but that requires keeping track
of the stack pointer offset.
2007-11-08 20:01:11 -08:00
H. Peter Anvin
9c98769a33 Permit opcode names as labels as long as they are followed by a colon
Permit opcode names to be used as labels if and only if they are
succeeded by a colon.  Opcode names occurring when parsing expressions
are all treated as labels; a leading colon occurred when parsing an
instruction forces a parser restart with the instruction forcibly
treated as an identifier.
2007-11-04 21:10:42 -08:00
H. Peter Anvin
1b9dd7d1e1 Even more "riprel" tests
Add a64 and a32 combinations.
2007-10-31 10:59:26 -07:00
H. Peter Anvin
a30acb52cd floatx.asm: add tests for "rounds up to smallest denorm"
Add tests for the case where we round upwards to reach the smallest
possible denorm, i.e. "saved from underflow by rounding."
2007-10-30 01:17:57 -07:00
H. Peter Anvin
84b5d2c539 Exhaustive test for 8-bit floating point values 2007-10-30 00:59:27 -07:00
H. Peter Anvin
2ce0274303 Use a 32-bit floating-point limb size; support 8-bit float
Use a 32-bit limb size ("like a digit, but bigger") for floating-point
conversion.  This cuts the number of multiplications per constant by a
factor of four.

This means supporting fractional-limb-sized numbers, so while we're at
it, add support for 8-bit floating point numbers (apparently used in
graphics and in audio compression applications.)
2007-10-29 20:20:12 -07:00
H. Peter Anvin
6745d722f4 Test of some addressing modes in 64-bit mode. 2007-10-28 23:23:24 -07:00
H. Peter Anvin
083f0c32e7 readnum(): handle prefix-suffix collision like "0h"
Suffixed versions of zero will look like both a prefix and a suffix.
Reject the prefixed version as being too short to decode.
2007-10-26 21:38:02 -07:00
H. Peter Anvin
c2df282092 Fix the handling of floating-point tokens in the preprocessor
Correct the handling of floating-point tokens in the preprocessor.
The preprocessor scanner and the main scanner really are painfully
divergent for no good reason.
2007-10-24 15:29:51 -07:00
H. Peter Anvin
50620f4a3f Unbreak particularly tricky hex constants
Unbreak hex constants which contain 'b' or 'd' in potentially tricky
places.
2007-10-22 19:48:06 -07:00
H. Peter Anvin
c65a2f634b Support binary and octal floating-point
For consistency, support binary and octal floating-point, and accept
a "0d" or "0t" prefix for decimal floating-point.  However, we do not
accept a binary exponent (p) for a decimal mantissa, or vice versa.
2007-10-22 17:34:10 -07:00
H. Peter Anvin
bea0bbb62c More consistent handling of radix letters
Allow any radix letter from the set [bydtoqhx] to be used either
"Intel-style" (0...x) or "C-style" (0x...).  In Intel style, the
leading 0 remains optional as long as the first digit is in the range
0-9.

As a consequence, allow the prefix "0h" for hexadecimal floating
point.
2007-10-22 16:53:48 -07:00
H. Peter Anvin
449e04b330 Allow $-prefixed hexadecimal FP as an alternative to 0x
Since we allow the prefix $ instead of 0x for integer constants, do
the same for floating point.  No suffix support at this time; we may
want to consider if that would be appropriate.
2007-10-19 18:33:57 -07:00
H. Peter Anvin
7065309739 Formatting: kill off "stealth whitespace"
"Stealth whitespace" makes it harder to read diffs, and just generally
cause unwanted weirdness.  Do a source-wide pass to get rid of it.
2007-10-19 14:42:29 -07:00
H. Peter Anvin
31420e76d1 test/floatx.asm: fix test case
"dq" should have been "dt"
2007-10-19 14:26:52 -07:00
H. Peter Anvin
513e3c1bd2 uscore.asm: Fix test case
"$1e+16" was missing, instead "$1e16" was duplicated
2007-10-19 14:19:52 -07:00
H. Peter Anvin
37d88e4125 Don't confuse suffixed hexadecimal with floating-point
1e30 is a floating-point constant, but 1e30h is not.  The scanner
won't know that until it sees the "h", so make sure we keep enough
state to be able to distinguish "1e30" (a possible hex constant) from
"1.e30", "1e+30" or "1.0" (unabiguously floating-point.)
2007-10-19 14:10:35 -07:00
H. Peter Anvin
487a087066 test/Makefile: Use -Ox instead of -O999 2007-10-19 13:16:51 -07:00
H. Peter Anvin
361584882e Test of underscored constants 2007-10-19 13:14:06 -07:00
H. Peter Anvin
a366cac2a6 Tests of obscenely large exponents 2007-10-16 15:46:04 -07:00
H. Peter Anvin
125c878e96 Handle rounding of denorms correctly; make fp overflow a warning
- Handle rounding of denorms correctly
- Make fp overflow a warning, not an error (produces Inf)
- Make fp warnings controllable
2007-10-16 11:32:58 -07:00
H. Peter Anvin
61872221ad Add 1.5 as a test case: representative of an exact fraction
1.5 is an exactly representable fraction, useful for test.
2007-10-16 10:31:16 -07:00
H. Peter Anvin
32f21f16fc Add testnos3 from the gdtoa package (floating-point test) 2007-10-15 17:48:43 -07:00
Charles Crayne
b263b504bc Must define types before using them 2007-10-11 20:32:33 -07:00
H. Peter Anvin
f57f55c9cb Revert "floatb.asm: fix broken testcase"
This reverts commit d9e3116be1.

0x513c1704 is 50.49e9, not 50.40e9
2007-10-08 19:26:57 -07:00
H. Peter Anvin
d9e3116be1 floatb.asm: fix broken testcase
50.40e9 as a 32-bit float is 0x513c1704
2007-10-08 18:39:24 -07:00
H. Peter Anvin
36a8f95bd0 Add Frank's floattest.asm test file 2007-10-08 12:12:23 -07:00
H. Peter Anvin
30c3ad1024 zerobyte.asm: use a real instruction to avoid confusing ndisasm
It's useful to be able to disassemble a test case, so avoid mixing
data bytes and code.
2007-10-05 17:44:16 -07:00
H. Peter Anvin
653e03bef5 zerobyte.asm: add test cases for non-initial \170 uses
Add test cases for noninitial uses of \170, in order to test for
accidental duplication of REX prefixes.
2007-10-05 17:42:31 -07:00
H. Peter Anvin
5d4fd7accc Check in the proper zerobyte test
The previous checkin checked in zerobyte.bin, not zerobyte.asm
2007-10-05 17:29:01 -07:00
H. Peter Anvin
c189b44032 Emit REX prefix before literal zero (\170) 2007-10-05 17:04:32 -07:00
H. Peter Anvin
9d14a10858 Add test for problematic floats 2007-10-05 14:36:03 -07:00
H. Peter Anvin
6b74577d7f floatx.asm: add Inf and NaN to the boundary condition tests 2007-10-04 23:51:08 -07:00
H. Peter Anvin
6b8abf54d3 floatx.asm: add specific tests for exponent boundary conditions
Add tests for the exponent boundaries (underflow, denorm, normal).
2007-10-04 23:09:19 -07:00