diff --git a/src/asm_base.cpp b/src/asm_base.cpp index 087930f0..7302f30d 100644 --- a/src/asm_base.cpp +++ b/src/asm_base.cpp @@ -337,62 +337,80 @@ Error Assembler::defineDataConstant(StrScanner &scan, Insn &insn, uint8_t dataTy const auto hasString = !(type == DATA_BYTE_NO_STRING || type == DATA_WORD_NO_STRING); ErrorAt error; do { - auto p = scan.skipSpaces(); + scan.skipSpaces(); ErrorAt strErr; - if (hasString && isString(p, strErr) == OK) { - generateString(scan, p, insn, type, error); - continue; + if (hasString) { + auto end = scan; + const auto err = isString(end, strErr); + if (err == OK) { + generateString(scan, end, insn, type, strErr); + if (error.setErrorIf(strErr) == NO_MEMORY) + break; + continue; + } } - - const auto at = p; ErrorAt exprErr; + auto p = scan; const auto val = parseExpr(p, exprErr); - if (!endOfLine(p) && *p != ',') - exprErr.setErrorIf(at, ILLEGAL_CONSTANT); - if (!exprErr.hasError()) { - auto v = val.getUnsigned(); - switch (type) { - case DATA_BYTE_OR_WORD: - if (val.overflowUint8()) - goto emit_word; - // Fall-through - case DATA_BYTE: - case DATA_BYTE_NO_STRING: - insn.emitByte(v); - break; - case DATA_BYTE_IN_WORD: - v &= 0xFF; - // Fall-through - case DATA_WORD: - case DATA_WORD_NO_STRING: - emit_word: - big ? insn.emitUint16Be(v) : insn.emitUint16Le(v); - break; - case DATA_LONG: - big ? insn.emitUint32Be(v) : insn.emitUint32Le(v); - break; -#ifndef LIBASM_ASM_NOFLOAT - case DATA_FLOAT32: - big ? insn.emitFloat32Be(val.getFloat()) : insn.emitFloat32Le(val.getFloat()); - break; - case DATA_FLOAT64: - big ? insn.emitFloat64Be(val.getFloat()) : insn.emitFloat64Le(val.getFloat()); - break; -#endif - case DATA_ALIGN2: - break; + if (!endOfLine(p) && *p != ',') { + if (strErr.getError()) { + error.setErrorIf(strErr); + } else { + error.setErrorIf(scan, ILLEGAL_CONSTANT); } - if (exprErr.getError()) - error.setErrorIf(exprErr); - if (insn.getError()) - error.setErrorIf(at, insn); - scan = p; - continue; + break; + } + if (exprErr.hasError()) { + error.setErrorIf(strErr.getError() ? strErr : exprErr); + break; } - return insn.setError(strErr.getError() ? strErr : exprErr); + auto v = val.getUnsigned(); + switch (type) { + case DATA_BYTE_OR_WORD: + if (val.overflowUint8()) + goto emit_word; + // Fall-through + case DATA_BYTE: + case DATA_BYTE_NO_STRING: + exprErr.setErrorIf(scan, insn.emitByte(v)); + break; + case DATA_BYTE_IN_WORD: + v &= 0xFF; + // Fall-through + case DATA_WORD: + case DATA_WORD_NO_STRING: + emit_word: + exprErr.setErrorIf(scan, big ? insn.emitUint16Be(v) : insn.emitUint16Le(v)); + break; + case DATA_LONG: + exprErr.setErrorIf(scan, big ? insn.emitUint32Be(v) : insn.emitUint32Le(v)); + break; + case DATA_FLOAT32: +#if defined(LIBASM_ASM_NOFLOAT) + exprErr.setErrorIf(scan, FLOAT_NOT_SUPPORTED); + insn.emitUint32Be(0); +#else + exprErr.setErrorIf(scan, + big ? insn.emitFloat32Be(val.getFloat()) : insn.emitFloat32Le(val.getFloat())); +#endif + break; + case DATA_FLOAT64: +#if defined(LIBASM_ASM_NOFLOAT) + exprErr.setErrorIf(scan, FLOAT_NOT_SUPPORTED); + insn.emitUint64Be(0); +#else + exprErr.setErrorIf(scan, + big ? insn.emitFloat64Be(val.getFloat()) : insn.emitFloat64Le(val.getFloat())); +#endif + break; + case DATA_ALIGN2: + break; + } + scan = p; + if (error.setErrorIf(exprErr) == NO_MEMORY) + break; } while (scan.skipSpaces().expect(',')); - return insn.setError(error); } diff --git a/src/asm_base.h b/src/asm_base.h index f17cdc4c..4ce206ec 100644 --- a/src/asm_base.h +++ b/src/asm_base.h @@ -80,10 +80,8 @@ struct Assembler { DATA_WORD, DATA_WORD_NO_STRING, DATA_LONG, -#ifndef LIBASM_ASM_NOFLOAT DATA_FLOAT32, DATA_FLOAT64, -#endif DATA_ALIGN2 = 0x80, }; Error defineDataConstant(StrScanner &scan, Insn &insn, uint8_t dataType); diff --git a/src/asm_i8086.cpp b/src/asm_i8086.cpp index a281e306..57d6a1e6 100644 --- a/src/asm_i8086.cpp +++ b/src/asm_i8086.cpp @@ -86,7 +86,7 @@ Error AsmI8086::setFpu(StrScanner &scan) { p.iexpect('i'); if (scan.expectFalse() || scan.iequals_P(TEXT_none)) { setFpuType(FPU_NONE); -#if !defined(LIBASM_I8086_NOFPU) && !defined(LIBASM_I8086_NOFPU) +#if !defined(LIBASM_I8086_NOFPU) } else if (scan.expectTrue() || p.iequals_P(TEXT_FPU_8087)) { setFpuType(FPU_I8087); #endif @@ -619,7 +619,7 @@ void AsmI8086::emitStringInst(AsmInsn &insn, const Operand &dst, const Operand & } } -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) +#if !defined(LIBASM_ASM_NOFLOAT) Error AsmInsn::emitPackedDecimal(int64_t val64) { const auto sign = val64 < 0 ? 0x80 : 0; @@ -642,66 +642,92 @@ Error AsmInsn::emitTemporaryReal(const float80_t &val80) { #endif Error AsmI8086::defineDataConstant( - AsmInsn &insn, StrScanner &scan, I8087Type type, ErrorAt &error) const { + AsmInsn &insn, StrScanner &scan, I8087Type type, ErrorAt &_error) const { + ErrorAt error; do { - auto p = scan.skipSpaces(); - ErrorAt strErr, exprErr; - if (type == DATA_DD && isString(p, strErr) == OK) { - generateString(scan, p, insn.insnBase(), DATA_LONG, error); - } else { - const auto at = p; - const auto val = parseExpr(p, exprErr); - if ((endOfLine(p) || *p == ',') && !exprErr.hasError()) { - switch (type) { - case DATA_DD: - if (val.isInteger()) { - if (val.overflowUint32()) { - error.setErrorIf(at, OVERFLOW_RANGE); - } else if (insn.emitUint32(val.getUnsigned())) { - error.setAt(at); - } - } else { -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) - if (insn.emitFloat32(val.getFloat())) - error.setAt(at); + scan.skipSpaces(); + ErrorAt strErr; + if (type == DATA_DD) { + auto end = scan; + const auto err = isString(end, strErr); + if (err == OK) { + generateString(scan, end, insn.insnBase(), DATA_LONG, strErr); + if (error.setErrorIf(strErr) == NO_MEMORY) + break; + continue; + } + } + ErrorAt exprErr; + auto p = scan; + const auto val = parseExpr(p, exprErr); + if (!endOfLine(p) && *p != ',') { + if (strErr.getError()) { + error.setErrorIf(strErr); + } else { + error.setErrorIf(scan, ILLEGAL_CONSTANT); + } + break; + } + if (exprErr.hasError()) { + error.setErrorIf(strErr.getError() ? strErr : exprErr); + break; + } + switch (type) { + case DATA_DD: + if (val.isInteger()) { + if (val.overflowUint32()) { + exprErr.setErrorIf(scan, OVERFLOW_RANGE); + } else { + exprErr.setErrorIf(scan, insn.emitUint32(val.getUnsigned())); + } + } else { +#if !defined(LIBASM_ASM_NOFLOAT) + exprErr.setErrorIf(scan, insn.emitFloat32(val.getFloat())); #else - error.setErrorIf(at, INTEGER_REQUIRED); + exprErr.setErrorIf(scan, FLOAT_NOT_SUPPORTED); + insn.emitUint32(0); #endif - } - break; -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) - case DATA_DQ: - if (val.isInteger()) { - if (insn.emitUint64(val.getInteger())) - error.setAt(at); - } else if (insn.emitFloat64(val.getFloat())) { - error.setAt(at); - } - break; - case DATA_DT: - if (val.isInteger()) { - constexpr auto PDEC80_MAX = INT64_C(999'999'999'999'999'999); - constexpr auto PDEC80_MIN = -INT64_C(999'999'999'999'999'999); - const auto v = val.getInteger(); - if (v < PDEC80_MIN || v > PDEC80_MAX) { - error.setErrorIf(at, OVERFLOW_RANGE); - } else if (insn.emitPackedDecimal(v)) { - error.setAt(at); - } - } else if (insn.emitTemporaryReal(val.getFloat())) { - error.setAt(at); - } - break; + } + break; + case DATA_DQ: +#if defined(LIBASM_ASM_NOFLOAT) + exprErr.setErrorIf(scan, FLOAT_NOT_SUPPORTED); + insn.emitUint64(0); +#else + if (val.isInteger()) { + exprErr.setErrorIf(scan, insn.emitUint64(val.getInteger())); + } else { + exprErr.setErrorIf(scan, insn.emitFloat64(val.getFloat())); + } #endif + break; + case DATA_DT: +#if defined(LIBASM_ASM_NOFLOAT) + exprErr.setErrorIf(scan, FLOAT_NOT_SUPPORTED); + insn.emitUint16(0); + insn.emitUint64(0); +#else + if (val.isInteger()) { + constexpr auto PDEC80_MAX = INT64_C(999'999'999'999'999'999); + constexpr auto PDEC80_MIN = -INT64_C(999'999'999'999'999'999); + const auto v = val.getInteger(); + if (v < PDEC80_MIN || v > PDEC80_MAX) { + exprErr.setErrorIf(scan, OVERFLOW_RANGE); + } else { + exprErr.setErrorIf(scan, insn.emitPackedDecimal(v)); } - error.setErrorIf(exprErr); - scan = p; } else { - error.setErrorIf(strErr); + exprErr.setErrorIf(scan, insn.emitTemporaryReal(val.getFloat())); } +#endif + break; } - } while (scan.skipSpaces().expect(',') && !error.hasError()); - return error.getError(); + scan = p; + error.setErrorIf(exprErr); + if (error.setErrorIf(exprErr) == NO_MEMORY) + break; + } while (scan.skipSpaces().expect(',')); + return _error.setError(error); } Error AsmI8086::processPseudo(StrScanner &scan, Insn &_insn) { @@ -713,12 +739,10 @@ Error AsmI8086::processPseudo(StrScanner &scan, Insn &_insn) { } if (strcasecmp_P(insn.name(), TEXT_DD) == 0) return defineDataConstant(insn, scan, DATA_DD, _insn); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) if (strcasecmp_P(insn.name(), TEXT_DQ) == 0) return defineDataConstant(insn, scan, DATA_DQ, _insn); if (strcasecmp_P(insn.name(), TEXT_DT) == 0) return defineDataConstant(insn, scan, DATA_DT, _insn); -#endif return Assembler::processPseudo(scan, _insn); } diff --git a/src/asm_i8086.h b/src/asm_i8086.h index 60946ea0..45aad670 100644 --- a/src/asm_i8086.h +++ b/src/asm_i8086.h @@ -59,10 +59,8 @@ struct AsmI8086 final : Assembler, Config { enum I8087Type : char { DATA_DD = 'D', // 32-bit binary or IEEE 754 floating point number -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) DATA_DQ = 'Q', // 64-bit binary or IEEE 754 floating point number DATA_DT = 'T' // 80-bit BCD or i8087 Temporary Real -#endif }; Error defineDataConstant(AsmInsn &insn, StrScanner &scan, I8087Type type, ErrorAt &error) const; Error processPseudo(StrScanner &scan, Insn &insn) override; diff --git a/src/asm_mc68000.cpp b/src/asm_mc68000.cpp index 7202d3bc..61f371c5 100644 --- a/src/asm_mc68000.cpp +++ b/src/asm_mc68000.cpp @@ -27,6 +27,7 @@ using namespace reg; using namespace text::common; using namespace text::option; +using text::mc68000::TEXT_FMOVE; using text::mc68000::TEXT_FPU_68881; using text::mc68000::TEXT_FPU_MC68881; @@ -48,11 +49,11 @@ constexpr Pseudo PSEUDOS[] PROGMEM = { {TEXT_dALIGN, &Assembler::alignOrigin}, {TEXT_DC, &Assembler::defineDataConstant, Assembler::DATA_WORD|Assembler::DATA_ALIGN2}, {TEXT_DC_B, &Assembler::defineDataConstant, Assembler::DATA_BYTE}, -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) {TEXT_DC_D, &Assembler::defineDataConstant, Assembler::DATA_FLOAT64|Assembler::DATA_ALIGN2}, #endif {TEXT_DC_L, &Assembler::defineDataConstant, Assembler::DATA_LONG|Assembler::DATA_ALIGN2}, -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) {TEXT_DC_S, &Assembler::defineDataConstant, Assembler::DATA_FLOAT32|Assembler::DATA_ALIGN2}, #endif {TEXT_DC_W, &Assembler::defineDataConstant, Assembler::DATA_WORD|Assembler::DATA_ALIGN2}, @@ -99,7 +100,7 @@ void AsmMc68000::reset() { Error AsmMc68000::setFpu(StrScanner &scan) { if (scan.expectFalse() || scan.iequals_P(TEXT_none)) { setFpuType(FPU_NONE); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) } else if (scan.expectTrue() || scan.iequals_P(TEXT_FPU_68881) || scan.iequals_P(TEXT_FPU_MC68881)) { setFpuType(FPU_MC68881); @@ -297,7 +298,22 @@ void AsmMc68000::encodeImmediate(AsmInsn &insn, const Operand &op, OprSize size) insn.setErrorIf(op, OVERFLOW_RANGE); insn.emitOperand16(static_cast(val32)); break; -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if defined(LIBASM_ASM_NOFLOAT) || defined(LIBASM_MC68000_NOFPU) + case SZ_SNGL: + insn.setErrorIf(op, FLOAT_NOT_SUPPORTED); + insn.emitUint32(0, insn.operandPos()); + break; + case SZ_DUBL: + insn.setErrorIf(op, FLOAT_NOT_SUPPORTED); + insn.emitUint64(0, insn.operandPos()); + break; + case SZ_XTND: + case SZ_PBCD: + insn.setErrorIf(op, FLOAT_NOT_SUPPORTED); + insn.emitUint32(0, insn.operandPos()); + insn.emitUint64(0, insn.operandPos()); + break; +#else case SZ_SNGL: insn.emitFloat32(op.val.getFloat(), insn.operandPos()); break; @@ -877,28 +893,44 @@ Error AsmInsn::emitDecimalString(const float80_t &value, uint8_t pos) { return getError(); } +#endif + Error AsmMc68000::defineDataConstant( - AsmInsn &insn, StrScanner &scan, Mc68881Type type, ErrorAt &error) const { + AsmInsn &insn, StrScanner &scan, Mc68881Type type, ErrorAt &_error) const { insn.insnBase().align(2); + ErrorAt error; do { - auto p = scan.skipSpaces(); - const auto at = p; - const auto val = parseExpr(p, error); - if ((endOfLine(p) || *p == ',') && !error.hasError()) { - if (type == DATA_DCX) { - if (insn.emitExtendedReal(val.getFloat(), insn.length())) - error.setAt(at); - } else { // DATA_DCP - if (insn.emitDecimalString(val.getFloat(), insn.length())) - error.setAt(at); - } - scan = p; + scan.skipSpaces(); + ErrorAt exprErr; + auto p = scan; + const auto val = parseExpr(p, exprErr); + if (!endOfLine(p) && *p != ',') { + error.setErrorIf(scan, ILLEGAL_CONSTANT); + break; } - } while (scan.skipSpaces().expect(',') && !error.hasError()); - return error.getError(); -} - + if (exprErr.hasError()) { + error.setErrorIf(exprErr); + break; + } +#if defined(LIBASM_MC68000_NOFPU) + (void)val; +#elif defined(LIBASM_ASM_NOFLOAT) + (void)val; + exprErr.setErrorIf(scan, FLOAT_NOT_SUPPORTED); + insn.emitUint32(0, insn.length()); + insn.emitUint64(0, insn.length()); +#else + if (type == DATA_DCX) + exprErr.setErrorIf(scan, insn.emitExtendedReal(val.getFloat(), insn.length())); + if (type == DATA_DCP) + exprErr.setErrorIf(scan, insn.emitDecimalString(val.getFloat(), insn.length())); #endif + scan = p; + if (error.setErrorIf(exprErr) == NO_MEMORY) + break; + } while (scan.skipSpaces().expect(',') && error.getError() != NO_MEMORY); + return _error.setError(error); +} Error AsmMc68000::processPseudo(StrScanner &scan, Insn &_insn) { AsmInsn insn(_insn); @@ -907,7 +939,7 @@ Error AsmMc68000::processPseudo(StrScanner &scan, Insn &_insn) { const auto error = _opt_fpu.set(scan); return error ? insn.setErrorIf(at, error) : OK; } -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) if (strcasecmp_P(insn.name(), TEXT_DC_X) == 0) return defineDataConstant(insn, scan, DATA_DCX, _insn); if (strcasecmp_P(insn.name(), TEXT_DC_P) == 0) @@ -919,7 +951,7 @@ Error AsmMc68000::processPseudo(StrScanner &scan, Insn &_insn) { namespace { bool hasKFactor(const AsmInsn &insn, InsnSize size) { // FMOVE.P FPn, ea - if (strcasecmp_P(insn.name(), PSTR("FMOVE")) == 0 && size == ISZ_PBCD && + if (strcasecmp_P(insn.name(), TEXT_FMOVE) == 0 && size == ISZ_PBCD && insn.srcOp.mode == M_FPREG) { const auto mode = insn.dstOp.mode; return (mode >= M_AIND && mode <= M_INDX) || mode == M_AWORD || mode == M_ALONG; diff --git a/src/asm_mc68000.h b/src/asm_mc68000.h index 90bf8724..405cd2ab 100644 --- a/src/asm_mc68000.h +++ b/src/asm_mc68000.h @@ -48,14 +48,12 @@ struct AsmMc68000 final : Assembler, Config { Error encodeOperand( AsmInsn &insn, OprSize size, const Operand &op, AddrMode mode, OprPos pos) const; -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) enum Mc68881Type : char { DATA_DCX = 'X', // 96-bit MC68881 Extended Binary Real DATA_DCP = 'P', // 96-bit MC68881 Packed Decimal String }; Error defineDataConstant( AsmInsn &insn, StrScanner &scan, Mc68881Type type, ErrorAt &error) const; -#endif Error processPseudo(StrScanner &scan, Insn &insn) override; Error encodeImpl(StrScanner &scan, Insn &insn) const override; const ConfigBase &config() const override { return *this; } diff --git a/src/asm_ns32000.cpp b/src/asm_ns32000.cpp index ca6c43fa..d4c1b9e0 100644 --- a/src/asm_ns32000.cpp +++ b/src/asm_ns32000.cpp @@ -53,7 +53,7 @@ constexpr Pseudo PSEUDOS[] PROGMEM = { {TEXT_dBLKW, &Assembler::allocateSpaces, Assembler::DATA_WORD}, {TEXT_dBYTE, &Assembler::defineDataConstant, Assembler::DATA_BYTE}, {TEXT_dDOUBLE, &Assembler::defineDataConstant, Assembler::DATA_LONG}, -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) {TEXT_dFLOAT, &Assembler::defineDataConstant, Assembler::DATA_FLOAT32}, {TEXT_dLONG, &Assembler::defineDataConstant, Assembler::DATA_FLOAT64}, #endif @@ -120,7 +120,7 @@ void AsmNs32000::reset() { Error AsmNs32000::setFpu(StrScanner &scan) { if (scan.iequals_P(TEXT_none)) { setFpuType(FPU_NONE); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) } else if (scan.iequals_P(TEXT_FPU_NS32081)) { setFpuType(FPU_NS32081); #endif @@ -530,20 +530,33 @@ void AsmNs32000::emitBitField( void AsmNs32000::emitImmediate(AsmInsn &insn, AddrMode mode, const Operand &op) const { const auto size = insn.size(); - if (size == SZ_BYTE || mode == M_GENC) { - insn.emitOperand8(op.val.getUnsigned()); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) - } else if (mode == M_FENR) { - if (size == SZ_OCTA) { - insn.emitOpFloat64(op.val.getFloat()); - } else { + if (mode != M_FENR) { + if (size == SZ_BYTE || mode == M_GENC) { + insn.emitOperand8(op.val.getUnsigned()); + } else if (size == SZ_WORD) { + insn.emitOperand16(op.val.getUnsigned()); + } else if (size == SZ_QUAD) { + insn.emitOperand32(op.val.getUnsigned()); + } +#if !defined(LIBASM_NS32000_NOFPU) + } else { + if (size == SZ_QUAD) { +#if defined(LIBASM_ASM_NOFLOAT) + insn.setErrorIf(op, FLOAT_NOT_SUPPORTED); + insn.emitOperand32(0); +#else insn.emitOpFloat32(op.val.getFloat()); +#endif + } else if (size == SZ_OCTA) { +#if defined(LIBASM_ASM_NOFLOAT) + insn.setErrorIf(op, FLOAT_NOT_SUPPORTED); + insn.emitOperand32(0); + insn.emitOperand32(0); +#else + insn.emitOpFloat64(op.val.getFloat()); +#endif } #endif - } else if (size == SZ_WORD) { - insn.emitOperand16(op.val.getUnsigned()); - } else if (size == SZ_QUAD) { - insn.emitOperand32(op.val.getUnsigned()); } } diff --git a/src/config_i8086.h b/src/config_i8086.h index 4615efee..848a018a 100644 --- a/src/config_i8086.h +++ b/src/config_i8086.h @@ -21,9 +21,6 @@ /** Disable i8087 FPU instructions */ // #define LIBASM_I8086_NOFPU -#if defined(LIBASM_ASM_NOFLOAT) && defined(LIBASM_DIS_NOFLOAT) -#define LIBASM_I8086_NOFPU -#endif namespace libasm { namespace i8086 { diff --git a/src/config_libasm.h b/src/config_libasm.h index 1e998409..33cc6912 100644 --- a/src/config_libasm.h +++ b/src/config_libasm.h @@ -21,7 +21,7 @@ // #define LIBASM_ASM_NOFLOAT /** Disable floating point number support from disassembler */ -// #define LIBASM_DIS_NOFLOAT +#define LIBASM_DIS_NOFLOAT /** Forcibly enable software emulated floating point */ // #define LIBASM_SOFT_FLOAT80 diff --git a/src/config_mc68000.h b/src/config_mc68000.h index 675ee960..1449e1f5 100644 --- a/src/config_mc68000.h +++ b/src/config_mc68000.h @@ -21,9 +21,6 @@ /** Disable MC68881 FPU instructions */ // #define LIBASM_MC68000_NOFPU -#if defined(LIBASM_ASM_NOFLOAT) && defined(LIBASM_DIS_NOFLOAT) -#define LIBASM_MC68000_NOFPU -#endif namespace libasm { namespace mc68000 { diff --git a/src/config_ns32000.h b/src/config_ns32000.h index 58a587ae..9ebef38b 100644 --- a/src/config_ns32000.h +++ b/src/config_ns32000.h @@ -23,9 +23,6 @@ // #define LIBASM_NS32000_NOFPU /** Disable NS32082 PMMU instructions */ // #define LIBASM_NS32000_NOMMU -#if defined(LIBASM_ASM_NOFLOAT) && defined(LIBASM_DIS_NOFLOAT) -#define LIBASM_NS32000_NOFPU -#endif namespace libasm { namespace ns32000 { diff --git a/src/dis_mc68000.cpp b/src/dis_mc68000.cpp index 7d5802bb..5084b868 100644 --- a/src/dis_mc68000.cpp +++ b/src/dis_mc68000.cpp @@ -62,6 +62,9 @@ StrBuffer &outOprSize(StrBuffer &out, OprSize size) { } // namespace void DisMc68000::decodeImmediateData(DisInsn &insn, StrBuffer &out, OprSize size) const { +#if defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) + const auto *at = out.mark(); +#endif out.letter('#'); if (size == SZ_BYTE || insn.src() == M_CCR || insn.dst() == M_CCR) { outHex(out, insn.readUint16() & 0xFF, 8); @@ -69,27 +72,41 @@ void DisMc68000::decodeImmediateData(DisInsn &insn, StrBuffer &out, OprSize size outHex(out, insn.readUint16(), 16); } else if (size == SZ_LONG) { outHex(out, insn.readUint32(), 32); -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) } else if (_gnuAs) { - outHex(out, insn.readUint32(), 32); + outHex(out, insn.readUint32(), 32, false); if (size == SZ_DUBL) { out.hex(insn.readUint32(), 8); } else if (size == SZ_XTND || size == SZ_PBCD) { out.hex(insn.readUint64(), 16); } - } else if (size == SZ_SNGL) { - out.float32(insn.readFloat32Be()); - } else if (size == SZ_DUBL) { - out.float64(insn.readFloat64Be()); - } else if (size == SZ_XTND) { - outExtendedReal(out, insn.readExtendedReal()); - } else if (size == SZ_PBCD) { - outDecimalString(out, insn.readDecimalString()); + } else { +#if defined(LIBASM_DIS_NOFLOAT) + insn.setErrorIf(at, FLOAT_NOT_SUPPORTED); +#endif + if (size == SZ_SNGL) { +#if defined(LIBASM_DIS_NOFLOAT) + outHex(out, insn.readUint32(), 32, false); +#else + out.float32(insn.readFloat32Be()); +#endif + } else if (size == SZ_DUBL) { +#if defined(LIBASM_DIS_NOFLOAT) + outHex(out, insn.readUint32(), 32, false); + out.hex(insn.readUint32(), 8); +#else + out.float64(insn.readFloat64Be()); +#endif + } else if (size == SZ_XTND) { + outExtendedReal(out, insn.readExtendedReal()); + } else if (size == SZ_PBCD) { + outDecimalString(out, insn.readDecimalString()); + } #endif } } -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) bool ExtendedReal::isValid() const { /** @@ -118,6 +135,11 @@ ExtendedReal DisInsn::readExtendedReal() { } StrBuffer &DisMc68000::outExtendedReal(StrBuffer &out, const ExtendedReal &v) const { +#if defined(LIBASM_DIS_NOFLOAT) + outHex(out, v.tag, 16, false); + out.hex(v.pad, 4); + return out.hex(v.sig, 16); +#else if (v.tag & 0x8000) out.letter('-'); const auto bexp = v.tag & 0x7FFF; @@ -131,6 +153,7 @@ StrBuffer &DisMc68000::outExtendedReal(StrBuffer &out, const ExtendedReal &v) co const auto exp = static_cast(bexp) - 0x3FFF; fixed64_t sig{v.sig}; return out.float80(float80_t::compose(false, exp, sig)); +#endif } bool DecimalString::isValid() const { @@ -167,6 +190,11 @@ DecimalString DisInsn::readDecimalString() { } StrBuffer &DisMc68000::outDecimalString(StrBuffer &out, const DecimalString &v) const { +#if defined(LIBASM_DIS_NOFLOAT) + outHex(out, v.tag, 16, false); + out.hex(v.integ, 4); + return out.hex(v.sig, 16); +#else if (v.tag & 0x8000) out.letter('-'); if ((v.tag & 0x7FFF) == 0x7FFF) @@ -192,6 +220,7 @@ StrBuffer &DisMc68000::outDecimalString(StrBuffer &out, const DecimalString &v) exp10 = -exp10; exp += sig.power10(exp10 - 16); return out.float80(float80_t::compose(false, exp, sig), 17); +#endif } #endif diff --git a/src/dis_mc68000.h b/src/dis_mc68000.h index 7d9a636f..b4593bac 100644 --- a/src/dis_mc68000.h +++ b/src/dis_mc68000.h @@ -43,7 +43,7 @@ struct DisMc68000 final : Disassembler, Config { void decodeOperand(DisInsn &insn, StrBuffer &out, AddrMode mode, OprPos pos, OprSize size, uint16_t opr16 = 0, Error opr16Error = OK) const; -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) StrBuffer &outExtendedReal(StrBuffer &buf, const ExtendedReal &v) const; StrBuffer &outDecimalString(StrBuffer &buf, const DecimalString &v) const; #endif diff --git a/src/dis_ns32000.cpp b/src/dis_ns32000.cpp index fdf9e8f5..7d282ed0 100644 --- a/src/dis_ns32000.cpp +++ b/src/dis_ns32000.cpp @@ -197,26 +197,40 @@ void DisNs32000::decodeImmediate(DisInsn &insn, StrBuffer &out, AddrMode mode) c const auto size = insn.size(); if (mode == M_GENC) { outDec(out, static_cast(insn.readByte()), -8); - } else if (size == SZ_BYTE) { - outHex(out, insn.readByte(), 8); -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) - } else if (mode == M_FENR || mode == M_FENW) { - if (size == SZ_OCTA) { - const auto float64 = insn.readFloat64Be(); - if (_gnuAs) - out.letter('0').letter('l'); - out.float64(float64); - } else { + } else if (mode != M_FENR && mode != M_FENW) { + if (size == SZ_BYTE) { + outHex(out, insn.readByte(), 8); + } else if (size == SZ_WORD) { + outHex(out, insn.readUint16Be(), 16); + } else if (size == SZ_QUAD) { + outHex(out, insn.readUint32Be(), 32); + } +#if !defined(LIBASM_NS32000_NOFPU) + } else { + if (size == SZ_QUAD) { +#if defined(LIBASM_DIS_NOFLOAT) + insn.setErrorIf(out, FLOAT_NOT_SUPPORTED); + outHex(out, insn.readUint32(), 32, false); +#else const auto float32 = insn.readFloat32Be(); if (_gnuAs) out.letter('0').letter('f'); out.float32(float32); +#endif + } else if (size == SZ_OCTA) { +#if defined(LIBASM_DIS_NOFLOAT) + insn.setErrorIf(out, FLOAT_NOT_SUPPORTED); + const auto lsw = insn.readUint32(); + outHex(out, insn.readUint32(), 32, false); + out.hex(lsw, 8); +#else + const auto float64 = insn.readFloat64Be(); + if (_gnuAs) + out.letter('0').letter('l'); + out.float64(float64); +#endif } #endif - } else if (size == SZ_WORD) { - outHex(out, insn.readUint16Be(), 16); - } else if (size == SZ_QUAD) { - outHex(out, insn.readUint32Be(), 32); } } diff --git a/src/error_reporter.cpp b/src/error_reporter.cpp index 39001bed..6d60d7a9 100644 --- a/src/error_reporter.cpp +++ b/src/error_reporter.cpp @@ -54,6 +54,8 @@ const /*PROGMEM*/ char *ErrorReporter::errorText_P(Error error) { return PSTR("Invalid instruction combination"); case SUBOPTIMAL_INSTRUCTION: return PSTR("Suboptimal instruction"); + case FLOAT_NOT_SUPPORTED: + return PSTR("Float literal not supported"); // Assembler case UNKNOWN_INSTRUCTION: diff --git a/src/error_reporter.h b/src/error_reporter.h index 5def28d2..81056629 100644 --- a/src/error_reporter.h +++ b/src/error_reporter.h @@ -40,6 +40,7 @@ enum Error : uint8_t { OVERWRAP_SEGMENT = 11, INVALID_INSTRUCTION = 12, SUBOPTIMAL_INSTRUCTION = 13, + FLOAT_NOT_SUPPORTED = 14, // Assembler UNKNOWN_INSTRUCTION = 21, diff --git a/src/insn_i8086.h b/src/insn_i8086.h index 5feaf843..d88d6c2d 100644 --- a/src/insn_i8086.h +++ b/src/insn_i8086.h @@ -109,7 +109,7 @@ struct AsmInsn final : AsmInsnImpl, EntryInsn { } Error emitOperand8(uint8_t val8) { return emitByte(val8, operandPos()); } Error emitOperand16(uint16_t val16) { return emitUint16(val16, operandPos()); } -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) +#if !defined(LIBASM_ASM_NOFLOAT) Error emitFloat32(const float80_t &value) { return emitFloat32Le(value); } Error emitFloat64(const float80_t &value) { return emitFloat64Le(value); } Error emitPackedDecimal(int64_t val64); diff --git a/src/insn_mc68000.h b/src/insn_mc68000.h index 47782c21..ca9b1dd3 100644 --- a/src/insn_mc68000.h +++ b/src/insn_mc68000.h @@ -94,7 +94,7 @@ struct AsmInsn final : AsmInsnImpl, EntryInsn { InsnSize _isize; }; -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) struct ExtendedReal { uint16_t tag; uint16_t pad; @@ -119,7 +119,7 @@ struct DisInsn final : DisInsnImpl, EntryInsn { setPostfix(readUint16()); } -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) ExtendedReal readExtendedReal(); DecimalString readDecimalString(); #endif diff --git a/src/table_i8086.cpp b/src/table_i8086.cpp index aab95dac..75baa2e6 100644 --- a/src/table_i8086.cpp +++ b/src/table_i8086.cpp @@ -1298,7 +1298,7 @@ static bool acceptModes(AsmInsn &insn, const Entry *entry) { static constexpr char TEXT_FN[] PROGMEM = "FN"; Error TableI8086::searchName(const CpuSpec &cpuSpec, AsmInsn &insn) const { -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) +#if !defined(LIBASM_I8086_NOFPU) fpu(cpuSpec.fpu)->searchName(insn, acceptModes); if (insn.getError() == UNKNOWN_INSTRUCTION) { // check non-wait version FNxxxx @@ -1376,7 +1376,7 @@ static bool matchOpCode(DisInsn &insn, const Entry *entry, const EntryPage *page } Error TableI8086::searchOpCode(const CpuSpec &cpuSpec, DisInsn &insn, StrBuffer &out) const { -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) +#if !defined(LIBASM_I8086_NOFPU) fpu(cpuSpec.fpu)->searchOpCode(insn, out, matchOpCode); if (insn.isOK()) { if (insn.opCode() == DisInsn::FWAIT) @@ -1402,7 +1402,7 @@ bool TableI8086::isPrefix(CpuType cpuType, Config::opcode_t code) const { } bool TableI8086::isPrefix(FpuType fpuType, Config::opcode_t code) const { -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) +#if !defined(LIBASM_I8086_NOFPU) return fpu(fpuType)->isPrefix(code); #else return false; diff --git a/src/table_mc68000.cpp b/src/table_mc68000.cpp index 8a99f14f..7c061931 100644 --- a/src/table_mc68000.cpp +++ b/src/table_mc68000.cpp @@ -1269,7 +1269,7 @@ static bool acceptAll(AsmInsn &insn, const Entry *entry) { bool TableMc68000::hasOperand(const CpuSpec &cpuSpec, AsmInsn &insn) const { cpu(cpuSpec.cpu)->searchName(insn, acceptAll); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) if (!insn.isOK()) fpu(cpuSpec.fpu)->searchName(insn, acceptAll); #endif @@ -1343,7 +1343,7 @@ static bool acceptModes(AsmInsn &insn, const Entry *entry) { Error TableMc68000::searchName(const CpuSpec &cpuSpec, AsmInsn &insn) const { cpu(cpuSpec.cpu)->searchName(insn, acceptModes); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) if (insn.getError() == UNKNOWN_INSTRUCTION) { fpu(cpuSpec.fpu)->searchName(insn, acceptModes); if (insn.getError() != UNKNOWN_INSTRUCTION) @@ -1495,7 +1495,7 @@ static bool matchOpCode(DisInsn &insn, const Entry *entry, const EntryPage *page Error TableMc68000::searchOpCode(const CpuSpec &cpuSpec, DisInsn &insn, StrBuffer &out) const { cpu(cpuSpec.cpu)->searchOpCode(insn, out, matchOpCode); -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) if (insn.getError() == UNKNOWN_INSTRUCTION) { if ((insn.opCode() & 0xFE00) == (0xF000 | (cpuSpec.fpuCid << 9))) fpu(cpuSpec.fpu)->searchOpCode(insn, out, matchOpCode); diff --git a/src/table_ns32000.cpp b/src/table_ns32000.cpp index 1e612665..28df2777 100644 --- a/src/table_ns32000.cpp +++ b/src/table_ns32000.cpp @@ -646,7 +646,7 @@ static constexpr uint8_t INDEX_8_4[] PROGMEM = { 1, // TEXT_CHECKW }; -#ifndef LIBASM_NS32000_NOMMU +#if !defined(LIBASM_NS32000_NOMMU) static constexpr Entry FORMAT_8_3_1_MMU[] PROGMEM = { E2(0x0C, TEXT_MOVSUB, SZ_BYTE, M_GENA, M_GENA, P_GEN1, P_GEN2), E2(0x0D, TEXT_MOVSUW, SZ_WORD, M_GENA, M_GENA, P_GEN1, P_GEN2), @@ -956,7 +956,7 @@ static bool acceptModes(AsmInsn &insn, const Entry *entry) { Error TableNs32000::searchName(const CpuSpec &cpuSpec, AsmInsn &insn) const { cpu(cpuSpec.cpu)->searchName(insn, acceptModes); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) if (insn.getError() == UNKNOWN_INSTRUCTION) fpu(cpuSpec.fpu)->searchName(insn, acceptModes); #endif @@ -979,7 +979,7 @@ static void readEntryName( Error TableNs32000::searchOpCode(const CpuSpec &cpuSpec, DisInsn &insn, StrBuffer &out) const { cpu(cpuSpec.cpu)->searchOpCode(insn, out, matchOpCode, readEntryName); -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) if (insn.getError() == UNKNOWN_INSTRUCTION) fpu(cpuSpec.fpu)->searchOpCode(insn, out, matchOpCode, readEntryName); #endif @@ -992,7 +992,7 @@ Error TableNs32000::searchOpCode(const CpuSpec &cpuSpec, DisInsn &insn, StrBuffe bool TableNs32000::isPrefixCode(const CpuSpec &cpuSpec, uint8_t code) const { return -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) fpu(cpuSpec.fpu)->isPrefix(code) || #endif #if !defined(LIBASM_NS32000_NOMMU) diff --git a/src/value.cpp b/src/value.cpp index 1518b038..13bc62a1 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -78,17 +78,17 @@ const char *Value::str() const { out.text("").hex(_unsigned).letter('(').dec(_unsigned).letter(')'); } else if (_type == V_SIGNED) { out.text("").hex(_signed).letter('(').dec(_signed).letter(')'); -#if !defined(LIBASM_ASM_NOFLOAT) } else if (_type == V_FLOAT) { out.text("") +#if !defined(LIBASM_ASM_NOFLOAT) .text(_float.str()) #if !defined(LIBASM_DIS_NOFLOAT) .letter('(') .float80(_float) .letter(')'); #endif - ; #endif + ; } else { return ""; @@ -139,16 +139,14 @@ Value &Value::setUinteger(unsigned_t u) { #if defined(LIBASM_ASM_NOFLOAT) -bool Value::isFloat() const { - return false; +Value &Value::setFloat() { + _type = V_FLOAT; + _unsigned = 0; + return *this; } #else -bool Value::isFloat() const { - return _type == V_FLOAT; -} - Value::float_t Value::getFloat() const { if (isUnsigned()) { float_t v; @@ -326,8 +324,10 @@ Value Value::negate() const { } else { v.setS(-static_cast(_unsigned)); } -#if !defined(LIBASM_ASM_NOFLOAT) } else { +#if defined(LIBASM_ASM_NOFLOAT) + v.setFloat(); +#else v.setFloat(-getFloat()); #endif } @@ -365,8 +365,10 @@ Value Value::operator+(const Value &rhs) const { v.setS(-static_cast(u)); } } -#if !defined(LIBASM_ASM_NOFLOAT) } else { +#if defined(LIBASM_ASM_NOFLOAT) + v.setFloat(); +#else v.setFloat(getFloat() + rhs.getFloat()); #endif } @@ -386,8 +388,10 @@ Value Value::operator*(const Value &rhs) const { } else { v.setS(-static_cast(p)); } -#if !defined(LIBASM_ASM_NOFLOAT) } else { +#if defined(LIBASM_ASM_NOFLOAT) + v.setFloat(); +#else v.setFloat(getFloat() * rhs.getFloat()); #endif } @@ -405,8 +409,10 @@ Value Value::operator/(const Value &rhs) const { } else { v.setS(-static_cast(q)); } -#if !defined(LIBASM_ASM_NOFLOAT) } else { +#if defined(LIBASM_ASM_NOFLOAT) + v.setFloat(); +#else v.setFloat(getFloat() / rhs.getFloat()); #endif } diff --git a/src/value.h b/src/value.h index b65d6c6e..8fad0043 100644 --- a/src/value.h +++ b/src/value.h @@ -72,7 +72,7 @@ struct Value { bool isUnsigned() const { return _type == V_UNSIGNED || isUndefined(); } bool isSigned() const { return _type == V_SIGNED; } bool isInteger() const { return !isFloat(); } - bool isFloat() const; + bool isFloat() const { return _type == V_FLOAT; } /** Return true if value exists and is zero */ bool isZero() const; /** Return true if value is signed or float and is negative */ @@ -91,7 +91,9 @@ struct Value { Value &setUnsigned(uint32_t u); Value &setInteger(signed_t s); Value &setUinteger(unsigned_t s); -#if !defined(LIBASM_ASM_NOFLOAT) +#if defined(LIBASM_ASM_NOFLOAT) + Value &setFloat(); +#else Value &setFloat(const float_t &f); Value &setFloat(float_t &&f) { return setFloat(f); } #endif @@ -145,9 +147,7 @@ struct Value { V_UNDEF = 0, V_UNSIGNED = 1, V_SIGNED = 2, -#if !defined(LIBASM_ASM_NOFLOAT) V_FLOAT = 3, -#endif }; union { diff --git a/src/value_parser.cpp b/src/value_parser.cpp index 0000c268..47b93993 100644 --- a/src/value_parser.cpp +++ b/src/value_parser.cpp @@ -14,11 +14,12 @@ * limitations under the License. */ -#include "value_parser.h" #include #include #include "config_base.h" #include "stack.h" +#include "text_common.h" +#include "value_parser.h" namespace libasm { @@ -388,6 +389,39 @@ Value ValueParser::_eval(StrScanner &scan, ErrorAt &error, ParserContext &contex return vstack.pop(); } +namespace { + +bool isFloatNumber(StrScanner &scan, Error error, ParserContext &context) { + if (error == OVERFLOW_RANGE) + return true; + if (error == OK) { + auto p = scan; + auto fpnum = false; + if (p.expect('.') && context.delimitor != '.' && p.expect(isdigit)) { + fpnum = true; + p.trimStart(isdigit); + } else { + p = scan; + } + if (p.iexpect('E')) { + p.expect('-') || p.expect('+'); + if (p.expect(isdigit)) { + fpnum = true; + p.trimStart(isdigit); + } + } + if (fpnum) + scan = p; + return fpnum; + } + if (error == NOT_AN_EXPECTED) + return scan.iexpectWord_P(text::common::TEXT_INF) || + scan.iexpectWord_P(text::common::TEXT_INFINITY) || + scan.iexpectWord_P(text::common::TEXT_NAN); + return false; +} +} // namespace + Error ValueParser::parseConstant(StrScanner &scan, Value &val, ParserContext &context) const { auto p = scan; @@ -402,9 +436,12 @@ Error ValueParser::parseConstant(StrScanner &scan, Value &val, ParserContext &co return err; err = _number.parseNumber(p, val, context.defaultRadix); -#if !defined(LIBASM_ASM_NOFLOAT) - const auto fpnum = (err == OK && (*p == '.' || toupper(*p) == 'E')) && context.delimitor != '.'; - if (fpnum || err == OVERFLOW_RANGE || err == NOT_AN_EXPECTED) { + if (isFloatNumber(p, err, context)) { +#if defined(LIBASM_ASM_NOFLOAT) + val.setFloat(); + scan = p; + return OK; +#else char *end; Value::float_t f80; const auto error = f80.read(scan.str(), &end); @@ -413,8 +450,8 @@ Error ValueParser::parseConstant(StrScanner &scan, Value &val, ParserContext &co scan = end; return error == 0 || f80.isSubnormal() ? OK : OVERFLOW_RANGE; } - } #endif + } if (err != NOT_AN_EXPECTED) { scan = p; return err; diff --git a/test/test_asm_i8086.cpp b/test/test_asm_i8086.cpp index 3e68784d..72b845bf 100644 --- a/test/test_asm_i8086.cpp +++ b/test/test_asm_i8086.cpp @@ -1980,7 +1980,7 @@ static void test_segment_override() { } } -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) +#if !defined(LIBASM_I8086_NOFPU) static void test_float() { TEST("FPU 8087"); @@ -2888,7 +2888,19 @@ static void test_data_constant() { 0x78, 0x56, 0x34, 0x12, 0xF0, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, 0xF0, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, 0xF0, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, 0xDE, 0xBC, 0x9A, 0x00); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) +#if defined(LIBASM_ASM_NOFLOAT) + TEST("DD 12345678H", 0x78, 0x56, 0x34, 0x12); + ERRT("DD -2.25e2", FLOAT_NOT_SUPPORTED, "-2.25e2", + 0x00, 0x00, 0x00, 0x00); + ERRT("DQ 123456789ABCDEF0H", FLOAT_NOT_SUPPORTED, "123456789ABCDEF0H", + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + ERRT("DQ -2.25e2", FLOAT_NOT_SUPPORTED, "-2.25e2", + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + ERRT("DT 123456789ABCDEF01234H", FLOAT_NOT_SUPPORTED, "123456789ABCDEF01234H", + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + ERRT("DT -2.25e2", FLOAT_NOT_SUPPORTED, "-2.25e2", + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); +#else TEST("DD 1.0, -inf, +nan", 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x80, 0xFF, @@ -2933,7 +2945,7 @@ void run_tests(const char *cpu) { RUN_TEST(test_control_transfer); RUN_TEST(test_processor_control); RUN_TEST(test_segment_override); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) +#if !defined(LIBASM_I8086_NOFPU) RUN_TEST(test_float); RUN_TEST(test_float_nowait); #endif diff --git a/test/test_asm_mc68000.cpp b/test/test_asm_mc68000.cpp index 4490a317..fb67e31d 100644 --- a/test/test_asm_mc68000.cpp +++ b/test/test_asm_mc68000.cpp @@ -23,6 +23,22 @@ using namespace libasm::test; AsmMc68000 as68000; Assembler &assembler(as68000); +#if defined(LIBASM_ASM_NOFLOAT) +#define FLTS(insn, opr, opc, post, ...) \ + ERRT(insn " " opr, FLOAT_NOT_SUPPORTED, opr, opc, post, 0, 0) +#define FLTD(insn, opr, opc, post, ...) \ + ERRT(insn " " opr, FLOAT_NOT_SUPPORTED, opr, opc, post, 0, 0, 0, 0) +#define FLTX(insn, opr, opc, post, ...) \ + ERRT(insn " " opr, FLOAT_NOT_SUPPORTED, opr, opc, post, 0, 0, 0, 0, 0, 0) +#define FLTP(insn, opr, opc, post, ...) \ + ERRT(insn " " opr, FLOAT_NOT_SUPPORTED, opr, opc, post, 0, 0, 0, 0, 0, 0) +#else +#define FLTS(insn, opr, opc, post, ...) TEST(insn " " opr, opc, post, __VA_ARGS__) +#define FLTD(insn, opr, opc, post, ...) TEST(insn " " opr, opc, post, __VA_ARGS__) +#define FLTX(insn, opr, opc, post, ...) TEST(insn " " opr, opc, post, __VA_ARGS__) +#define FLTP(insn, opr, opc, post, ...) TEST(insn " " opr, opc, post, __VA_ARGS__) +#endif + static void set_up() { assembler.reset(); } @@ -2839,7 +2855,7 @@ static void test_areg_alias() { TEST("MOVE.L #$00345678,A6", 0026174, 0x0034, 0x5678); } -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) static void test_float_move() { TEST("FPU MC68881"); @@ -2869,26 +2885,26 @@ static void test_float_move() { TEST("FMOVE.X (*+$1234,PC), FP3", 0xF200|072, 0x4000|(2<<10)|(3<<7), 0x1230); TEST("FMOVE.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4000|(3<<10)|(5<<7), 0xC856); TEST("FMOVE.L #$6789ABCD, FP6", 0xF200|074, 0x4000|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FMOVE.S #7.88999976E-10, FP7",0xF200|074, 0x4000|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FMOVE.X #-89000000032, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), + TEST("FMOVE.W #$1234, FP2", 0xF200|074, 0x4000|(4<<10)|(2<<7), 0x1234); + TEST("FMOVE.B #$23, FP4", 0xF200|074, 0x4000|(6<<10)|(4<<7), 0x0023); + FLTS("FMOVE.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4000|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FMOVE.X", "#-89000000032, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FMOVE.P #9.12E20, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), + FLTP("FMOVE.P", "#9.12E20, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FMOVE.W #$1234, FP2", 0xF200|074, 0x4000|(4<<10)|(2<<7), 0x1234); - TEST("FMOVE.D #-8.25, FP3", 0xF200|074, 0x4000|(5<<10)|(3<<7), + FLTD("FMOVE.D", "#-8.25, FP3", 0xF200|074, 0x4000|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FMOVE.B #$23, FP4", 0xF200|074, 0x4000|(6<<10)|(4<<7), 0x0023); TEST("FMOVE.L FP3, D2", 0xF200|002, 0x6000|(0<<10)|(3<<7)); + TEST("FMOVE.W FP3, D2", 0xF200|002, 0x6000|(4<<10)|(3<<7)); + TEST("FMOVE.B FP3, D2", 0xF200|002, 0x6000|(6<<10)|(3<<7)); TEST("FMOVE.S FP3, D2", 0xF200|002, 0x6000|(1<<10)|(3<<7)); ERRT("FMOVE.X FP3, D2", ILLEGAL_SIZE, "FMOVE.X FP3, D2", 0xF200|002, 0x6000|(2<<10)|(3<<7)); ERRT("FMOVE.P FP3, D2", ILLEGAL_SIZE, "FMOVE.P FP3, D2", 0xF200|002, 0x6000|(3<<10)|(3<<7)); - TEST("FMOVE.W FP3, D2", 0xF200|002, 0x6000|(4<<10)|(3<<7)); ERRT("FMOVE.D FP3, D2", ILLEGAL_SIZE, "FMOVE.D FP3, D2", 0xF200|002, 0x6000|(5<<10)|(3<<7)); - TEST("FMOVE.B FP3, D2", 0xF200|002, 0x6000|(6<<10)|(3<<7)); ERRT("FMOVE.L FP5, A4", OPERAND_NOT_ALLOWED, "FP5, A4"); ERRT("FMOVE.S FP5, A4", OPERAND_NOT_ALLOWED, "FP5, A4"); TEST("FMOVE.X FP7, (A6)", 0xF200|026, 0x6000|(2<<10)|(7<<7)); @@ -2915,15 +2931,15 @@ static void test_float_move() { 0xF200|066, 0x6000|(3<<10)|(0<<7)|17, 0x7023); TEST("FMOVE.P FP1, ($004566).W{#-10}", 0xF200|070, 0x6000|(3<<10)|(1<<7)|(-10 & 0x7F), 0x4566); TEST("FMOVE.P FP2, ($56789A).L{#10}", 0xF200|071, 0x6000|(3<<10)|(2<<7)|10, 0x0056, 0x789A); - ERRT("FMOVE.X FP3, (*+$1234,PC)", OPERAND_NOT_ALLOWED, "FP3, (*+$1234,PC)"); - ERRT("FMOVE.P FP5, (*+90,PC,A4.L)", OPERAND_NOT_ALLOWED, "FP5, (*+90,PC,A4.L)"); - ERRT("FMOVE.L FP6, #$6789ABCD", OPERAND_NOT_ALLOWED, "FP6, #$6789ABCD"); - ERRT("FMOVE.S FP7, #7.88999976E-10",OPERAND_NOT_ALLOWED, "FP7, #7.88999976E-10"); - ERRT("FMOVE.X FP0, #-89000000032", OPERAND_NOT_ALLOWED, "FP0, #-89000000032"); - ERRT("FMOVE.P FP1, #9.12E20", OPERAND_NOT_ALLOWED, "FP1, #9.12E20"); - ERRT("FMOVE.W FP2, #$1234", OPERAND_NOT_ALLOWED, "FP2, #$1234"); - ERRT("FMOVE.D FP3, #-8.25", OPERAND_NOT_ALLOWED, "FP3, #-8.25"); - ERRT("FMOVE.B FP4, #$23", OPERAND_NOT_ALLOWED, "FP4, #$23"); + ERRT("FMOVE.X FP3, (*+$1234,PC)", OPERAND_NOT_ALLOWED, "FP3, (*+$1234,PC)"); + ERRT("FMOVE.P FP5, (*+90,PC,A4.L)", OPERAND_NOT_ALLOWED, "FP5, (*+90,PC,A4.L)"); + ERRT("FMOVE.L FP6, #$6789ABCD", OPERAND_NOT_ALLOWED, "FP6, #$6789ABCD"); + ERRT("FMOVE.W FP2, #$1234", OPERAND_NOT_ALLOWED, "FP2, #$1234"); + ERRT("FMOVE.B FP4, #$23", OPERAND_NOT_ALLOWED, "FP4, #$23"); + ERRT("FMOVE.S FP7, #7.88999976E-10", OPERAND_NOT_ALLOWED, "FP7, #7.88999976E-10"); + ERRT("FMOVE.X FP0, #-89000000032", OPERAND_NOT_ALLOWED, "FP0, #-89000000032"); + ERRT("FMOVE.P FP1, #9.12E20", OPERAND_NOT_ALLOWED, "FP1, #9.12E20"); + ERRT("FMOVE.D FP3, #-8.25", OPERAND_NOT_ALLOWED, "FP3, #-8.25"); ERRT("FMOVEM.X D0, FP0", OPERAND_NOT_ALLOWED, "D0, FP0"); ERRT("FMOVEM.X D0, FP0/FP4-FP7", OPERAND_NOT_ALLOWED, "D0, FP0/FP4-FP7"); @@ -3134,15 +3150,15 @@ static void test_float_arithmetic() { TEST("FINT.X (*+$1234,PC), FP3", 0xF200|072, 0x4001|(2<<10)|(3<<7), 0x1230); TEST("FINT.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4001|(3<<10)|(5<<7), 0xC856); TEST("FINT.L #$6789ABCD, FP6", 0xF200|074, 0x4001|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FINT.S #7.88999976E-10, FP7",0xF200|074, 0x4001|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FINT.X #-89000000032, FP0", 0xF200|074, 0x4001|(2<<10)|(0<<7), + TEST("FINT.W #$1234, FP2", 0xF200|074, 0x4001|(4<<10)|(2<<7), 0x1234); + TEST("FINT.B #$23, FP4", 0xF200|074, 0x4001|(6<<10)|(4<<7), 0x0023); + FLTS("FINT.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4001|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FINT.X", "#-89000000032, FP0", 0xF200|074, 0x4001|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FINT.P #9.12E20, FP1", 0xF200|074, 0x4001|(3<<10)|(1<<7), + FLTP("FINT.P", "#9.12E20, FP1", 0xF200|074, 0x4001|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FINT.W #$1234, FP2", 0xF200|074, 0x4001|(4<<10)|(2<<7), 0x1234); - TEST("FINT.D #-8.25, FP3", 0xF200|074, 0x4001|(5<<10)|(3<<7), + FLTD("FINT.D", "#-8.25, FP3", 0xF200|074, 0x4001|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FINT.B #$23, FP4", 0xF200|074, 0x4001|(6<<10)|(4<<7), 0x0023); TEST("FSINH.X FP0, FP1", 0xF200, 0x0002|(0<<10)|(1<<7)); TEST("FSINH.X FP2", 0xF200, 0x0002|(2<<10)|(2<<7)); @@ -3167,15 +3183,15 @@ static void test_float_arithmetic() { TEST("FSINH.X (*+$1234,PC), FP3", 0xF200|072, 0x4002|(2<<10)|(3<<7), 0x1230); TEST("FSINH.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4002|(3<<10)|(5<<7), 0xC856); TEST("FSINH.L #$6789ABCD, FP6", 0xF200|074, 0x4002|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSINH.S #7.88999976E-10, FP7",0xF200|074, 0x4002|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSINH.X #-89000000032, FP0", 0xF200|074, 0x4002|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSINH.P #9.12E20, FP1", 0xF200|074, 0x4002|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FSINH.W #$1234, FP2", 0xF200|074, 0x4002|(4<<10)|(2<<7), 0x1234); - TEST("FSINH.D #-8.25, FP3", 0xF200|074, 0x4002|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSINH.B #$23, FP4", 0xF200|074, 0x4002|(6<<10)|(4<<7), 0x0023); + FLTS("FSINH.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4002|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FSINH.X", "#-8, FP0", 0xF200|074, 0x4002|(2<<10)|(0<<7), + 0xC002, 0x0000, 0x8000, 0x0000, 0x0000, 0x0000); + FLTP("FSINH.P", "#9.12E20, FP1", 0xF200|074, 0x4002|(3<<10)|(1<<7), + 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + FLTD("FSINH.D", "#-8.25, FP3", 0xF200|074, 0x4002|(5<<10)|(3<<7), + 0xC020, 0x8000, 0x0000, 0x0000); TEST("FINTRZ.X FP0, FP1", 0xF200, 0x0003|(0<<10)|(1<<7)); TEST("FINTRZ.X FP2", 0xF200, 0x0003|(2<<10)|(2<<7)); @@ -3200,28 +3216,28 @@ static void test_float_arithmetic() { TEST("FINTRZ.X (*+$1234,PC), FP3", 0xF200|072, 0x4003|(2<<10)|(3<<7), 0x1230); TEST("FINTRZ.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4003|(3<<10)|(5<<7), 0xC856); TEST("FINTRZ.L #$6789ABCD, FP6", 0xF200|074, 0x4003|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FINTRZ.S #7.88999976E-10, FP7",0xF200|074, 0x4003|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FINTRZ.X #-89000000032, FP0", 0xF200|074, 0x4003|(2<<10)|(0<<7), + TEST("FINTRZ.W #$1234, FP2", 0xF200|074, 0x4003|(4<<10)|(2<<7), 0x1234); + TEST("FINTRZ.B #$23, FP4", 0xF200|074, 0x4003|(6<<10)|(4<<7), 0x0023); + FLTS("FINTRZ.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4003|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FINTRZ.X", "#-89000000032, FP0", 0xF200|074, 0x4003|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FINTRZ.P #9.12E20, FP1", 0xF200|074, 0x4003|(3<<10)|(1<<7), + FLTP("FINTRZ.P", "#9.12E20, FP1", 0xF200|074, 0x4003|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FINTRZ.W #$1234, FP2", 0xF200|074, 0x4003|(4<<10)|(2<<7), 0x1234); - TEST("FINTRZ.D #-8.25, FP3", 0xF200|074, 0x4003|(5<<10)|(3<<7), + FLTD("FINTRZ.D", "#-8.25, FP3", 0xF200|074, 0x4003|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FINTRZ.B #$23, FP4", 0xF200|074, 0x4003|(6<<10)|(4<<7), 0x0023); TEST("FSQRT.X FP0, FP1", 0xF200, 0x0004|(0<<10)|(1<<7)); TEST("FSQRT.X FP2", 0xF200, 0x0004|(2<<10)|(2<<7)); TEST("FSQRT.L D2, FP3", 0xF200|002, 0x4004|(0<<10)|(3<<7)); + TEST("FSQRT.W D2, FP3", 0xF200|002, 0x4004|(4<<10)|(3<<7)); + TEST("FSQRT.B D2, FP3", 0xF200|002, 0x4004|(6<<10)|(3<<7)); TEST("FSQRT.S D2, FP3", 0xF200|002, 0x4004|(1<<10)|(3<<7)); ERRT("FSQRT.X D2, FP3", ILLEGAL_SIZE, "FSQRT.X D2, FP3", 0xF200|002, 0x4004|(2<<10)|(3<<7)); ERRT("FSQRT.P D2, FP3", ILLEGAL_SIZE, "FSQRT.P D2, FP3", 0xF200|002, 0x4004|(3<<10)|(3<<7)); - TEST("FSQRT.W D2, FP3", 0xF200|002, 0x4004|(4<<10)|(3<<7)); ERRT("FSQRT.D D2, FP3", ILLEGAL_SIZE, "FSQRT.D D2, FP3", 0xF200|002, 0x4004|(5<<10)|(3<<7)); - TEST("FSQRT.B D2, FP3", 0xF200|002, 0x4004|(6<<10)|(3<<7)); ERRT("FSQRT.S A4, FP5", OPERAND_NOT_ALLOWED, "A4, FP5"); TEST("FSQRT.X (A6), FP7", 0xF200|026, 0x4004|(2<<10)|(7<<7)); TEST("FSQRT.P (A0)+, FP1", 0xF200|030, 0x4004|(3<<10)|(1<<7)); @@ -3233,15 +3249,15 @@ static void test_float_arithmetic() { TEST("FSQRT.X (*+$1234,PC), FP3", 0xF200|072, 0x4004|(2<<10)|(3<<7), 0x1230); TEST("FSQRT.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4004|(3<<10)|(5<<7), 0xC856); TEST("FSQRT.L #$6789ABCD, FP6", 0xF200|074, 0x4004|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSQRT.S #7.88999976E-10, FP7",0xF200|074, 0x4004|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSQRT.X #-89000000032, FP0", 0xF200|074, 0x4004|(2<<10)|(0<<7), + TEST("FSQRT.W #$1234, FP2", 0xF200|074, 0x4004|(4<<10)|(2<<7), 0x1234); + TEST("FSQRT.B #$23, FP4", 0xF200|074, 0x4004|(6<<10)|(4<<7), 0x0023); + FLTS("FSQRT.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4004|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FSQRT.X", "#-89000000032, FP0", 0xF200|074, 0x4004|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSQRT.P #9.12E20, FP1", 0xF200|074, 0x4004|(3<<10)|(1<<7), + FLTP("FSQRT.P", "#9.12E20, FP1", 0xF200|074, 0x4004|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FSQRT.W #$1234, FP2", 0xF200|074, 0x4004|(4<<10)|(2<<7), 0x1234); - TEST("FSQRT.D #-8.25, FP3", 0xF200|074, 0x4004|(5<<10)|(3<<7), + FLTD("FSQRT.D", "#-8.25, FP3", 0xF200|074, 0x4004|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FSQRT.B #$23, FP4", 0xF200|074, 0x4004|(6<<10)|(4<<7), 0x0023); TEST("FLOGNP1.X FP0, FP1", 0xF200, 0x0006|(0<<10)|(1<<7)); TEST("FLOGNP1.X FP2", 0xF200, 0x0006|(2<<10)|(2<<7)); @@ -3266,15 +3282,15 @@ static void test_float_arithmetic() { TEST("FLOGNP1.X (*+$1234,PC), FP3", 0xF200|072, 0x4006|(2<<10)|(3<<7), 0x1230); TEST("FLOGNP1.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4006|(3<<10)|(5<<7), 0xC856); TEST("FLOGNP1.L #$6789ABCD, FP6", 0xF200|074, 0x4006|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FLOGNP1.S #7.88999976E-10, FP7",0xF200|074, 0x4006|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FLOGNP1.X #-89000000032, FP0", 0xF200|074, 0x4006|(2<<10)|(0<<7), + TEST("FLOGNP1.W #$1234, FP2", 0xF200|074, 0x4006|(4<<10)|(2<<7), 0x1234); + TEST("FLOGNP1.B #$23, FP4", 0xF200|074, 0x4006|(6<<10)|(4<<7), 0x0023); + FLTS("FLOGNP1.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4006|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FLOGNP1.X", "#-89000000032, FP0", 0xF200|074, 0x4006|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FLOGNP1.P #9.12E20, FP1", 0xF200|074, 0x4006|(3<<10)|(1<<7), + FLTP("FLOGNP1.P", "#9.12E20, FP1", 0xF200|074, 0x4006|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FLOGNP1.W #$1234, FP2", 0xF200|074, 0x4006|(4<<10)|(2<<7), 0x1234); - TEST("FLOGNP1.D #-8.25, FP3", 0xF200|074, 0x4006|(5<<10)|(3<<7), + FLTD("FLOGNP1.D", "#-8.25, FP3", 0xF200|074, 0x4006|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FLOGNP1.B #$23, FP4", 0xF200|074, 0x4006|(6<<10)|(4<<7), 0x0023); TEST("FETOXM1.X FP0, FP1", 0xF200, 0x0008|(0<<10)|(1<<7)); TEST("FETOXM1.X FP2", 0xF200, 0x0008|(2<<10)|(2<<7)); @@ -3299,15 +3315,15 @@ static void test_float_arithmetic() { TEST("FETOXM1.X (*+$1234,PC), FP3", 0xF200|072, 0x4008|(2<<10)|(3<<7), 0x1230); TEST("FETOXM1.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4008|(3<<10)|(5<<7), 0xC856); TEST("FETOXM1.L #$6789ABCD, FP6", 0xF200|074, 0x4008|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FETOXM1.S #7.88999976E-10, FP7",0xF200|074, 0x4008|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FETOXM1.X #-89000000032, FP0", 0xF200|074, 0x4008|(2<<10)|(0<<7), + TEST("FETOXM1.W #$1234, FP2", 0xF200|074, 0x4008|(4<<10)|(2<<7), 0x1234); + TEST("FETOXM1.B #$23, FP4", 0xF200|074, 0x4008|(6<<10)|(4<<7), 0x0023); + FLTS("FETOXM1.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4008|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FETOXM1.X", "#-89000000032, FP0", 0xF200|074, 0x4008|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FETOXM1.P #9.12E20, FP1", 0xF200|074, 0x4008|(3<<10)|(1<<7), + FLTP("FETOXM1.P", "#9.12E20, FP1", 0xF200|074, 0x4008|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FETOXM1.W #$1234, FP2", 0xF200|074, 0x4008|(4<<10)|(2<<7), 0x1234); - TEST("FETOXM1.D #-8.25, FP3", 0xF200|074, 0x4008|(5<<10)|(3<<7), + FLTD("FETOXM1.D", "#-8.25, FP3", 0xF200|074, 0x4008|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FETOXM1.B #$23, FP4", 0xF200|074, 0x4008|(6<<10)|(4<<7), 0x0023); TEST("FTANH.X FP0, FP1", 0xF200, 0x0009|(0<<10)|(1<<7)); TEST("FTANH.X FP2", 0xF200, 0x0009|(2<<10)|(2<<7)); @@ -3332,15 +3348,15 @@ static void test_float_arithmetic() { TEST("FTANH.X (*+$1234,PC), FP3", 0xF200|072, 0x4009|(2<<10)|(3<<7), 0x1230); TEST("FTANH.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4009|(3<<10)|(5<<7), 0xC856); TEST("FTANH.L #$6789ABCD, FP6", 0xF200|074, 0x4009|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FTANH.S #7.88999976E-10, FP7",0xF200|074, 0x4009|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FTANH.X #-89000000032, FP0", 0xF200|074, 0x4009|(2<<10)|(0<<7), + TEST("FTANH.W #$1234, FP2", 0xF200|074, 0x4009|(4<<10)|(2<<7), 0x1234); + TEST("FTANH.B #$23, FP4", 0xF200|074, 0x4009|(6<<10)|(4<<7), 0x0023); + FLTS("FTANH.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4009|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FTANH.X", "#-89000000032, FP0", 0xF200|074, 0x4009|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FTANH.P #9.12E20, FP1", 0xF200|074, 0x4009|(3<<10)|(1<<7), + FLTP("FTANH.P", "#9.12E20, FP1", 0xF200|074, 0x4009|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FTANH.W #$1234, FP2", 0xF200|074, 0x4009|(4<<10)|(2<<7), 0x1234); - TEST("FTANH.D #-8.25, FP3", 0xF200|074, 0x4009|(5<<10)|(3<<7), + FLTD("FTANH.D", "#-8.25, FP3", 0xF200|074, 0x4009|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FTANH.B #$23, FP4", 0xF200|074, 0x4009|(6<<10)|(4<<7), 0x0023); TEST("FATAN.X FP0, FP1", 0xF200, 0x000A|(0<<10)|(1<<7)); TEST("FATAN.X FP2", 0xF200, 0x000A|(2<<10)|(2<<7)); @@ -3365,15 +3381,15 @@ static void test_float_arithmetic() { TEST("FATAN.X (*+$1234,PC), FP3", 0xF200|072, 0x400A|(2<<10)|(3<<7), 0x1230); TEST("FATAN.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x400A|(3<<10)|(5<<7), 0xC856); TEST("FATAN.L #$6789ABCD, FP6", 0xF200|074, 0x400A|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FATAN.S #7.88999976E-10, FP7",0xF200|074, 0x400A|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FATAN.X #-89000000032, FP0", 0xF200|074, 0x400A|(2<<10)|(0<<7), + TEST("FATAN.W #$1234, FP2", 0xF200|074, 0x400A|(4<<10)|(2<<7), 0x1234); + TEST("FATAN.B #$23, FP4", 0xF200|074, 0x400A|(6<<10)|(4<<7), 0x0023); + FLTS("FATAN.S", "#7.88999976E-10, FP7", 0xF200|074, 0x400A|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FATAN.X", "#-89000000032, FP0", 0xF200|074, 0x400A|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FATAN.P #9.12E20, FP1", 0xF200|074, 0x400A|(3<<10)|(1<<7), + FLTP("FATAN.P", "#9.12E20, FP1", 0xF200|074, 0x400A|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FATAN.W #$1234, FP2", 0xF200|074, 0x400A|(4<<10)|(2<<7), 0x1234); - TEST("FATAN.D #-8.25, FP3", 0xF200|074, 0x400A|(5<<10)|(3<<7), + FLTD("FATAN.D", "#-8.25, FP3", 0xF200|074, 0x400A|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FATAN.B #$23, FP4", 0xF200|074, 0x400A|(6<<10)|(4<<7), 0x0023); TEST("FASIN.X FP0, FP1", 0xF200, 0x000C|(0<<10)|(1<<7)); TEST("FASIN.X FP2", 0xF200, 0x000C|(2<<10)|(2<<7)); @@ -3398,15 +3414,15 @@ static void test_float_arithmetic() { TEST("FASIN.X (*+$1234,PC), FP3", 0xF200|072, 0x400C|(2<<10)|(3<<7), 0x1230); TEST("FASIN.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x400C|(3<<10)|(5<<7), 0xC856); TEST("FASIN.L #$6789ABCD, FP6", 0xF200|074, 0x400C|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FASIN.S #7.88999976E-10, FP7",0xF200|074, 0x400C|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FASIN.X #-89000000032, FP0", 0xF200|074, 0x400C|(2<<10)|(0<<7), + TEST("FASIN.W #$1234, FP2", 0xF200|074, 0x400C|(4<<10)|(2<<7), 0x1234); + TEST("FASIN.B #$23, FP4", 0xF200|074, 0x400C|(6<<10)|(4<<7), 0x0023); + FLTS("FASIN.S", "#7.88999976E-10, FP7", 0xF200|074, 0x400C|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FASIN.X", "#-89000000032, FP0", 0xF200|074, 0x400C|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FASIN.P #9.12E20, FP1", 0xF200|074, 0x400C|(3<<10)|(1<<7), + FLTP("FASIN.P", "#9.12E20, FP1", 0xF200|074, 0x400C|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FASIN.W #$1234, FP2", 0xF200|074, 0x400C|(4<<10)|(2<<7), 0x1234); - TEST("FASIN.D #-8.25, FP3", 0xF200|074, 0x400C|(5<<10)|(3<<7), + FLTD("FASIN.D", "#-8.25, FP3", 0xF200|074, 0x400C|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FASIN.B #$23, FP4", 0xF200|074, 0x400C|(6<<10)|(4<<7), 0x0023); TEST("FATANH.X FP0, FP1", 0xF200, 0x000D|(0<<10)|(1<<7)); TEST("FATANH.X FP2", 0xF200, 0x000D|(2<<10)|(2<<7)); @@ -3431,15 +3447,15 @@ static void test_float_arithmetic() { TEST("FATANH.X (*+$1234,PC), FP3", 0xF200|072, 0x400D|(2<<10)|(3<<7), 0x1230); TEST("FATANH.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x400D|(3<<10)|(5<<7), 0xC856); TEST("FATANH.L #$6789ABCD, FP6", 0xF200|074, 0x400D|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FATANH.S #7.88999976E-10, FP7",0xF200|074, 0x400D|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FATANH.X #-89000000032, FP0", 0xF200|074, 0x400D|(2<<10)|(0<<7), + TEST("FATANH.W #$1234, FP2", 0xF200|074, 0x400D|(4<<10)|(2<<7), 0x1234); + TEST("FATANH.B #$23, FP4", 0xF200|074, 0x400D|(6<<10)|(4<<7), 0x0023); + FLTS("FATANH.S", "#7.88999976E-10, FP7", 0xF200|074, 0x400D|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FATANH.X", "#-89000000032, FP0", 0xF200|074, 0x400D|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FATANH.P #9.12E20, FP1", 0xF200|074, 0x400D|(3<<10)|(1<<7), + FLTP("FATANH.P", "#9.12E20, FP1", 0xF200|074, 0x400D|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FATANH.W #$1234, FP2", 0xF200|074, 0x400D|(4<<10)|(2<<7), 0x1234); - TEST("FATANH.D #-8.25, FP3", 0xF200|074, 0x400D|(5<<10)|(3<<7), + FLTD("FATANH.D", "#-8.25, FP3", 0xF200|074, 0x400D|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FATANH.B #$23, FP4", 0xF200|074, 0x400D|(6<<10)|(4<<7), 0x0023); TEST("FSIN.X FP0, FP1", 0xF200, 0x000E|(0<<10)|(1<<7)); TEST("FSIN.X FP2", 0xF200, 0x000E|(2<<10)|(2<<7)); @@ -3464,15 +3480,15 @@ static void test_float_arithmetic() { TEST("FSIN.X (*+$1234,PC), FP3", 0xF200|072, 0x400E|(2<<10)|(3<<7), 0x1230); TEST("FSIN.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x400E|(3<<10)|(5<<7), 0xC856); TEST("FSIN.L #$6789ABCD, FP6", 0xF200|074, 0x400E|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSIN.S #7.88999976E-10, FP7",0xF200|074, 0x400E|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSIN.X #-89000000032, FP0", 0xF200|074, 0x400E|(2<<10)|(0<<7), + TEST("FSIN.W #$1234, FP2", 0xF200|074, 0x400E|(4<<10)|(2<<7), 0x1234); + TEST("FSIN.B #$23, FP4", 0xF200|074, 0x400E|(6<<10)|(4<<7), 0x0023); + FLTS("FSIN.S", "#7.88999976E-10, FP7", 0xF200|074, 0x400E|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FSIN.X", "#-89000000032, FP0", 0xF200|074, 0x400E|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSIN.P #9.12E20, FP1", 0xF200|074, 0x400E|(3<<10)|(1<<7), + FLTP("FSIN.P", "#9.12E20, FP1", 0xF200|074, 0x400E|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FSIN.W #$1234, FP2", 0xF200|074, 0x400E|(4<<10)|(2<<7), 0x1234); - TEST("FSIN.D #-8.25, FP3", 0xF200|074, 0x400E|(5<<10)|(3<<7), + FLTD("FSIN.D", "#-8.25, FP3", 0xF200|074, 0x400E|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FSIN.B #$23, FP4", 0xF200|074, 0x400E|(6<<10)|(4<<7), 0x0023); TEST("FTAN.X FP0, FP1", 0xF200, 0x000F|(0<<10)|(1<<7)); TEST("FTAN.X FP2", 0xF200, 0x000F|(2<<10)|(2<<7)); @@ -3497,15 +3513,15 @@ static void test_float_arithmetic() { TEST("FTAN.X (*+$1234,PC), FP3", 0xF200|072, 0x400F|(2<<10)|(3<<7), 0x1230); TEST("FTAN.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x400F|(3<<10)|(5<<7), 0xC856); TEST("FTAN.L #$6789ABCD, FP6", 0xF200|074, 0x400F|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FTAN.S #7.88999976E-10, FP7",0xF200|074, 0x400F|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FTAN.X #-89000000032, FP0", 0xF200|074, 0x400F|(2<<10)|(0<<7), + TEST("FTAN.W #$1234, FP2", 0xF200|074, 0x400F|(4<<10)|(2<<7), 0x1234); + TEST("FTAN.B #$23, FP4", 0xF200|074, 0x400F|(6<<10)|(4<<7), 0x0023); + FLTS("FTAN.S", "#7.88999976E-10, FP7", 0xF200|074, 0x400F|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FTAN.X", "#-89000000032, FP0", 0xF200|074, 0x400F|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FTAN.P #9.12E20, FP1", 0xF200|074, 0x400F|(3<<10)|(1<<7), + FLTP("FTAN.P", "#9.12E20, FP1", 0xF200|074, 0x400F|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FTAN.W #$1234, FP2", 0xF200|074, 0x400F|(4<<10)|(2<<7), 0x1234); - TEST("FTAN.D #-8.25, FP3", 0xF200|074, 0x400F|(5<<10)|(3<<7), + FLTD("FTAN.D", "#-8.25, FP3", 0xF200|074, 0x400F|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FTAN.B #$23, FP4", 0xF200|074, 0x400F|(6<<10)|(4<<7), 0x0023); TEST("FETOX.X FP0, FP1", 0xF200, 0x0010|(0<<10)|(1<<7)); TEST("FETOX.X FP2", 0xF200, 0x0010|(2<<10)|(2<<7)); @@ -3530,15 +3546,15 @@ static void test_float_arithmetic() { TEST("FETOX.X (*+$1234,PC), FP3", 0xF200|072, 0x4010|(2<<10)|(3<<7), 0x1230); TEST("FETOX.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4010|(3<<10)|(5<<7), 0xC856); TEST("FETOX.L #$6789ABCD, FP6", 0xF200|074, 0x4010|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FETOX.S #7.88999976E-10, FP7",0xF200|074, 0x4010|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FETOX.X #-89000000032, FP0", 0xF200|074, 0x4010|(2<<10)|(0<<7), + TEST("FETOX.W #$1234, FP2", 0xF200|074, 0x4010|(4<<10)|(2<<7), 0x1234); + TEST("FETOX.B #$23, FP4", 0xF200|074, 0x4010|(6<<10)|(4<<7), 0x0023); + FLTS("FETOX.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4010|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FETOX.X", "#-89000000032, FP0", 0xF200|074, 0x4010|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FETOX.P #9.12E20, FP1", 0xF200|074, 0x4010|(3<<10)|(1<<7), + FLTP("FETOX.P", "#9.12E20, FP1", 0xF200|074, 0x4010|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FETOX.W #$1234, FP2", 0xF200|074, 0x4010|(4<<10)|(2<<7), 0x1234); - TEST("FETOX.D #-8.25, FP3", 0xF200|074, 0x4010|(5<<10)|(3<<7), + FLTD("FETOX.D", "#-8.25, FP3", 0xF200|074, 0x4010|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FETOX.B #$23, FP4", 0xF200|074, 0x4010|(6<<10)|(4<<7), 0x0023); TEST("FTWOTOX.X FP0, FP1", 0xF200, 0x0011|(0<<10)|(1<<7)); TEST("FTWOTOX.X FP2", 0xF200, 0x0011|(2<<10)|(2<<7)); @@ -3563,15 +3579,15 @@ static void test_float_arithmetic() { TEST("FTWOTOX.X (*+$1234,PC), FP3", 0xF200|072, 0x4011|(2<<10)|(3<<7), 0x1230); TEST("FTWOTOX.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4011|(3<<10)|(5<<7), 0xC856); TEST("FTWOTOX.L #$6789ABCD, FP6", 0xF200|074, 0x4011|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FTWOTOX.S #7.88999976E-10, FP7",0xF200|074, 0x4011|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FTWOTOX.X #-89000000032, FP0", 0xF200|074, 0x4011|(2<<10)|(0<<7), + TEST("FTWOTOX.W #$1234, FP2", 0xF200|074, 0x4011|(4<<10)|(2<<7), 0x1234); + TEST("FTWOTOX.B #$23, FP4", 0xF200|074, 0x4011|(6<<10)|(4<<7), 0x0023); + FLTS("FTWOTOX.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4011|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FTWOTOX.X", "#-89000000032, FP0", 0xF200|074, 0x4011|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FTWOTOX.P #9.12E20, FP1", 0xF200|074, 0x4011|(3<<10)|(1<<7), + FLTP("FTWOTOX.P", "#9.12E20, FP1", 0xF200|074, 0x4011|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FTWOTOX.W #$1234, FP2", 0xF200|074, 0x4011|(4<<10)|(2<<7), 0x1234); - TEST("FTWOTOX.D #-8.25, FP3", 0xF200|074, 0x4011|(5<<10)|(3<<7), + FLTD("FTWOTOX.D", "#-8.25, FP3", 0xF200|074, 0x4011|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FTWOTOX.B #$23, FP4", 0xF200|074, 0x4011|(6<<10)|(4<<7), 0x0023); TEST("FTENTOX.X FP0, FP1", 0xF200, 0x0012|(0<<10)|(1<<7)); TEST("FTENTOX.X FP2", 0xF200, 0x0012|(2<<10)|(2<<7)); @@ -3596,15 +3612,15 @@ static void test_float_arithmetic() { TEST("FTENTOX.X (*+$1234,PC), FP3", 0xF200|072, 0x4012|(2<<10)|(3<<7), 0x1230); TEST("FTENTOX.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4012|(3<<10)|(5<<7), 0xC856); TEST("FTENTOX.L #$6789ABCD, FP6", 0xF200|074, 0x4012|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FTENTOX.S #7.88999976E-10, FP7",0xF200|074, 0x4012|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FTENTOX.X #-89000000032, FP0", 0xF200|074, 0x4012|(2<<10)|(0<<7), + TEST("FTENTOX.W #$1234, FP2", 0xF200|074, 0x4012|(4<<10)|(2<<7), 0x1234); + TEST("FTENTOX.B #$23, FP4", 0xF200|074, 0x4012|(6<<10)|(4<<7), 0x0023); + FLTS("FTENTOX.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4012|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FTENTOX.X", "#-89000000032, FP0", 0xF200|074, 0x4012|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FTENTOX.P #9.12E20, FP1", 0xF200|074, 0x4012|(3<<10)|(1<<7), + FLTP("FTENTOX.P", "#9.12E20, FP1", 0xF200|074, 0x4012|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FTENTOX.W #$1234, FP2", 0xF200|074, 0x4012|(4<<10)|(2<<7), 0x1234); - TEST("FTENTOX.D #-8.25, FP3", 0xF200|074, 0x4012|(5<<10)|(3<<7), + FLTD("FTENTOX.D", "#-8.25, FP3", 0xF200|074, 0x4012|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FTENTOX.B #$23, FP4", 0xF200|074, 0x4012|(6<<10)|(4<<7), 0x0023); TEST("FLOGN.X FP0, FP1", 0xF200, 0x0014|(0<<10)|(1<<7)); TEST("FLOGN.X FP2", 0xF200, 0x0014|(2<<10)|(2<<7)); @@ -3629,15 +3645,15 @@ static void test_float_arithmetic() { TEST("FLOGN.X (*+$1234,PC), FP3", 0xF200|072, 0x4014|(2<<10)|(3<<7), 0x1230); TEST("FLOGN.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4014|(3<<10)|(5<<7), 0xC856); TEST("FLOGN.L #$6789ABCD, FP6", 0xF200|074, 0x4014|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FLOGN.S #7.88999976E-10, FP7",0xF200|074, 0x4014|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FLOGN.X #-89000000032, FP0", 0xF200|074, 0x4014|(2<<10)|(0<<7), + TEST("FLOGN.W #$1234, FP2", 0xF200|074, 0x4014|(4<<10)|(2<<7), 0x1234); + TEST("FLOGN.B #$23, FP4", 0xF200|074, 0x4014|(6<<10)|(4<<7), 0x0023); + FLTS("FLOGN.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4014|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FLOGN.X", "#-89000000032, FP0", 0xF200|074, 0x4014|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FLOGN.P #9.12E20, FP1", 0xF200|074, 0x4014|(3<<10)|(1<<7), + FLTP("FLOGN.P", "#9.12E20, FP1", 0xF200|074, 0x4014|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FLOGN.W #$1234, FP2", 0xF200|074, 0x4014|(4<<10)|(2<<7), 0x1234); - TEST("FLOGN.D #-8.25, FP3", 0xF200|074, 0x4014|(5<<10)|(3<<7), + FLTD("FLOGN.D", "#-8.25, FP3", 0xF200|074, 0x4014|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FLOGN.B #$23, FP4", 0xF200|074, 0x4014|(6<<10)|(4<<7), 0x0023); TEST("FLOG10.X FP0, FP1", 0xF200, 0x0015|(0<<10)|(1<<7)); TEST("FLOG10.X FP2", 0xF200, 0x0015|(2<<10)|(2<<7)); @@ -3662,15 +3678,15 @@ static void test_float_arithmetic() { TEST("FLOG10.X (*+$1234,PC), FP3", 0xF200|072, 0x4015|(2<<10)|(3<<7), 0x1230); TEST("FLOG10.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4015|(3<<10)|(5<<7), 0xC856); TEST("FLOG10.L #$6789ABCD, FP6", 0xF200|074, 0x4015|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FLOG10.S #7.88999976E-10, FP7",0xF200|074, 0x4015|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FLOG10.X #-89000000032, FP0", 0xF200|074, 0x4015|(2<<10)|(0<<7), + TEST("FLOG10.W #$1234, FP2", 0xF200|074, 0x4015|(4<<10)|(2<<7), 0x1234); + TEST("FLOG10.B #$23, FP4", 0xF200|074, 0x4015|(6<<10)|(4<<7), 0x0023); + FLTS("FLOG10.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4015|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FLOG10.X", "#-89000000032, FP0", 0xF200|074, 0x4015|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FLOG10.P #9.12E20, FP1", 0xF200|074, 0x4015|(3<<10)|(1<<7), + FLTP("FLOG10.P", "#9.12E20, FP1", 0xF200|074, 0x4015|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FLOG10.W #$1234, FP2", 0xF200|074, 0x4015|(4<<10)|(2<<7), 0x1234); - TEST("FLOG10.D #-8.25, FP3", 0xF200|074, 0x4015|(5<<10)|(3<<7), + FLTD("FLOG10.D", "#-8.25, FP3", 0xF200|074, 0x4015|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FLOG10.B #$23, FP4", 0xF200|074, 0x4015|(6<<10)|(4<<7), 0x0023); TEST("FLOG2.X FP0, FP1", 0xF200, 0x0016|(0<<10)|(1<<7)); TEST("FLOG2.X FP2", 0xF200, 0x0016|(2<<10)|(2<<7)); @@ -3695,15 +3711,15 @@ static void test_float_arithmetic() { TEST("FLOG2.X (*+$1234,PC), FP3", 0xF200|072, 0x4016|(2<<10)|(3<<7), 0x1230); TEST("FLOG2.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4016|(3<<10)|(5<<7), 0xC856); TEST("FLOG2.L #$6789ABCD, FP6", 0xF200|074, 0x4016|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FLOG2.S #7.88999976E-10, FP7",0xF200|074, 0x4016|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FLOG2.X #-89000000032, FP0", 0xF200|074, 0x4016|(2<<10)|(0<<7), + TEST("FLOG2.W #$1234, FP2", 0xF200|074, 0x4016|(4<<10)|(2<<7), 0x1234); + TEST("FLOG2.B #$23, FP4", 0xF200|074, 0x4016|(6<<10)|(4<<7), 0x0023); + FLTS("FLOG2.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4016|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FLOG2.X", "#-89000000032, FP0", 0xF200|074, 0x4016|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FLOG2.P #9.12E20, FP1", 0xF200|074, 0x4016|(3<<10)|(1<<7), + FLTP("FLOG2.P", "#9.12E20, FP1", 0xF200|074, 0x4016|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FLOG2.W #$1234, FP2", 0xF200|074, 0x4016|(4<<10)|(2<<7), 0x1234); - TEST("FLOG2.D #-8.25, FP3", 0xF200|074, 0x4016|(5<<10)|(3<<7), + FLTD("FLOG2.D", "#-8.25, FP3", 0xF200|074, 0x4016|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FLOG2.B #$23, FP4", 0xF200|074, 0x4016|(6<<10)|(4<<7), 0x0023); TEST("FABS.X FP0, FP1", 0xF200, 0x0018|(0<<10)|(1<<7)); TEST("FABS.X FP2", 0xF200, 0x0018|(2<<10)|(2<<7)); @@ -3728,15 +3744,15 @@ static void test_float_arithmetic() { TEST("FABS.X (*+$1234,PC), FP3", 0xF200|072, 0x4018|(2<<10)|(3<<7), 0x1230); TEST("FABS.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4018|(3<<10)|(5<<7), 0xC856); TEST("FABS.L #$6789ABCD, FP6", 0xF200|074, 0x4018|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FABS.S #7.88999976E-10, FP7",0xF200|074, 0x4018|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FABS.X #-89000000032, FP0", 0xF200|074, 0x4018|(2<<10)|(0<<7), + TEST("FABS.W #$1234, FP2", 0xF200|074, 0x4018|(4<<10)|(2<<7), 0x1234); + TEST("FABS.B #$23, FP4", 0xF200|074, 0x4018|(6<<10)|(4<<7), 0x0023); + FLTS("FABS.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4018|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FABS.X", "#-89000000032, FP0", 0xF200|074, 0x4018|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FABS.P #9.12E20, FP1", 0xF200|074, 0x4018|(3<<10)|(1<<7), + FLTP("FABS.P", "#9.12E20, FP1", 0xF200|074, 0x4018|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FABS.W #$1234, FP2", 0xF200|074, 0x4018|(4<<10)|(2<<7), 0x1234); - TEST("FABS.D #-8.25, FP3", 0xF200|074, 0x4018|(5<<10)|(3<<7), + FLTD("FABS.D", "#-8.25, FP3", 0xF200|074, 0x4018|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FABS.B #$23, FP4", 0xF200|074, 0x4018|(6<<10)|(4<<7), 0x0023); TEST("FCOSH.X FP0, FP1", 0xF200, 0x0019|(0<<10)|(1<<7)); TEST("FCOSH.X FP2", 0xF200, 0x0019|(2<<10)|(2<<7)); @@ -3761,15 +3777,15 @@ static void test_float_arithmetic() { TEST("FCOSH.X (*+$1234,PC), FP3", 0xF200|072, 0x4019|(2<<10)|(3<<7), 0x1230); TEST("FCOSH.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4019|(3<<10)|(5<<7), 0xC856); TEST("FCOSH.L #$6789ABCD, FP6", 0xF200|074, 0x4019|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FCOSH.S #7.88999976E-10, FP7",0xF200|074, 0x4019|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FCOSH.X #-89000000032, FP0", 0xF200|074, 0x4019|(2<<10)|(0<<7), + TEST("FCOSH.W #$1234, FP2", 0xF200|074, 0x4019|(4<<10)|(2<<7), 0x1234); + TEST("FCOSH.B #$23, FP4", 0xF200|074, 0x4019|(6<<10)|(4<<7), 0x0023); + FLTS("FCOSH.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4019|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FCOSH.X", "#-89000000032, FP0", 0xF200|074, 0x4019|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FCOSH.P #9.12E20, FP1", 0xF200|074, 0x4019|(3<<10)|(1<<7), + FLTP("FCOSH.P", "#9.12E20, FP1", 0xF200|074, 0x4019|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FCOSH.W #$1234, FP2", 0xF200|074, 0x4019|(4<<10)|(2<<7), 0x1234); - TEST("FCOSH.D #-8.25, FP3", 0xF200|074, 0x4019|(5<<10)|(3<<7), + FLTD("FCOSH.D", "#-8.25, FP3", 0xF200|074, 0x4019|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FCOSH.B #$23, FP4", 0xF200|074, 0x4019|(6<<10)|(4<<7), 0x0023); TEST("FNEG.X FP0, FP1", 0xF200, 0x001A|(0<<10)|(1<<7)); TEST("FNEG.X FP2", 0xF200, 0x001A|(2<<10)|(2<<7)); @@ -3794,15 +3810,15 @@ static void test_float_arithmetic() { TEST("FNEG.X (*+$1234,PC), FP3", 0xF200|072, 0x401A|(2<<10)|(3<<7), 0x1230); TEST("FNEG.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x401A|(3<<10)|(5<<7), 0xC856); TEST("FNEG.L #$6789ABCD, FP6", 0xF200|074, 0x401A|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FNEG.S #7.88999976E-10, FP7",0xF200|074, 0x401A|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FNEG.X #-89000000032, FP0", 0xF200|074, 0x401A|(2<<10)|(0<<7), + TEST("FNEG.W #$1234, FP2", 0xF200|074, 0x401A|(4<<10)|(2<<7), 0x1234); + TEST("FNEG.B #$23, FP4", 0xF200|074, 0x401A|(6<<10)|(4<<7), 0x0023); + FLTS("FNEG.S", "#7.88999976E-10, FP7", 0xF200|074, 0x401A|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FNEG.X", "#-89000000032, FP0", 0xF200|074, 0x401A|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FNEG.P #9.12E20, FP1", 0xF200|074, 0x401A|(3<<10)|(1<<7), + FLTP("FNEG.P", "#9.12E20, FP1", 0xF200|074, 0x401A|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FNEG.W #$1234, FP2", 0xF200|074, 0x401A|(4<<10)|(2<<7), 0x1234); - TEST("FNEG.D #-8.25, FP3", 0xF200|074, 0x401A|(5<<10)|(3<<7), + FLTD("FNEG.D", "#-8.25, FP3", 0xF200|074, 0x401A|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FNEG.B #$23, FP4", 0xF200|074, 0x401A|(6<<10)|(4<<7), 0x0023); TEST("FACOS.X FP0, FP1", 0xF200, 0x001C|(0<<10)|(1<<7)); TEST("FACOS.X FP2", 0xF200, 0x001C|(2<<10)|(2<<7)); @@ -3827,15 +3843,15 @@ static void test_float_arithmetic() { TEST("FACOS.X (*+$1234,PC), FP3", 0xF200|072, 0x401C|(2<<10)|(3<<7), 0x1230); TEST("FACOS.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x401C|(3<<10)|(5<<7), 0xC856); TEST("FACOS.L #$6789ABCD, FP6", 0xF200|074, 0x401C|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FACOS.S #7.88999976E-10, FP7",0xF200|074, 0x401C|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FACOS.X #-89000000032, FP0", 0xF200|074, 0x401C|(2<<10)|(0<<7), + TEST("FACOS.W #$1234, FP2", 0xF200|074, 0x401C|(4<<10)|(2<<7), 0x1234); + TEST("FACOS.B #$23, FP4", 0xF200|074, 0x401C|(6<<10)|(4<<7), 0x0023); + FLTS("FACOS.S", "#7.88999976E-10, FP7", 0xF200|074, 0x401C|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FACOS.X", "#-89000000032, FP0", 0xF200|074, 0x401C|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FACOS.P #9.12E20, FP1", 0xF200|074, 0x401C|(3<<10)|(1<<7), + FLTP("FACOS.P", "#9.12E20, FP1", 0xF200|074, 0x401C|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FACOS.W #$1234, FP2", 0xF200|074, 0x401C|(4<<10)|(2<<7), 0x1234); - TEST("FACOS.D #-8.25, FP3", 0xF200|074, 0x401C|(5<<10)|(3<<7), + FLTD("FACOS.D", "#-8.25, FP3", 0xF200|074, 0x401C|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FACOS.B #$23, FP4", 0xF200|074, 0x401C|(6<<10)|(4<<7), 0x0023); TEST("FCOS.X FP0, FP1", 0xF200, 0x001D|(0<<10)|(1<<7)); TEST("FCOS.X FP2", 0xF200, 0x001D|(2<<10)|(2<<7)); @@ -3860,15 +3876,15 @@ static void test_float_arithmetic() { TEST("FCOS.X (*+$1234,PC), FP3", 0xF200|072, 0x401D|(2<<10)|(3<<7), 0x1230); TEST("FCOS.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x401D|(3<<10)|(5<<7), 0xC856); TEST("FCOS.L #$6789ABCD, FP6", 0xF200|074, 0x401D|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FCOS.S #7.88999976E-10, FP7",0xF200|074, 0x401D|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FCOS.X #-89000000032, FP0", 0xF200|074, 0x401D|(2<<10)|(0<<7), + TEST("FCOS.W #$1234, FP2", 0xF200|074, 0x401D|(4<<10)|(2<<7), 0x1234); + TEST("FCOS.B #$23, FP4", 0xF200|074, 0x401D|(6<<10)|(4<<7), 0x0023); + FLTS("FCOS.S", "#7.88999976E-10, FP7", 0xF200|074, 0x401D|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FCOS.X", "#-89000000032, FP0", 0xF200|074, 0x401D|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FCOS.P #9.12E20, FP1", 0xF200|074, 0x401D|(3<<10)|(1<<7), + FLTP("FCOS.P", "#9.12E20, FP1", 0xF200|074, 0x401D|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FCOS.W #$1234, FP2", 0xF200|074, 0x401D|(4<<10)|(2<<7), 0x1234); - TEST("FCOS.D #-8.25, FP3", 0xF200|074, 0x401D|(5<<10)|(3<<7), + FLTD("FCOS.D", "#-8.25, FP3", 0xF200|074, 0x401D|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FCOS.B #$23, FP4", 0xF200|074, 0x401D|(6<<10)|(4<<7), 0x0023); TEST("FGETEXP.X FP0, FP1", 0xF200, 0x001E|(0<<10)|(1<<7)); TEST("FGETEXP.X FP2", 0xF200, 0x001E|(2<<10)|(2<<7)); @@ -3893,15 +3909,15 @@ static void test_float_arithmetic() { TEST("FGETEXP.X (*+$1234,PC), FP3", 0xF200|072, 0x401E|(2<<10)|(3<<7), 0x1230); TEST("FGETEXP.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x401E|(3<<10)|(5<<7), 0xC856); TEST("FGETEXP.L #$6789ABCD, FP6", 0xF200|074, 0x401E|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FGETEXP.S #7.88999976E-10, FP7",0xF200|074, 0x401E|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FGETEXP.X #-89000000032, FP0", 0xF200|074, 0x401E|(2<<10)|(0<<7), + TEST("FGETEXP.W #$1234, FP2", 0xF200|074, 0x401E|(4<<10)|(2<<7), 0x1234); + TEST("FGETEXP.B #$23, FP4", 0xF200|074, 0x401E|(6<<10)|(4<<7), 0x0023); + FLTS("FGETEXP.S", "#7.88999976E-10, FP7", 0xF200|074, 0x401E|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FGETEXP.X", "#-89000000032, FP0", 0xF200|074, 0x401E|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FGETEXP.P #9.12E20, FP1", 0xF200|074, 0x401E|(3<<10)|(1<<7), + FLTP("FGETEXP.P", "#9.12E20, FP1", 0xF200|074, 0x401E|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FGETEXP.W #$1234, FP2", 0xF200|074, 0x401E|(4<<10)|(2<<7), 0x1234); - TEST("FGETEXP.D #-8.25, FP3", 0xF200|074, 0x401E|(5<<10)|(3<<7), + FLTD("FGETEXP.D", "#-8.25, FP3", 0xF200|074, 0x401E|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FGETEXP.B #$23, FP4", 0xF200|074, 0x401E|(6<<10)|(4<<7), 0x0023); TEST("FGETMAN.X FP0, FP1", 0xF200, 0x001F|(0<<10)|(1<<7)); TEST("FGETMAN.X FP2", 0xF200, 0x001F|(2<<10)|(2<<7)); @@ -3926,15 +3942,15 @@ static void test_float_arithmetic() { TEST("FGETMAN.X (*+$1234,PC), FP3", 0xF200|072, 0x401F|(2<<10)|(3<<7), 0x1230); TEST("FGETMAN.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x401F|(3<<10)|(5<<7), 0xC856); TEST("FGETMAN.L #$6789ABCD, FP6", 0xF200|074, 0x401F|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FGETMAN.S #7.88999976E-10, FP7",0xF200|074, 0x401F|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FGETMAN.X #-89000000032, FP0", 0xF200|074, 0x401F|(2<<10)|(0<<7), + TEST("FGETMAN.W #$1234, FP2", 0xF200|074, 0x401F|(4<<10)|(2<<7), 0x1234); + TEST("FGETMAN.B #$23, FP4", 0xF200|074, 0x401F|(6<<10)|(4<<7), 0x0023); + FLTS("FGETMAN.S", "#7.88999976E-10, FP7", 0xF200|074, 0x401F|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FGETMAN.X", "#-89000000032, FP0", 0xF200|074, 0x401F|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FGETMAN.P #9.12E20, FP1", 0xF200|074, 0x401F|(3<<10)|(1<<7), + FLTP("FGETMAN.P", "#9.12E20, FP1", 0xF200|074, 0x401F|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FGETMAN.W #$1234, FP2", 0xF200|074, 0x401F|(4<<10)|(2<<7), 0x1234); - TEST("FGETMAN.D #-8.25, FP3", 0xF200|074, 0x401F|(5<<10)|(3<<7), + FLTD("FGETMAN.D", "#-8.25, FP3", 0xF200|074, 0x401F|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FGETMAN.B #$23, FP4", 0xF200|074, 0x401F|(6<<10)|(4<<7), 0x0023); TEST("FDIV.X FP0, FP1", 0xF200, 0x0020|(0<<10)|(1<<7)); ERRT("FDIV.X FP0", OPERAND_NOT_ALLOWED, "FP0"); @@ -3959,15 +3975,15 @@ static void test_float_arithmetic() { TEST("FDIV.X (*+$1234,PC), FP3", 0xF200|072, 0x4020|(2<<10)|(3<<7), 0x1230); TEST("FDIV.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4020|(3<<10)|(5<<7), 0xC856); TEST("FDIV.L #$6789ABCD, FP6", 0xF200|074, 0x4020|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FDIV.S #7.88999976E-10, FP7",0xF200|074, 0x4020|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FDIV.X #-89000000032, FP0", 0xF200|074, 0x4020|(2<<10)|(0<<7), + TEST("FDIV.W #$1234, FP2", 0xF200|074, 0x4020|(4<<10)|(2<<7), 0x1234); + TEST("FDIV.B #$23, FP4", 0xF200|074, 0x4020|(6<<10)|(4<<7), 0x0023); + FLTS("FDIV.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4020|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FDIV.X", "#-89000000032, FP0", 0xF200|074, 0x4020|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FDIV.P #9.12E20, FP1", 0xF200|074, 0x4020|(3<<10)|(1<<7), + FLTP("FDIV.P", "#9.12E20, FP1", 0xF200|074, 0x4020|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FDIV.W #$1234, FP2", 0xF200|074, 0x4020|(4<<10)|(2<<7), 0x1234); - TEST("FDIV.D #-8.25, FP3", 0xF200|074, 0x4020|(5<<10)|(3<<7), + FLTD("FDIV.D", "#-8.25, FP3", 0xF200|074, 0x4020|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FDIV.B #$23, FP4", 0xF200|074, 0x4020|(6<<10)|(4<<7), 0x0023); TEST("FMOD.X FP0, FP1", 0xF200, 0x0021|(0<<10)|(1<<7)); ERRT("FMOD.X FP0", OPERAND_NOT_ALLOWED, "FP0"); @@ -3992,15 +4008,15 @@ static void test_float_arithmetic() { TEST("FMOD.X (*+$1234,PC), FP3", 0xF200|072, 0x4021|(2<<10)|(3<<7), 0x1230); TEST("FMOD.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4021|(3<<10)|(5<<7), 0xC856); TEST("FMOD.L #$6789ABCD, FP6", 0xF200|074, 0x4021|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FMOD.S #7.88999976E-10, FP7",0xF200|074, 0x4021|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FMOD.X #-89000000032, FP0", 0xF200|074, 0x4021|(2<<10)|(0<<7), + TEST("FMOD.W #$1234, FP2", 0xF200|074, 0x4021|(4<<10)|(2<<7), 0x1234); + TEST("FMOD.B #$23, FP4", 0xF200|074, 0x4021|(6<<10)|(4<<7), 0x0023); + FLTS("FMOD.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4021|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FMOD.X", "#-89000000032, FP0", 0xF200|074, 0x4021|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FMOD.P #9.12E20, FP1", 0xF200|074, 0x4021|(3<<10)|(1<<7), + FLTP("FMOD.P", "#9.12E20, FP1", 0xF200|074, 0x4021|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FMOD.W #$1234, FP2", 0xF200|074, 0x4021|(4<<10)|(2<<7), 0x1234); - TEST("FMOD.D #-8.25, FP3", 0xF200|074, 0x4021|(5<<10)|(3<<7), + FLTD("FMOD.D", "#-8.25, FP3", 0xF200|074, 0x4021|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FMOD.B #$23, FP4", 0xF200|074, 0x4021|(6<<10)|(4<<7), 0x0023); TEST("FADD.X FP0, FP1", 0xF200, 0x0022|(0<<10)|(1<<7)); ERRT("FADD.X FP0", OPERAND_NOT_ALLOWED, "FP0"); @@ -4025,15 +4041,15 @@ static void test_float_arithmetic() { TEST("FADD.X (*+$1234,PC), FP3", 0xF200|072, 0x4022|(2<<10)|(3<<7), 0x1230); TEST("FADD.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4022|(3<<10)|(5<<7), 0xC856); TEST("FADD.L #$6789ABCD, FP6", 0xF200|074, 0x4022|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FADD.S #7.88999976E-10, FP7",0xF200|074, 0x4022|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FADD.X #-89000000032, FP0", 0xF200|074, 0x4022|(2<<10)|(0<<7), + TEST("FADD.W #$1234, FP2", 0xF200|074, 0x4022|(4<<10)|(2<<7), 0x1234); + TEST("FADD.B #$23, FP4", 0xF200|074, 0x4022|(6<<10)|(4<<7), 0x0023); + FLTS("FADD.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4022|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FADD.X", "#-89000000032, FP0", 0xF200|074, 0x4022|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FADD.P #9.12E20, FP1", 0xF200|074, 0x4022|(3<<10)|(1<<7), + FLTP("FADD.P", "#9.12E20, FP1", 0xF200|074, 0x4022|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FADD.W #$1234, FP2", 0xF200|074, 0x4022|(4<<10)|(2<<7), 0x1234); - TEST("FADD.D #-8.25, FP3", 0xF200|074, 0x4022|(5<<10)|(3<<7), + FLTD("FADD.D", "#-8.25, FP3", 0xF200|074, 0x4022|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FADD.B #$23, FP4", 0xF200|074, 0x4022|(6<<10)|(4<<7), 0x0023); TEST("FMUL.X FP0, FP1", 0xF200, 0x0023|(0<<10)|(1<<7)); ERRT("FMUL.X FP0", OPERAND_NOT_ALLOWED, "FP0"); @@ -4058,15 +4074,15 @@ static void test_float_arithmetic() { TEST("FMUL.X (*+$1234,PC), FP3", 0xF200|072, 0x4023|(2<<10)|(3<<7), 0x1230); TEST("FMUL.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4023|(3<<10)|(5<<7), 0xC856); TEST("FMUL.L #$6789ABCD, FP6", 0xF200|074, 0x4023|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FMUL.S #7.88999976E-10, FP7",0xF200|074, 0x4023|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FMUL.X #-89000000032, FP0", 0xF200|074, 0x4023|(2<<10)|(0<<7), + TEST("FMUL.W #$1234, FP2", 0xF200|074, 0x4023|(4<<10)|(2<<7), 0x1234); + TEST("FMUL.B #$23, FP4", 0xF200|074, 0x4023|(6<<10)|(4<<7), 0x0023); + FLTS("FMUL.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4023|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FMUL.X", "#-89000000032, FP0", 0xF200|074, 0x4023|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FMUL.P #9.12E20, FP1", 0xF200|074, 0x4023|(3<<10)|(1<<7), + FLTP("FMUL.P", "#9.12E20, FP1", 0xF200|074, 0x4023|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FMUL.W #$1234, FP2", 0xF200|074, 0x4023|(4<<10)|(2<<7), 0x1234); - TEST("FMUL.D #-8.25, FP3", 0xF200|074, 0x4023|(5<<10)|(3<<7), + FLTD("FMUL.D", "#-8.25, FP3", 0xF200|074, 0x4023|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FMUL.B #$23, FP4", 0xF200|074, 0x4023|(6<<10)|(4<<7), 0x0023); TEST("FSGLDIV.X FP0, FP1", 0xF200, 0x0024|(0<<10)|(1<<7)); ERRT("FSGLDIV.X FP0", OPERAND_NOT_ALLOWED, "FP0"); @@ -4091,15 +4107,15 @@ static void test_float_arithmetic() { TEST("FSGLDIV.X (*+$1234,PC), FP3", 0xF200|072, 0x4024|(2<<10)|(3<<7), 0x1230); TEST("FSGLDIV.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4024|(3<<10)|(5<<7), 0xC856); TEST("FSGLDIV.L #$6789ABCD, FP6", 0xF200|074, 0x4024|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSGLDIV.S #7.88999976E-10, FP7",0xF200|074, 0x4024|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSGLDIV.X #-89000000032, FP0", 0xF200|074, 0x4024|(2<<10)|(0<<7), + TEST("FSGLDIV.W #$1234, FP2", 0xF200|074, 0x4024|(4<<10)|(2<<7), 0x1234); + TEST("FSGLDIV.B #$23, FP4", 0xF200|074, 0x4024|(6<<10)|(4<<7), 0x0023); + FLTS("FSGLDIV.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4024|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FSGLDIV.X", "#-89000000032, FP0", 0xF200|074, 0x4024|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSGLDIV.P #9.12E20, FP1", 0xF200|074, 0x4024|(3<<10)|(1<<7), + FLTP("FSGLDIV.P", "#9.12E20, FP1", 0xF200|074, 0x4024|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FSGLDIV.W #$1234, FP2", 0xF200|074, 0x4024|(4<<10)|(2<<7), 0x1234); - TEST("FSGLDIV.D #-8.25, FP3", 0xF200|074, 0x4024|(5<<10)|(3<<7), + FLTD("FSGLDIV.D", "#-8.25, FP3", 0xF200|074, 0x4024|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FSGLDIV.B #$23, FP4", 0xF200|074, 0x4024|(6<<10)|(4<<7), 0x0023); TEST("FREM.X FP0, FP1", 0xF200, 0x0025|(0<<10)|(1<<7)); ERRT("FREM.X FP0", OPERAND_NOT_ALLOWED, "FP0"); @@ -4124,15 +4140,15 @@ static void test_float_arithmetic() { TEST("FREM.X (*+$1234,PC), FP3", 0xF200|072, 0x4025|(2<<10)|(3<<7), 0x1230); TEST("FREM.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4025|(3<<10)|(5<<7), 0xC856); TEST("FREM.L #$6789ABCD, FP6", 0xF200|074, 0x4025|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FREM.S #7.88999976E-10, FP7",0xF200|074, 0x4025|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FREM.X #-89000000032, FP0", 0xF200|074, 0x4025|(2<<10)|(0<<7), + TEST("FREM.W #$1234, FP2", 0xF200|074, 0x4025|(4<<10)|(2<<7), 0x1234); + TEST("FREM.B #$23, FP4", 0xF200|074, 0x4025|(6<<10)|(4<<7), 0x0023); + FLTS("FREM.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4025|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FREM.X", "#-89000000032, FP0", 0xF200|074, 0x4025|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FREM.P #9.12E20, FP1", 0xF200|074, 0x4025|(3<<10)|(1<<7), + FLTP("FREM.P", "#9.12E20, FP1", 0xF200|074, 0x4025|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FREM.W #$1234, FP2", 0xF200|074, 0x4025|(4<<10)|(2<<7), 0x1234); - TEST("FREM.D #-8.25, FP3", 0xF200|074, 0x4025|(5<<10)|(3<<7), + FLTD("FREM.D", "#-8.25, FP3", 0xF200|074, 0x4025|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FREM.B #$23, FP4", 0xF200|074, 0x4025|(6<<10)|(4<<7), 0x0023); TEST("FSCALE.X FP0, FP1", 0xF200, 0x0026|(0<<10)|(1<<7)); ERRT("FSCALE.X FP0", OPERAND_NOT_ALLOWED, "FP0"); @@ -4157,15 +4173,15 @@ static void test_float_arithmetic() { TEST("FSCALE.X (*+$1234,PC), FP3", 0xF200|072, 0x4026|(2<<10)|(3<<7), 0x1230); TEST("FSCALE.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4026|(3<<10)|(5<<7), 0xC856); TEST("FSCALE.L #$6789ABCD, FP6", 0xF200|074, 0x4026|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSCALE.S #7.88999976E-10, FP7",0xF200|074, 0x4026|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSCALE.X #-89000000032, FP0", 0xF200|074, 0x4026|(2<<10)|(0<<7), + TEST("FSCALE.W #$1234, FP2", 0xF200|074, 0x4026|(4<<10)|(2<<7), 0x1234); + TEST("FSCALE.B #$23, FP4", 0xF200|074, 0x4026|(6<<10)|(4<<7), 0x0023); + FLTS("FSCALE.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4026|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FSCALE.X", "#-89000000032, FP0", 0xF200|074, 0x4026|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSCALE.P #9.12E20, FP1", 0xF200|074, 0x4026|(3<<10)|(1<<7), + FLTP("FSCALE.P", "#9.12E20, FP1", 0xF200|074, 0x4026|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FSCALE.W #$1234, FP2", 0xF200|074, 0x4026|(4<<10)|(2<<7), 0x1234); - TEST("FSCALE.D #-8.25, FP3", 0xF200|074, 0x4026|(5<<10)|(3<<7), + FLTD("FSCALE.D", "#-8.25, FP3", 0xF200|074, 0x4026|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FSCALE.B #$23, FP4", 0xF200|074, 0x4026|(6<<10)|(4<<7), 0x0023); TEST("FSGLMUL.X FP0, FP1", 0xF200, 0x0027|(0<<10)|(1<<7)); ERRT("FSGLMUL.X FP0", OPERAND_NOT_ALLOWED, "FP0"); @@ -4190,15 +4206,15 @@ static void test_float_arithmetic() { TEST("FSGLMUL.X (*+$1234,PC), FP3", 0xF200|072, 0x4027|(2<<10)|(3<<7), 0x1230); TEST("FSGLMUL.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4027|(3<<10)|(5<<7), 0xC856); TEST("FSGLMUL.L #$6789ABCD, FP6", 0xF200|074, 0x4027|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSGLMUL.S #7.88999976E-10, FP7",0xF200|074, 0x4027|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSGLMUL.X #-89000000032, FP0", 0xF200|074, 0x4027|(2<<10)|(0<<7), + TEST("FSGLMUL.W #$1234, FP2", 0xF200|074, 0x4027|(4<<10)|(2<<7), 0x1234); + TEST("FSGLMUL.B #$23, FP4", 0xF200|074, 0x4027|(6<<10)|(4<<7), 0x0023); + FLTS("FSGLMUL.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4027|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FSGLMUL.X", "#-89000000032, FP0", 0xF200|074, 0x4027|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSGLMUL.P #9.12E20, FP1", 0xF200|074, 0x4027|(3<<10)|(1<<7), + FLTP("FSGLMUL.P", "#9.12E20, FP1", 0xF200|074, 0x4027|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FSGLMUL.W #$1234, FP2", 0xF200|074, 0x4027|(4<<10)|(2<<7), 0x1234); - TEST("FSGLMUL.D #-8.25, FP3", 0xF200|074, 0x4027|(5<<10)|(3<<7), + FLTD("FSGLMUL.D", "#-8.25, FP3", 0xF200|074, 0x4027|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FSGLMUL.B #$23, FP4", 0xF200|074, 0x4027|(6<<10)|(4<<7), 0x0023); TEST("FSUB.X FP0, FP1", 0xF200, 0x0028|(0<<10)|(1<<7)); ERRT("FSUB.X FP0", OPERAND_NOT_ALLOWED, "FP0"); @@ -4223,15 +4239,15 @@ static void test_float_arithmetic() { TEST("FSUB.X (*+$1234,PC), FP3", 0xF200|072, 0x4028|(2<<10)|(3<<7), 0x1230); TEST("FSUB.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4028|(3<<10)|(5<<7), 0xC856); TEST("FSUB.L #$6789ABCD, FP6", 0xF200|074, 0x4028|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSUB.S #7.88999976E-10, FP7",0xF200|074, 0x4028|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSUB.X #-89000000032, FP0", 0xF200|074, 0x4028|(2<<10)|(0<<7), + TEST("FSUB.W #$1234, FP2", 0xF200|074, 0x4028|(4<<10)|(2<<7), 0x1234); + TEST("FSUB.B #$23, FP4", 0xF200|074, 0x4028|(6<<10)|(4<<7), 0x0023); + FLTS("FSUB.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4028|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FSUB.X", "#-89000000032, FP0", 0xF200|074, 0x4028|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSUB.P #9.12E20, FP1", 0xF200|074, 0x4028|(3<<10)|(1<<7), + FLTP("FSUB.P", "#9.12E20, FP1", 0xF200|074, 0x4028|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FSUB.W #$1234, FP2", 0xF200|074, 0x4028|(4<<10)|(2<<7), 0x1234); - TEST("FSUB.D #-8.25, FP3", 0xF200|074, 0x4028|(5<<10)|(3<<7), + FLTD("FSUB.D", "#-8.25, FP3", 0xF200|074, 0x4028|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FSUB.B #$23, FP4", 0xF200|074, 0x4028|(6<<10)|(4<<7), 0x0023); TEST("FSINCOS.X FP0, FP2:FP1", 0xF200, 0x0032|(0<<10)|(1<<7)); TEST("FSINCOS.X FP0, FP0:FP0", 0xF200, 0x0030|(0<<10)|(0<<7)); @@ -4256,15 +4272,16 @@ static void test_float_arithmetic() { TEST("FSINCOS.X (*+$1234,PC), FP0:FP3", 0xF200|072, 0x4030|(2<<10)|(3<<7), 0x1230); TEST("FSINCOS.P (*+90,PC,A4.L), FP7:FP5", 0xF200|073, 0x4037|(3<<10)|(5<<7), 0xC856); TEST("FSINCOS.L #$6789ABCD, FP5:FP6", 0xF200|074, 0x4035|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSINCOS.S #7.88999976E-10, FP6:FP7",0xF200|074, 0x4036|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSINCOS.X #-89000000032, FP4:FP0", 0xF200|074, 0x4034|(2<<10)|(0<<7), + TEST("FSINCOS.W #$1234, FP1:FP2", 0xF200|074, 0x4031|(4<<10)|(2<<7), 0x1234); + TEST("FSINCOS.B #$23, FP7:FP4", 0xF200|074, 0x4037|(6<<10)|(4<<7), 0x0023); + FLTS("FSINCOS.S", "#7.88999976E-10, FP6:FP7", 0xF200|074, 0x4036|(1<<10)|(7<<7), + 0x3058, 0xE0F0); + FLTX("FSINCOS.X", "#-89000000032, FP4:FP0", 0xF200|074, 0x4034|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSINCOS.P #9.12E20, FP3:FP1", 0xF200|074, 0x4033|(3<<10)|(1<<7), + FLTP("FSINCOS.P", "#9.12E20, FP3:FP1", 0xF200|074, 0x4033|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FSINCOS.W #$1234, FP1:FP2", 0xF200|074, 0x4031|(4<<10)|(2<<7), 0x1234); - TEST("FSINCOS.D #-8.25, FP0:FP3", 0xF200|074, 0x4030|(5<<10)|(3<<7), + FLTD("FSINCOS.D", "#-8.25, FP0:FP3", 0xF200|074, 0x4030|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FSINCOS.B #$23, FP7:FP4", 0xF200|074, 0x4037|(6<<10)|(4<<7), 0x0023); TEST("FCMP.X FP0, FP1", 0xF200, 0x0038|(0<<10)|(1<<7)); ERRT("FCMP.X FP0", OPERAND_NOT_ALLOWED, "FP0"); @@ -4289,15 +4306,15 @@ static void test_float_arithmetic() { TEST("FCMP.X (*+$1234,PC), FP3", 0xF200|072, 0x4038|(2<<10)|(3<<7), 0x1230); TEST("FCMP.P (*+90,PC,A4.L), FP5", 0xF200|073, 0x4038|(3<<10)|(5<<7), 0xC856); TEST("FCMP.L #$6789ABCD, FP6", 0xF200|074, 0x4038|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FCMP.S #7.88999976E-10, FP7",0xF200|074, 0x4038|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FCMP.X #-89000000032, FP0", 0xF200|074, 0x4038|(2<<10)|(0<<7), + TEST("FCMP.W #$1234, FP2", 0xF200|074, 0x4038|(4<<10)|(2<<7), 0x1234); + TEST("FCMP.B #$23, FP4", 0xF200|074, 0x4038|(6<<10)|(4<<7), 0x0023); + FLTS("FCMP.S", "#7.88999976E-10, FP7", 0xF200|074, 0x4038|(1<<10)|(7<<7), 0x3058, 0xE0F0); + FLTX("FCMP.X", "#-89000000032, FP0", 0xF200|074, 0x4038|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FCMP.P #9.12E20, FP1", 0xF200|074, 0x4038|(3<<10)|(1<<7), + FLTP("FCMP.P", "#9.12E20, FP1", 0xF200|074, 0x4038|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FCMP.W #$1234, FP2", 0xF200|074, 0x4038|(4<<10)|(2<<7), 0x1234); - TEST("FCMP.D #-8.25, FP3", 0xF200|074, 0x4038|(5<<10)|(3<<7), + FLTD("FCMP.D", "#-8.25, FP3", 0xF200|074, 0x4038|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FCMP.B #$23, FP4", 0xF200|074, 0x4038|(6<<10)|(4<<7), 0x0023); TEST("FTST.X FP0", 0xF200, 0x003A|(0<<10)); ERRT("FTST.X FP0, FP1", OPERAND_NOT_ALLOWED, "FP0, FP1"); @@ -4322,15 +4339,15 @@ static void test_float_arithmetic() { TEST("FTST.X (*+$1234,PC)", 0xF200|072, 0x403A|(2<<10), 0x1230); TEST("FTST.P (*+90,PC,A4.L)", 0xF200|073, 0x403A|(3<<10), 0xC856); TEST("FTST.L #$6789ABCD", 0xF200|074, 0x403A|(0<<10), 0x6789, 0xABCD); - TEST("FTST.S #7.88999976E-10",0xF200|074, 0x403A|(1<<10), 0x3058, 0xE0F0); - TEST("FTST.X #-89000000032", 0xF200|074, 0x403A|(2<<10), + TEST("FTST.W #$1234", 0xF200|074, 0x403A|(4<<10), 0x1234); + TEST("FTST.B #$23", 0xF200|074, 0x403A|(6<<10), 0x0023); + FLTS("FTST.S", "#7.88999976E-10", 0xF200|074, 0x403A|(1<<10), 0x3058, 0xE0F0); + FLTX("FTST.X", "#-89000000032", 0xF200|074, 0x403A|(2<<10), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FTST.P #9.12E20", 0xF200|074, 0x403A|(3<<10), + FLTP("FTST.P", "#9.12E20", 0xF200|074, 0x403A|(3<<10), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FTST.W #$1234", 0xF200|074, 0x403A|(4<<10), 0x1234); - TEST("FTST.D #-8.25", 0xF200|074, 0x403A|(5<<10), + FLTD("FTST.D", "#-8.25", 0xF200|074, 0x403A|(5<<10), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FTST.B #$23", 0xF200|074, 0x403A|(6<<10), 0x0023); } static void test_float_branch() { @@ -4895,11 +4912,21 @@ static void test_comment() { COMM("DC.B 'TEXT' comment", "comment", 0x5445, 0x5854); COMM("DC.W -128, 255 comment", "comment", 0xFF80, 0x00FF); COMM("DC.L -128, 255 comment", "comment", 0xFFFF, 0xFF80, 0x0000, 0x00FF); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) - COMM("DC.S 1.0 comment", "comment", 0x3F80, 0x0000); - COMM("DC.D -1.0 comment", "comment", 0xBFF0, 0x0000, 0x0000, 0x0000); - COMM("DC.X -2.25 comment", "comment", 0xC000, 0x0000, 0x9000, 0x0000, 0x0000, 0x0000); - COMM("DC.P -2.25 comment", "comment", 0x8000, 0x0002, 0x2500, 0x0000, 0x0000, 0x0000); +#if defined(LIBASM_MC68000_NOFPU) + ERUI("DC.S 1.0 comment"); + ERUI("DC.D -1.0 comment"); + ERUI("DC.X -2.25 comment"); + ERUI("DC.P -2 comment"); +#elif defined(LIBASM_ASM_NOFLOAT) + ERRT("DC.S 1.0 comment", FLOAT_NOT_SUPPORTED, "1.0 comment", 0, 0); + ERRT("DC.D -1.0 comment", FLOAT_NOT_SUPPORTED, "-1.0 comment", 0, 0, 0, 0); + ERRT("DC.X -2.25 comment", FLOAT_NOT_SUPPORTED, "-2.25 comment", 0, 0, 0, 0, 0, 0); + ERRT("DC.P -2 comment", FLOAT_NOT_SUPPORTED, "-2 comment", 0, 0, 0, 0, 0, 0); +#else + COMM("DC.S 1.0 comment", "comment", 0x3F80, 0x0000); + COMM("DC.D -1.0 comment", "comment", 0xBFF0, 0x0000, 0x0000, 0x0000); + COMM("DC.X -2.25 comment", "comment", 0xC000, 0x0000, 0x9000, 0x0000, 0x0000, 0x0000); + COMM("DC.P -2.25 comment", "comment", 0x8000, 0x0002, 0x2500, 0x0000, 0x0000, 0x0000); #endif } @@ -4978,7 +5005,44 @@ static void test_data_constant() { 0x1234, 0x5678, 0x9ABC, 0xDEF0, 0x1234, 0x5678, 0x9ABC, 0xDEF0, 0x1234, 0x5678, 0x9ABC, 0xDEF0, 0x1234, 0x5678, 0x009A, 0xBCDE); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if defined(LIBASM_MC68000_NOFPU) + ERUI("DC.S 1.0, -inf, +nan"); + ERUI("DC.D -1.0, -inf, +nan"); + ERUI("DC.X -1.0, -inf, +nan"); + ERUI("DC.P -1.0, -inf, +nan"); +#elif defined(LIBASM_ASM_NOFLOAT) + ERRT("DC.S 1.0, -inf, +nan", FLOAT_NOT_SUPPORTED, "1.0, -inf, +nan", + 0, 0, 0, 0, 0, 0); + ERRT("DC.S -2.25e2", FLOAT_NOT_SUPPORTED, "-2.25e2", + 0, 0); + ERRT("DC.D -1.0, +inf, -nan", FLOAT_NOT_SUPPORTED, "-1.0, +inf, -nan", + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + ERRT("DC.D -2.25e2", FLOAT_NOT_SUPPORTED, "-2.25e2", + 0, 0, 0, 0); + ERRT("DC.X -1.0, -inf, +nan", FLOAT_NOT_SUPPORTED, "-1.0, -inf, +nan", + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + ERRT("DC.X -2.25", FLOAT_NOT_SUPPORTED, "-2.25", + 0, 0, 0, 0, 0, 0); + ERRT("DC.X -9.87e123", FLOAT_NOT_SUPPORTED, "-9.87e123", + 0, 0, 0, 0, 0, 0); + ERRT("DC.P -1.0, +inf, -nan", FLOAT_NOT_SUPPORTED, "-1.0, +inf, -nan", + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + ERRT("DC.P -2.25", FLOAT_NOT_SUPPORTED, "-2.25", + 0, 0, 0, 0, 0, 0); + ERRT("DC.P -22.5", FLOAT_NOT_SUPPORTED, "-22.5", + 0, 0, 0, 0, 0, 0); + ERRT("DC.P -0.225", FLOAT_NOT_SUPPORTED, "-0.225", + 0, 0, 0, 0, 0, 0); + + ERRT( "DC.S 1, UNDEF, 2", FLOAT_NOT_SUPPORTED, "1, UNDEF, 2", + 0, 0, 0, 0, 0, 0); + ERRT( "DC.D 1, UNDEF, 2", FLOAT_NOT_SUPPORTED, "1, UNDEF, 2", + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + ERRT( "DC.X 1, UNDEF, 2", FLOAT_NOT_SUPPORTED, "1, UNDEF, 2", + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + ERRT( "DC.P 1, UNDEF, 2", FLOAT_NOT_SUPPORTED, "1, UNDEF, 2", + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +#else TEST("DC.S 1.0, -inf, +nan", 0x3F80, 0x0000, 0xFF80, 0x0000, @@ -5039,7 +5103,7 @@ void run_tests(const char *cpu) { RUN_TEST(test_system); RUN_TEST(test_multiproc); RUN_TEST(test_areg_alias); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) RUN_TEST(test_float_move); RUN_TEST(test_float_arithmetic); RUN_TEST(test_float_branch); diff --git a/test/test_asm_ns32000.cpp b/test/test_asm_ns32000.cpp index 7bf400ee..5571e415 100644 --- a/test/test_asm_ns32000.cpp +++ b/test/test_asm_ns32000.cpp @@ -24,6 +24,22 @@ using namespace libasm::test; AsmNs32000 asm32k; Assembler &assembler(asm32k); +#if defined(LIBASM_ASM_NOFLOAT) +#define FLT3(insn, opr, op1, op2, op3, ...) \ + ERRT(insn " " opr, FLOAT_NOT_SUPPORTED, opr, op1, op2, op3, 0, 0, 0, 0) +#define FLT3_2(insn, opr, op1, op2, op3, ...) \ + ERRT(insn " " opr, FLOAT_NOT_SUPPORTED, opr, op1, op2, op3, 0, 0, 0, 0, 0, 0, 0, 0) +#define LNG3(insn, opr, op1, op2, op3, ...) \ + ERRT(insn " " opr, FLOAT_NOT_SUPPORTED, opr, op1, op2, op3, 0, 0, 0, 0, 0, 0, 0, 0) +#define LNG3_2(insn, opr, op1, op2, op3, ...) \ + ERRT(insn " " opr, FLOAT_NOT_SUPPORTED, opr, op1, op2, op3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) +#else +#define FLT3(insn, opr, op1, op2, op3, ...) TEST(insn " " opr, op1, op2, op3, __VA_ARGS__) +#define FLT3_2(insn, opr, op1, op2, op3, ...) TEST(insn " " opr, op1, op2, op3, __VA_ARGS__) +#define LNG3(insn, opr, op1, op2, op3, ...) TEST(insn " " opr, op1, op2, op3, __VA_ARGS__) +#define LNG3_2(insn, opr, op1, op2, op3, ...) TEST(insn " " opr, op1, op2, op3, __VA_ARGS__) +#endif + static void set_up() { assembler.reset(); } @@ -40,18 +56,18 @@ static void tear_down() { EQUALS("cpu 32032", true, assembler.setCpu("32032")); EQUALS_P("cpu 32032", "32032", assembler.config().cpu_P()); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) - TEST("fpu ns32081"); -#else +#if defined(LIBASM_NS32000_NOFPU) ERRT("fpu ns32081", UNKNOWN_OPERAND, "ns32081"); +#else + TEST("fpu ns32081"); #endif TEST("fpu none"); ERRT("fpu ns32082", UNKNOWN_OPERAND, "ns32082"); -#if !defined(LIBASM_NS32000_NOMMU) - TEST("pmmu ns32082"); -#else +#if defined(LIBASM_NS32000_NOMMU) ERRT("pmmu ns32082", UNKNOWN_OPERAND, "ns32082"); +#else + TEST("pmmu ns32082"); #endif TEST("pmmu none"); ERRT("pmmu ns32081", UNKNOWN_OPERAND, "ns32081"); @@ -370,42 +386,42 @@ static void test_format_8() { ERRT("INSD R0,R2,0(R1),33", OVERFLOW_RANGE, "33", 0xAE, 0x43, 0x12, 0x00, 0x21); } -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) static void test_format_9_fpu() { TEST("FPU NS32081"); TEST("MOVF F1,8(SB)", 0xBE, 0x85, 0x0E, 0x08); TEST("MOVL F2,8(SB)", 0xBE, 0x84, 0x16, 0x08); - TEST("MOVF 1,F3", 0xBE, 0xC5, 0xA0, 0x3F, 0x80, 0x00, 0x00); - TEST("MOVF -1,F3", 0xBE, 0xC5, 0xA0, 0xBF, 0x80, 0x00, 0x00); - TEST("MOVF 0x7FFFFFFF,F3", 0xBE, 0xC5, 0xA0, 0x4F, 0x00, 0x00, 0x00); - TEST("MOVF 0x80000000,F3", 0xBE, 0xC5, 0xA0, 0x4F, 0x00, 0x00, 0x00); - TEST("MOVF 0xFFFFFFFF,F3", 0xBE, 0xC5, 0xA0, 0x4F, 0x80, 0x00, 0x00); - TEST("MOVF +99999999999,F3", 0xBE, 0xC5, 0xA0, 0x51, 0xBA, 0x43, 0xB7); - TEST("MOVF -99999999999,F3", 0xBE, 0xC5, 0xA0, 0xD1, 0xBA, 0x43, 0xB7); - TEST("MOVF NAN,F1", 0xBE, 0x45, 0xA0, 0x7F, 0xC0, 0x00, 0x00); - TEST("MOVF +INF,F2", 0xBE, 0x85, 0xA0, 0x7F, 0x80, 0x00, 0x00); - TEST("MOVF -INF,F2", 0xBE, 0x85, 0xA0, 0xFF, 0x80, 0x00, 0x00); - TEST("MOVF +0.0,F3", 0xBE, 0xC5, 0xA0, 0x00, 0x00, 0x00, 0x00); - TEST("MOVF -0.0,F3", 0xBE, 0xC5, 0xA0, 0x80, 0x00, 0x00, 0x00); - TEST("MOVL 1,F4", 0xBE, 0x04, 0xA1, 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL -1,F4", 0xBE, 0x04, 0xA1, 0xBF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL 0x7FFFFFFFFFFFFFFF,F4", + FLT3("MOVF", "1,F3", 0xBE, 0xC5, 0xA0, 0x3F, 0x80, 0x00, 0x00); + FLT3("MOVF", "-1,F3", 0xBE, 0xC5, 0xA0, 0xBF, 0x80, 0x00, 0x00); + FLT3("MOVF", "0x7FFFFFFF,F3", 0xBE, 0xC5, 0xA0, 0x4F, 0x00, 0x00, 0x00); + FLT3("MOVF", "0x80000000,F3", 0xBE, 0xC5, 0xA0, 0x4F, 0x00, 0x00, 0x00); + FLT3("MOVF", "0xFFFFFFFF,F3", 0xBE, 0xC5, 0xA0, 0x4F, 0x80, 0x00, 0x00); + FLT3("MOVF", "+99999999999,F3", 0xBE, 0xC5, 0xA0, 0x51, 0xBA, 0x43, 0xB7); + FLT3("MOVF", "-99999999999,F3", 0xBE, 0xC5, 0xA0, 0xD1, 0xBA, 0x43, 0xB7); + FLT3("MOVF", "NAN,F1", 0xBE, 0x45, 0xA0, 0x7F, 0xC0, 0x00, 0x00); + FLT3("MOVF", "+INF,F2", 0xBE, 0x85, 0xA0, 0x7F, 0x80, 0x00, 0x00); + FLT3("MOVF", "-INF,F2", 0xBE, 0x85, 0xA0, 0xFF, 0x80, 0x00, 0x00); + FLT3("MOVF", "+0.0,F3", 0xBE, 0xC5, 0xA0, 0x00, 0x00, 0x00, 0x00); + FLT3("MOVF", "-0.0,F3", 0xBE, 0xC5, 0xA0, 0x80, 0x00, 0x00, 0x00); + LNG3("MOVL", "1,F4", 0xBE, 0x04, 0xA1, 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + LNG3("MOVL", "-1,F4", 0xBE, 0x04, 0xA1, 0xBF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + LNG3("MOVL", "0x7FFFFFFFFFFFFFFF,F4", 0xBE, 0x04, 0xA1, 0x43, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL 0x8000000000000000,F4", + LNG3("MOVL", "0x8000000000000000,F4", 0xBE, 0x04, 0xA1, 0x43, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL 0xFFFFFFFFFFFFFFFF,F4", + LNG3("MOVL", "0xFFFFFFFFFFFFFFFF,F4", 0xBE, 0x04, 0xA1, 0x43, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL +999999999999999999999,F4", + LNG3("MOVL", "+999999999999999999999,F4", 0xBE, 0x04, 0xA1, 0x44, 0x4B, 0x1A, 0xE4, 0xD6, 0xE2, 0xEF, 0x50); - TEST("MOVL -999999999999999999999,F4", + LNG3("MOVL", "-999999999999999999999,F4", 0xBE, 0x04, 0xA1, 0xC4, 0x4B, 0x1A, 0xE4, 0xD6, 0xE2, 0xEF, 0x50); - TEST("MOVL NAN,F0", 0xBE, 0x04, 0xA0, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL +INF,F2", 0xBE, 0x84, 0xA0, 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL -INF,F2", 0xBE, 0x84, 0xA0, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL +0.0,F4", 0xBE, 0x04, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL -0.0,F4", 0xBE, 0x04, 0xA1, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + LNG3("MOVL", "NAN,F0", 0xBE, 0x04, 0xA0, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + LNG3("MOVL", "+INF,F2", 0xBE, 0x84, 0xA0, 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + LNG3("MOVL", "-INF,F2", 0xBE, 0x84, 0xA0, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + LNG3("MOVL", "+0.0,F4", 0xBE, 0x04, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + LNG3("MOVL", "-0.0,F4", 0xBE, 0x04, 0xA1, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); TEST("MOVBF 2,F0", 0x3E, 0x04, 0xA0, 0x02); TEST("MOVBL R1,F2", 0x3E, 0x80, 0x08); @@ -474,11 +490,11 @@ static void test_format_11_fpu() { TEST("ADDL 16(SB),F4", 0xBE, 0x00, 0xD1, 0x10); TEST("CMPF F1,F3", 0xBE, 0xC9, 0x08); TEST("CMPL F6,F4", 0xBE, 0x08, 0x31); - TEST("CMPF 1.25, 3.75", + FLT3_2("CMPF", "1.25, 3.75", 0xBE, 0x09, 0xA5, 0x3F, 0xA0, 0x00, 0x00, 0x40, 0x70, 0x00, 0x00); - TEST("CMPL 1.25, 3.75", + LNG3_2("CMPL", "1.25, 3.75", 0xBE, 0x08, 0xA5, 0x3F, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); @@ -543,13 +559,13 @@ static void test_format_14_mmu() { #endif static void test_generic_addressing() { -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) TEST("FPU NS32081"); #endif // Register TEST("ADDW R1, R2", 0x81, 0x08); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) TEST("ADDF F1, F2", 0xBE, 0x81, 0x08); #endif // Register Relative @@ -564,14 +580,14 @@ static void test_generic_addressing() { TEST("ADDB 0x56, R1", 0x40, 0xA0, 0x56); TEST("ADDW 0x1234, R1", 0x41, 0xA0, 0x12, 0x34); TEST("ADDD 0x12345678, R1", 0x43, 0xA0, 0x12, 0x34, 0x56, 0x78); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) - TEST("ADDF 3.14159, F1", +#if !defined(LIBASM_NS32000_NOFPU) + FLT3("ADDF", "3.14159, F1", 0xBE, 0x41, 0xA0, 0x40, 0x49, 0x0F, 0xD0); - TEST("ADDF 299792000, F3", + FLT3("ADDF", "299792000, F3", 0xBE, 0xC1, 0xA0, 0x4D, 0x8E, 0xF3, 0xB4); - TEST("ADDL 2.718281828459045, F2", + LNG3("ADDL", "2.718281828459045, F2", 0xBE, 0x80, 0xA0, 0x40, 0x05, 0xBF, 0x0A, 0x8B, 0x14, 0x57, 0x69); - TEST("ADDL 6.62607015e-34, F4", + LNG3("ADDL", "6.62607015e-34, F4", 0xBE, 0x00, 0xA1, 0x39, 0x0B, 0x86, 0x0B, 0xDE, 0x02, 0x31, 0x11); #endif // Absolute @@ -681,7 +697,7 @@ static void test_generic_addressing() { } static void test_comment() { -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) TEST("FPU NS32081"); #endif #if !defined(LIBASM_NS32000_NOMMU) @@ -709,8 +725,8 @@ static void test_comment() { ACOMM(0x100, "ADDW 8 (SP) , * - 10 ; comment", "; comment", 0xC1, 0xCE, 0x08, 0x76); ACOMM(0x100, "ADDW 8 (SP) , 0x10A (PC); comment", "; comment", 0xC1, 0xCE, 0x08, 0x0A); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) - TEST("ADDL 137.03599908421, F6", +#if !defined(LIBASM_NS32000_NOFPU) + LNG3("ADDL", "137.03599908421, F6", 0xBE, 0x80, 0xA1, 0x40, 0x61, 0x21, 0x26, 0xE7, 0x8D, 0x2B, 0xC6); #endif @@ -734,9 +750,15 @@ static void test_comment() { COMM(R"(.ascii "TEXT" # comment)", "# comment", 0x54, 0x45, 0x58, 0x54); COMM(".word -128, 255 ; comment", "; comment", 0x80, 0xFF, 0xFF, 0x00); COMM(".double x'1234 # comment", "# comment", 0x34, 0x12, 0x00, 0x00); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) - COMM(".float 1.0 # comment", "# comment", 0x00, 0x00, 0x80, 0x3F); - COMM(".long -1.0 # comment", "# comment", 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF); +#if defined(LIBASM_NS32000_NOFPU) + ERUI(".float 1.0 # comment"); + ERUI(".long -1.0 # comment"); +#elif defined(LIBASM_ASM_NOFLOAT) + ERRT(".float 1.0 # comment", FLOAT_NOT_SUPPORTED, "1.0 # comment", 0, 0, 0, 0); + ERRT(".long -1.0 # comment", FLOAT_NOT_SUPPORTED, "-1.0 # comment", 0, 0, 0, 0, 0, 0, 0, 0); +#else + COMM(".float 1.0 # comment", "# comment", 0x00, 0x00, 0x80, 0x3F); + COMM(".long -1.0 # comment", "# comment", 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF); #endif } @@ -790,7 +812,7 @@ static void test_undef() { ERUS("INSB R1,16, 2(R0),UNDEF", "UNDEF", 0xAE, 0x08, 0xA2, 0x10, 0x02, 0x00); ERUS("INSB R1,UNDEF,2(R0),UNDEF", "UNDEF,2(R0),UNDEF", 0xAE, 0x08, 0xA2, 0x00, 0x02, 0x00); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) TEST("FPU NS32081"); ERUS("ADDF UNDEF, F0", "UNDEF, F0", 0xBE, 0x01, 0xA0, 0x00, 0x00, 0x00, 0x00); ERUS("ADDL UNDEF, F0", "UNDEF, F0", 0xBE, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); @@ -855,7 +877,27 @@ static void test_data_constant() { 0x78, 0x56, 0x34, 0x12, 0xF0, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, 0xF0, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, 0xF0, 0xDE, 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, 0xDE, 0xBC, 0x9A, 0x00); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if defined(LIBASM_NS32000_NOFPU) + ERUI(".float 1.0, -inf, +nan"); + ERUI(".float -2.25e2"); + ERUI(".long -1.0, +inf, -nan"); + ERUI(".long -2.25e2"); + ERUI(".float 1, UNDEF, 2"); + ERUI(".long 1, UNDEF, 2"); +#elif defined(LIBASM_ASM_NOFLOAT) + ERRT(".float 1.0, -inf, +nan", FLOAT_NOT_SUPPORTED, "1.0, -inf, +nan", + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + ERRT(".float -2.25e2", FLOAT_NOT_SUPPORTED, "-2.25e2", + 0, 0, 0, 0); + ERRT(".long -1.0, +inf, -nan", FLOAT_NOT_SUPPORTED, "-1.0, +inf, -nan", + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + ERRT(".long -2.25e2", FLOAT_NOT_SUPPORTED, "-2.25e2", + 0, 0, 0, 0, 0, 0, 0, 0); + ERRT(".float 1, UNDEF, 2", FLOAT_NOT_SUPPORTED, "1, UNDEF, 2", + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + ERRT(".long 1, UNDEF, 2", FLOAT_NOT_SUPPORTED, "1, UNDEF, 2", + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +#else TEST(".float 1.0, -inf, +nan", 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x80, 0xFF, @@ -890,7 +932,7 @@ void run_tests(const char *cpu) { RUN_TEST(test_format_6); RUN_TEST(test_format_7); RUN_TEST(test_format_8); -#if !defined(LIBASM_ASM_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) RUN_TEST(test_format_9_fpu); RUN_TEST(test_format_11_fpu); #endif diff --git a/test/test_dis_i8086.cpp b/test/test_dis_i8086.cpp index 0d3dab4a..ae5f9c91 100644 --- a/test/test_dis_i8086.cpp +++ b/test/test_dis_i8086.cpp @@ -1783,7 +1783,7 @@ static void test_segment_override() { } } -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) +#if !defined(LIBASM_I8086_NOFPU) static void test_float() { TEST("FINIT", "", 0x9B, 0xDB, 0xE3); @@ -2480,10 +2480,10 @@ static void test_illegal() { UNKN(0xC9); } -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) -#define UNKN_FPU(opc, modReg) UNKN(opc, modReg); -#else +#if defined(LIBASM_I8086_NOFPU) #define UNKN_FPU(opc, modReg) UNKN(opc); +#else +#define UNKN_FPU(opc, modReg) UNKN(opc, modReg); #endif for (auto mod = 0; mod < 4; mod++) { @@ -2559,7 +2559,7 @@ void run_tests(const char *cpu) { RUN_TEST(test_control_transfer); RUN_TEST(test_processor_control); RUN_TEST(test_segment_override); -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_I8086_NOFPU) +#if !defined(LIBASM_I8086_NOFPU) RUN_TEST(test_float); RUN_TEST(test_float_nowait); #endif diff --git a/test/test_dis_mc68000.cpp b/test/test_dis_mc68000.cpp index b3f2eefa..69ff2e0f 100644 --- a/test/test_dis_mc68000.cpp +++ b/test/test_dis_mc68000.cpp @@ -24,6 +24,14 @@ using namespace libasm::test; DisMc68000 dis68000; Disassembler &disassembler(dis68000); +#if defined(LIBASM_DIS_NOFLOAT) +#define TFLT(insn, opr, hex, ...) ERRT(insn, hex, FLOAT_NOT_SUPPORTED, hex, __VA_ARGS__) +#define EFLT(insn, opr, error, at, hex, ...) ERRT(insn, hex, FLOAT_NOT_SUPPORTED, hex, __VA_ARGS__) +#else +#define TFLT(insn, opr, hex, ...) TEST(insn, opr, __VA_ARGS__) +#define EFLT(insn, opr, error, at, hex, ...) ERRT(insn, opr, error, at, __VA_ARGS__) +#endif + static void set_up() { disassembler.reset(); disassembler.setOption("relative", "true"); @@ -2345,7 +2353,7 @@ static void test_multiproc() { TEST("ILLEGAL", "", 0045374); // ILLEGAL } -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) static void test_float_move() { TEST("FMOVE.X", "FP0, FP1", 0xF200, 0x0000|(0<<10)|(1<<7)); @@ -2374,15 +2382,16 @@ static void test_float_move() { TEST("FMOVE.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4000|(2<<10)|(3<<7), 0x1230); TEST("FMOVE.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4000|(3<<10)|(5<<7), 0xC856); TEST("FMOVE.L", "#$6789ABCD, FP6", 0xF200|074, 0x4000|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FMOVE.S", "#7.88999976E-10, FP7",0xF200|074, 0x4000|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FMOVE.X", "#-89000000032, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FMOVE.P", "#0.0912, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), - 0x4002, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FMOVE.W", "#$1234, FP2", 0xF200|074, 0x4000|(4<<10)|(2<<7), 0x1234); - TEST("FMOVE.D", "#-8.25, FP3", 0xF200|074, 0x4000|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FMOVE.B", "#$23, FP4", 0xF200|074, 0x4000|(6<<10)|(4<<7), 0x0023); + TFLT("FMOVE.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4000|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FMOVE.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4000|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FMOVE.P", "#0.0912, FP1", "#$400200091200000000000000, FP1", + 0xF200|074, 0x4000|(3<<10)|(1<<7), 0x4002, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FMOVE.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4000|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FMOVE.L", "FP3, D2", 0xF200|002, 0x6000|(0<<10)|(3<<7)); TEST("FMOVE.S", "FP3, D2", 0xF200|002, 0x6000|(1<<10)|(3<<7)); @@ -2584,44 +2593,52 @@ static void test_float_move() { TEST("FMOVECR.X", "#$20, FP4", 0xF200, 0x5C00|(4<<7)|0x20); TEST("FMOVECR.X", "#$7F, FP7", 0xF200, 0x5C00|(7<<7)|0x7F); - TEST("FMOVE.X", "#INF, FP0", + TFLT("FMOVE.X", "#INF, FP0", "#$7FFF00008000000000000000, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), 0x7FFF, 0x0000, 0x8000, 0x0000, 0x0000, 0x0000); - TEST("FMOVE.X", "#-INF, FP0", + TFLT("FMOVE.X", "#-INF, FP0", "#$FFFF00008000000000000000, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), 0xFFFF, 0x0000, 0x8000, 0x0000, 0x0000, 0x0000); - TEST("FMOVE.X", "#NAN, FP0", + TFLT("FMOVE.X", "#NAN, FP0", "#$7FFF0000C000000000000000, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), 0x7FFF, 0x0000, 0xC000, 0x0000, 0x0000, 0x0000); - TEST("FMOVE.X", "#NAN, FP0", + TFLT("FMOVE.X", "#NAN, FP0", "#$7FFF0000C000000000000000, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), 0x7FFF, 0x0000, 0xC000, 0x0000, 0x0000, 0x0000); - TEST("FMOVE.X", "#-NAN, FP0", + TFLT("FMOVE.X", "#-NAN, FP0", "#$FFFF10008000000000000001, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), 0xFFFF, 0x1000, 0x8000, 0x0000, 0x0000, 0x0001); - TEST("FMOVE.X", "#-INF, FP0", + TFLT("FMOVE.X", "#-INF, FP0", "#$FFFF00018000000000000000, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), 0xFFFF, 0x0001, 0x8000, 0x0000, 0x0000, 0x0000); - TEST("FMOVE.X", "#-89000000032, FP0", + TFLT("FMOVE.X", "#-89000000032, FP0", "#$C0230001A5C681D100000000, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), 0xC023, 0x0001, 0xA5C6, 0x81D1, 0x0000, 0x0000); - ERRT("FMOVE.X", "#-NAN, FP0", ILLEGAL_CONSTANT, "-NAN, FP0", + EFLT("FMOVE.X", "#-NAN, FP0", ILLEGAL_CONSTANT, + "-NAN, FP0", "#$C023000025C681D100000000, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), 0xC023, 0x0000, 0x25C6, 0x81D1, 0x0000, 0x0000); - ERRT("FMOVE.X", "#-NAN, FP0", ILLEGAL_CONSTANT, "-NAN, FP0", + EFLT("FMOVE.X", "#-NAN, FP0", ILLEGAL_CONSTANT, + "-NAN, FP0", "#$80000000A5C681D100000000, FP0", 0xF200|074, 0x4000|(2<<10)|(0<<7), 0x8000, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FMOVE.P", "#INF, FP1", + TFLT("FMOVE.P", "#INF, FP1", "#$7FFF00000000000000000000, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), 0x7FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000); - TEST("FMOVE.P", "#-INF, FP1", + TFLT("FMOVE.P", "#-INF, FP1", "#$FFFF00000000000000000000, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000); - TEST("FMOVE.P", "#NAN, FP1", + TFLT("FMOVE.P", "#NAN, FP1", "#$7FFF00008000000000000000, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), 0x7FFF, 0x0000, 0x8000, 0x0000, 0x0000, 0x0000); - TEST("FMOVE.P", "#-NAN, FP1", + TFLT("FMOVE.P", "#-NAN, FP1", "#$FFFF00000000000000000001, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001); - ERRT("FMOVE.P", "#9.12E+20, FP1", ILLEGAL_CONSTANT, "9.12E+20, FP1", + EFLT("FMOVE.P", "#9.12E+20, FP1", ILLEGAL_CONSTANT, + "9.12E+20, FP1", "#$002010091200000000000000, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), 0x0020, 0x1009, 0x1200, 0x0000, 0x0000, 0x0000); - ERRT("FMOVE.P", "#9.12E+20, FP1", ILLEGAL_CONSTANT, "9.12E+20, FP1", + EFLT("FMOVE.P", "#9.12E+20, FP1", ILLEGAL_CONSTANT, + "9.12E+20, FP1", "#$002002091200000000000000, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), 0x0020, 0x0209, 0x1200, 0x0000, 0x0000, 0x0000); - ERRT("FMOVE.P", "#9.12E+20, FP1", ILLEGAL_CONSTANT, "9.12E+20, FP1", + EFLT("FMOVE.P", "#9.12E+20, FP1", ILLEGAL_CONSTANT, + "9.12E+20, FP1", "#$002000391200000000000000, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), 0x0020, 0x0039, 0x1200, 0x0000, 0x0000, 0x0000); - ERRT("FMOVE.P", "#9.12E+20, FP1", ILLEGAL_CONSTANT, "9.12E+20, FP1", + EFLT("FMOVE.P", "#9.12E+20, FP1", ILLEGAL_CONSTANT, + "9.12E+20, FP1", "#$001A00091200000000000000, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), 0x001A, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - ERRT("FMOVE.P", "#9.12E+20, FP1", ILLEGAL_CONSTANT, "9.12E+20, FP1", + EFLT("FMOVE.P", "#9.12E+20, FP1", ILLEGAL_CONSTANT, + "9.12E+20, FP1", "#$00200008B200000000000000, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), 0x0020, 0x0008, 0xB200, 0x0000, 0x0000, 0x0000); - ERRT("FMOVE.P", "#1.012E+20, FP1", ILLEGAL_CONSTANT, "1.012E+20, FP1", + EFLT("FMOVE.P", "#1.012E+20, FP1", ILLEGAL_CONSTANT, + "1.012E+20, FP1", "#$0019000A1200000000000000, FP1", 0xF200|074, 0x4000|(3<<10)|(1<<7), 0x0019, 0x000A, 0x1200, 0x0000, 0x0000, 0x0000); EQUALS("gnu-as", OK, disassembler.setOption("gnu-as", "on")); @@ -2673,28 +2690,17 @@ static void test_float_arithmetic() { TEST("FINT.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4001|(2<<10)|(3<<7), 0x1230); TEST("FINT.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4001|(3<<10)|(5<<7), 0xC856); TEST("FINT.L", "#$6789ABCD, FP6", 0xF200|074, 0x4001|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FINT.S", "#7.88999976E-10, FP7",0xF200|074, 0x4001|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FINT.X", "#-89000000032, FP0", 0xF200|074, 0x4001|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FINT.P", "#912, FP1", 0xF200|074, 0x4001|(3<<10)|(1<<7), - 0x0002, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FINT.W", "#$1234, FP2", 0xF200|074, 0x4001|(4<<10)|(2<<7), 0x1234); - TEST("FINT.D", "#-8.25, FP3", 0xF200|074, 0x4001|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FINT.B", "#$23, FP4", 0xF200|074, 0x4001|(6<<10)|(4<<7), 0x0023); + TFLT("FINT.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4001|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FINT.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4001|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FINT.P", "#912, FP1", "#$000200091200000000000000, FP1", + 0xF200|074, 0x4001|(3<<10)|(1<<7), 0x0002, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FINT.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4001|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FSINH.X", "FP0, FP1", 0xF200, 0x0002|(0<<10)|(1<<7)); - TEST("FSINH.X", "FP2", 0xF200, 0x0002|(2<<10)|(2<<7)); - TEST("FSINH.L", "D2, FP3", 0xF200|002, 0x4002|(0<<10)|(3<<7)); - TEST("FSINH.S", "D2, FP3", 0xF200|002, 0x4002|(1<<10)|(3<<7)); - ERRT("FSINH.X", "D2, FP3", ILLEGAL_SIZE, "D2, FP3", - 0xF200|002, 0x4002|(2<<10)|(3<<7)); - ERRT("FSINH.P", "D2, FP3", ILLEGAL_SIZE, "D2, FP3", - 0xF200|002, 0x4002|(3<<10)|(3<<7)); - TEST("FSINH.W", "D2, FP3", 0xF200|002, 0x4002|(4<<10)|(3<<7)); - ERRT("FSINH.D", "D2, FP3", ILLEGAL_SIZE, "D2, FP3", - 0xF200|002, 0x4002|(5<<10)|(3<<7)); - TEST("FSINH.B", "D2, FP3", 0xF200|002, 0x4002|(6<<10)|(3<<7)); UNKN(/* FSINH.P D2, FP3 */ 0xF200|002, 0x4002|(7<<10)|(3<<7)); UNKN(/* FSINH.S A4, FP5 */ 0xF200|014, 0x4002|(1<<10)|(5<<7)); TEST("FSINH.X", "(A6), FP7", 0xF200|026, 0x4002|(2<<10)|(7<<7)); @@ -2707,22 +2713,25 @@ static void test_float_arithmetic() { TEST("FSINH.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4002|(2<<10)|(3<<7), 0x1230); TEST("FSINH.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4002|(3<<10)|(5<<7), 0xC856); TEST("FSINH.L", "#$6789ABCD, FP6", 0xF200|074, 0x4002|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSINH.S", "#7.88999976E-10, FP7",0xF200|074, 0x4002|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSINH.X", "#-89000000032, FP0", 0xF200|074, 0x4002|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSINH.P", "#-9.12E+20, FP1", 0xF200|074, 0x4002|(3<<10)|(1<<7), - 0x8020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); - TEST("FSINH.W", "#$1234, FP2", 0xF200|074, 0x4002|(4<<10)|(2<<7), 0x1234); - TEST("FSINH.D", "#-8.25, FP3", 0xF200|074, 0x4002|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); - TEST("FSINH.B", "#$23, FP4", 0xF200|074, 0x4002|(6<<10)|(4<<7), 0x0023); + TFLT("FSINH.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4002|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FSINH.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4002|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FSINH.P", "#-9.12E+20, FP1", "#$802000091200000000000000, FP1", + 0xF200|074, 0x4002|(3<<10)|(1<<7), 0x8020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TEST("FSINH.W", "#$1234, FP2", + 0xF200|074, 0x4002|(4<<10)|(2<<7), 0x1234); + TFLT("FSINH.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4002|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); + TEST("FSINH.B", "#$23, FP4", + 0xF200|074, 0x4002|(6<<10)|(4<<7), 0x0023); TEST("FINTRZ.X", "FP0, FP1", 0xF200, 0x0003|(0<<10)|(1<<7)); TEST("FINTRZ.X", "FP2", 0xF200, 0x0003|(2<<10)|(2<<7)); TEST("FINTRZ.L", "D2, FP3", 0xF200|002, 0x4003|(0<<10)|(3<<7)); TEST("FINTRZ.S", "D2, FP3", 0xF200|002, 0x4003|(1<<10)|(3<<7)); ERRT("FINTRZ.X", "D2, FP3", ILLEGAL_SIZE, "D2, FP3", - 0xF200|002, 0x4003|(2<<10)|(3<<7)); + 0xF200|002, 0x4003|(2<<10)|(3<<7)); ERRT("FINTRZ.P", "D2, FP3", ILLEGAL_SIZE, "D2, FP3", 0xF200|002, 0x4003|(3<<10)|(3<<7)); TEST("FINTRZ.W", "D2, FP3", 0xF200|002, 0x4003|(4<<10)|(3<<7)); @@ -2741,15 +2750,16 @@ static void test_float_arithmetic() { TEST("FINTRZ.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4003|(2<<10)|(3<<7), 0x1230); TEST("FINTRZ.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4003|(3<<10)|(5<<7), 0xC856); TEST("FINTRZ.L", "#$6789ABCD, FP6", 0xF200|074, 0x4003|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FINTRZ.S", "#7.88999976E-10, FP7",0xF200|074, 0x4003|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FINTRZ.X", "#-89000000032, FP0", 0xF200|074, 0x4003|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FINTRZ.P", "#9.12E-20, FP1", 0xF200|074, 0x4003|(3<<10)|(1<<7), - 0x4020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FINTRZ.W", "#$1234, FP2", 0xF200|074, 0x4003|(4<<10)|(2<<7), 0x1234); - TEST("FINTRZ.D", "#-8.25, FP3", 0xF200|074, 0x4003|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FINTRZ.B", "#$23, FP4", 0xF200|074, 0x4003|(6<<10)|(4<<7), 0x0023); + TFLT("FINTRZ.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4003|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FINTRZ.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4003|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FINTRZ.P", "#9.12E-20, FP1", "#$402000091200000000000000, FP1", + 0xF200|074, 0x4003|(3<<10)|(1<<7), 0x4020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FINTRZ.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4003|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSQRT.X", "FP0, FP1", 0xF200, 0x0004|(0<<10)|(1<<7)); TEST("FSQRT.X", "FP2", 0xF200, 0x0004|(2<<10)|(2<<7)); @@ -2775,15 +2785,16 @@ static void test_float_arithmetic() { TEST("FSQRT.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4004|(2<<10)|(3<<7), 0x1230); TEST("FSQRT.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4004|(3<<10)|(5<<7), 0xC856); TEST("FSQRT.L", "#$6789ABCD, FP6", 0xF200|074, 0x4004|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSQRT.S", "#7.88999976E-10, FP7",0xF200|074, 0x4004|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSQRT.X", "#-89000000032, FP0", 0xF200|074, 0x4004|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSQRT.P", "#9.1234567891234567, FP1", 0xF200|074, 0x4004|(3<<10)|(1<<7), - 0x0000, 0x0009, 0x1234, 0x5678, 0x9123, 0x4567); TEST("FSQRT.W", "#$1234, FP2", 0xF200|074, 0x4004|(4<<10)|(2<<7), 0x1234); - TEST("FSQRT.D", "#-8.25, FP3", 0xF200|074, 0x4004|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSQRT.B", "#$23, FP4", 0xF200|074, 0x4004|(6<<10)|(4<<7), 0x0023); + TFLT("FSQRT.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4004|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FSQRT.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4004|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FSQRT.P", "#9.1234567891234567, FP1", "#$000000091234567891234567, FP1", + 0xF200|074, 0x4004|(3<<10)|(1<<7), 0x0000, 0x0009, 0x1234, 0x5678, 0x9123, 0x4567); + TFLT("FSQRT.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4004|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FLOGNP1.X", "FP0, FP1", 0xF200, 0x0006|(0<<10)|(1<<7)); TEST("FLOGNP1.X", "FP2", 0xF200, 0x0006|(2<<10)|(2<<7)); @@ -2809,15 +2820,16 @@ static void test_float_arithmetic() { TEST("FLOGNP1.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4006|(2<<10)|(3<<7), 0x1230); TEST("FLOGNP1.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4006|(3<<10)|(5<<7), 0xC856); TEST("FLOGNP1.L", "#$6789ABCD, FP6", 0xF200|074, 0x4006|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FLOGNP1.S", "#7.88999976E-10, FP7",0xF200|074, 0x4006|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FLOGNP1.X", "#-89000000032, FP0", 0xF200|074, 0x4006|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FLOGNP1.P", "#-INF, FP1", 0xF200|074, 0x4006|(3<<10)|(1<<7), - 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000); TEST("FLOGNP1.W", "#$1234, FP2", 0xF200|074, 0x4006|(4<<10)|(2<<7), 0x1234); - TEST("FLOGNP1.D", "#-8.25, FP3", 0xF200|074, 0x4006|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FLOGNP1.B", "#$23, FP4", 0xF200|074, 0x4006|(6<<10)|(4<<7), 0x0023); + TFLT("FLOGNP1.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4006|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FLOGNP1.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4006|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FLOGNP1.P", "#-INF, FP1", "#$FFFF00000000000000000000, FP1", + 0xF200|074, 0x4006|(3<<10)|(1<<7), 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000); + TFLT("FLOGNP1.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4006|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FETOXM1.X", "FP0, FP1", 0xF200, 0x0008|(0<<10)|(1<<7)); TEST("FETOXM1.X", "FP2", 0xF200, 0x0008|(2<<10)|(2<<7)); @@ -2843,15 +2855,16 @@ static void test_float_arithmetic() { TEST("FETOXM1.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4008|(2<<10)|(3<<7), 0x1230); TEST("FETOXM1.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4008|(3<<10)|(5<<7), 0xC856); TEST("FETOXM1.L", "#$6789ABCD, FP6", 0xF200|074, 0x4008|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FETOXM1.S", "#7.88999976E-10, FP7",0xF200|074, 0x4008|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FETOXM1.X", "#-89000000032, FP0", 0xF200|074, 0x4008|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FETOXM1.P", "#NAN, FP1", 0xF200|074, 0x4008|(3<<10)|(1<<7), - 0x7FFF, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FETOXM1.W", "#$1234, FP2", 0xF200|074, 0x4008|(4<<10)|(2<<7), 0x1234); - TEST("FETOXM1.D", "#-8.25, FP3", 0xF200|074, 0x4008|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FETOXM1.B", "#$23, FP4", 0xF200|074, 0x4008|(6<<10)|(4<<7), 0x0023); + TFLT("FETOXM1.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4008|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FETOXM1.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4008|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FETOXM1.P", "#NAN, FP1", "#$7FFF00091200000000000000, FP1", + 0xF200|074, 0x4008|(3<<10)|(1<<7), 0x7FFF, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FETOXM1.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4008|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FTANH.X", "FP0, FP1", 0xF200, 0x0009|(0<<10)|(1<<7)); TEST("FTANH.X", "FP2", 0xF200, 0x0009|(2<<10)|(2<<7)); @@ -2877,15 +2890,16 @@ static void test_float_arithmetic() { TEST("FTANH.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4009|(2<<10)|(3<<7), 0x1230); TEST("FTANH.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4009|(3<<10)|(5<<7), 0xC856); TEST("FTANH.L", "#$6789ABCD, FP6", 0xF200|074, 0x4009|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FTANH.S", "#7.88999976E-10, FP7",0xF200|074, 0x4009|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FTANH.X", "#-89000000032, FP0", 0xF200|074, 0x4009|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FTANH.P", "#9.12E+999, FP1", 0xF200|074, 0x4009|(3<<10)|(1<<7), - 0x0999, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FTANH.W", "#$1234, FP2", 0xF200|074, 0x4009|(4<<10)|(2<<7), 0x1234); - TEST("FTANH.D", "#-8.25, FP3", 0xF200|074, 0x4009|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FTANH.B", "#$23, FP4", 0xF200|074, 0x4009|(6<<10)|(4<<7), 0x0023); + TFLT("FTANH.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4009|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FTANH.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4009|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FTANH.P", "#9.12E+999, FP1", "#$099900091200000000000000, FP1", + 0xF200|074, 0x4009|(3<<10)|(1<<7), 0x0999, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FTANH.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4009|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FATAN.X", "FP0, FP1", 0xF200, 0x000A|(0<<10)|(1<<7)); TEST("FATAN.X", "FP2", 0xF200, 0x000A|(2<<10)|(2<<7)); @@ -2911,15 +2925,16 @@ static void test_float_arithmetic() { TEST("FATAN.X", "(*+$1234,PC), FP3", 0xF200|072, 0x400A|(2<<10)|(3<<7), 0x1230); TEST("FATAN.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x400A|(3<<10)|(5<<7), 0xC856); TEST("FATAN.L", "#$6789ABCD, FP6", 0xF200|074, 0x400A|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FATAN.S", "#7.88999976E-10, FP7",0xF200|074, 0x400A|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FATAN.X", "#-89000000032, FP0", 0xF200|074, 0x400A|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FATAN.P", "#9.12E-999, FP1", 0xF200|074, 0x400A|(3<<10)|(1<<7), - 0x4999, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FATAN.W", "#$1234, FP2", 0xF200|074, 0x400A|(4<<10)|(2<<7), 0x1234); - TEST("FATAN.D", "#-8.25, FP3", 0xF200|074, 0x400A|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FATAN.B", "#$23, FP4", 0xF200|074, 0x400A|(6<<10)|(4<<7), 0x0023); + TFLT("FATAN.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x400A|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FATAN.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x400A|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FATAN.P", "#9.12E-999, FP1", "#$499900091200000000000000, FP1", + 0xF200|074, 0x400A|(3<<10)|(1<<7), 0x4999, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FATAN.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x400A|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FASIN.X", "FP0, FP1", 0xF200, 0x000C|(0<<10)|(1<<7)); TEST("FASIN.X", "FP2", 0xF200, 0x000C|(2<<10)|(2<<7)); @@ -2945,15 +2960,16 @@ static void test_float_arithmetic() { TEST("FASIN.X", "(*+$1234,PC), FP3", 0xF200|072, 0x400C|(2<<10)|(3<<7), 0x1230); TEST("FASIN.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x400C|(3<<10)|(5<<7), 0xC856); TEST("FASIN.L", "#$6789ABCD, FP6", 0xF200|074, 0x400C|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FASIN.S", "#7.88999976E-10, FP7",0xF200|074, 0x400C|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FASIN.X", "#-89000000032, FP0", 0xF200|074, 0x400C|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FASIN.P", "#9.12E+20, FP1", 0xF200|074, 0x400C|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FASIN.W", "#$1234, FP2", 0xF200|074, 0x400C|(4<<10)|(2<<7), 0x1234); - TEST("FASIN.D", "#-8.25, FP3", 0xF200|074, 0x400C|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FASIN.B", "#$23, FP4", 0xF200|074, 0x400C|(6<<10)|(4<<7), 0x0023); + TFLT("FASIN.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x400C|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FASIN.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x400C|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FASIN.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x400C|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FASIN.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x400C|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FATANH.X", "FP0, FP1", 0xF200, 0x000D|(0<<10)|(1<<7)); TEST("FATANH.X", "FP2", 0xF200, 0x000D|(2<<10)|(2<<7)); @@ -2969,15 +2985,16 @@ static void test_float_arithmetic() { TEST("FATANH.X", "(*+$1234,PC), FP3", 0xF200|072, 0x400D|(2<<10)|(3<<7), 0x1230); TEST("FATANH.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x400D|(3<<10)|(5<<7), 0xC856); TEST("FATANH.L", "#$6789ABCD, FP6", 0xF200|074, 0x400D|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FATANH.S", "#7.88999976E-10, FP7",0xF200|074, 0x400D|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FATANH.X", "#-89000000032, FP0", 0xF200|074, 0x400D|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FATANH.P", "#9.12E+20, FP1", 0xF200|074, 0x400D|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FATANH.W", "#$1234, FP2", 0xF200|074, 0x400D|(4<<10)|(2<<7), 0x1234); - TEST("FATANH.D", "#-8.25, FP3", 0xF200|074, 0x400D|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FATANH.B", "#$23, FP4", 0xF200|074, 0x400D|(6<<10)|(4<<7), 0x0023); + TFLT("FATANH.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x400D|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FATANH.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x400D|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FATANH.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x400D|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FATANH.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x400D|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSIN.X", "FP0, FP1", 0xF200, 0x000E|(0<<10)|(1<<7)); TEST("FSIN.X", "FP2", 0xF200, 0x000E|(2<<10)|(2<<7)); @@ -3003,15 +3020,16 @@ static void test_float_arithmetic() { TEST("FSIN.X", "(*+$1234,PC), FP3", 0xF200|072, 0x400E|(2<<10)|(3<<7), 0x1230); TEST("FSIN.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x400E|(3<<10)|(5<<7), 0xC856); TEST("FSIN.L", "#$6789ABCD, FP6", 0xF200|074, 0x400E|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSIN.S", "#7.88999976E-10, FP7",0xF200|074, 0x400E|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSIN.X", "#-89000000032, FP0", 0xF200|074, 0x400E|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSIN.P", "#9.12E+20, FP1", 0xF200|074, 0x400E|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FSIN.W", "#$1234, FP2", 0xF200|074, 0x400E|(4<<10)|(2<<7), 0x1234); - TEST("FSIN.D", "#-8.25, FP3", 0xF200|074, 0x400E|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSIN.B", "#$23, FP4", 0xF200|074, 0x400E|(6<<10)|(4<<7), 0x0023); + TFLT("FSIN.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x400E|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FSIN.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x400E|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FSIN.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x400E|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FSIN.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x400E|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FTAN.X", "FP0, FP1", 0xF200, 0x000F|(0<<10)|(1<<7)); TEST("FTAN.X", "FP2", 0xF200, 0x000F|(2<<10)|(2<<7)); @@ -3037,15 +3055,16 @@ static void test_float_arithmetic() { TEST("FTAN.X", "(*+$1234,PC), FP3", 0xF200|072, 0x400F|(2<<10)|(3<<7), 0x1230); TEST("FTAN.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x400F|(3<<10)|(5<<7), 0xC856); TEST("FTAN.L", "#$6789ABCD, FP6", 0xF200|074, 0x400F|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FTAN.S", "#7.88999976E-10, FP7",0xF200|074, 0x400F|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FTAN.X", "#-89000000032, FP0", 0xF200|074, 0x400F|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FTAN.P", "#9.12E+20, FP1", 0xF200|074, 0x400F|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FTAN.W", "#$1234, FP2", 0xF200|074, 0x400F|(4<<10)|(2<<7), 0x1234); - TEST("FTAN.D", "#-8.25, FP3", 0xF200|074, 0x400F|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FTAN.B", "#$23, FP4", 0xF200|074, 0x400F|(6<<10)|(4<<7), 0x0023); + TFLT("FTAN.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x400F|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FTAN.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x400F|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FTAN.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x400F|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FTAN.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x400F|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FETOX.X", "FP0, FP1", 0xF200, 0x0010|(0<<10)|(1<<7)); TEST("FETOX.X", "FP2", 0xF200, 0x0010|(2<<10)|(2<<7)); @@ -3071,15 +3090,16 @@ static void test_float_arithmetic() { TEST("FETOX.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4010|(2<<10)|(3<<7), 0x1230); TEST("FETOX.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4010|(3<<10)|(5<<7), 0xC856); TEST("FETOX.L", "#$6789ABCD, FP6", 0xF200|074, 0x4010|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FETOX.S", "#7.88999976E-10, FP7",0xF200|074, 0x4010|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FETOX.X", "#-89000000032, FP0", 0xF200|074, 0x4010|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FETOX.P", "#9.12E+20, FP1", 0xF200|074, 0x4010|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FETOX.W", "#$1234, FP2", 0xF200|074, 0x4010|(4<<10)|(2<<7), 0x1234); - TEST("FETOX.D", "#-8.25, FP3", 0xF200|074, 0x4010|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FETOX.B", "#$23, FP4", 0xF200|074, 0x4010|(6<<10)|(4<<7), 0x0023); + TFLT("FETOX.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4010|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FETOX.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4010|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FETOX.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4010|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FETOX.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4010|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FTWOTOX.X", "FP0, FP1", 0xF200, 0x0011|(0<<10)|(1<<7)); TEST("FTWOTOX.X", "FP2", 0xF200, 0x0011|(2<<10)|(2<<7)); @@ -3105,15 +3125,16 @@ static void test_float_arithmetic() { TEST("FTWOTOX.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4011|(2<<10)|(3<<7), 0x1230); TEST("FTWOTOX.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4011|(3<<10)|(5<<7), 0xC856); TEST("FTWOTOX.L", "#$6789ABCD, FP6", 0xF200|074, 0x4011|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FTWOTOX.S", "#7.88999976E-10, FP7",0xF200|074, 0x4011|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FTWOTOX.X", "#-89000000032, FP0", 0xF200|074, 0x4011|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FTWOTOX.P", "#9.12E+20, FP1", 0xF200|074, 0x4011|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FTWOTOX.W", "#$1234, FP2", 0xF200|074, 0x4011|(4<<10)|(2<<7), 0x1234); - TEST("FTWOTOX.D", "#-8.25, FP3", 0xF200|074, 0x4011|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FTWOTOX.B", "#$23, FP4", 0xF200|074, 0x4011|(6<<10)|(4<<7), 0x0023); + TFLT("FTWOTOX.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4011|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FTWOTOX.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4011|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FTWOTOX.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4011|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FTWOTOX.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4011|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FTENTOX.X", "FP0, FP1", 0xF200, 0x0012|(0<<10)|(1<<7)); TEST("FTENTOX.X", "FP2", 0xF200, 0x0012|(2<<10)|(2<<7)); @@ -3139,15 +3160,16 @@ static void test_float_arithmetic() { TEST("FTENTOX.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4012|(2<<10)|(3<<7), 0x1230); TEST("FTENTOX.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4012|(3<<10)|(5<<7), 0xC856); TEST("FTENTOX.L", "#$6789ABCD, FP6", 0xF200|074, 0x4012|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FTENTOX.S", "#7.88999976E-10, FP7",0xF200|074, 0x4012|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FTENTOX.X", "#-89000000032, FP0", 0xF200|074, 0x4012|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FTENTOX.P", "#9.12E+20, FP1", 0xF200|074, 0x4012|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FTENTOX.W", "#$1234, FP2", 0xF200|074, 0x4012|(4<<10)|(2<<7), 0x1234); - TEST("FTENTOX.D", "#-8.25, FP3", 0xF200|074, 0x4012|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FTENTOX.B", "#$23, FP4", 0xF200|074, 0x4012|(6<<10)|(4<<7), 0x0023); + TFLT("FTENTOX.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4012|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FTENTOX.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4012|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FTENTOX.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4012|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FTENTOX.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4012|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FLOGN.X", "FP0, FP1", 0xF200, 0x0014|(0<<10)|(1<<7)); TEST("FLOGN.X", "FP2", 0xF200, 0x0014|(2<<10)|(2<<7)); @@ -3173,15 +3195,16 @@ static void test_float_arithmetic() { TEST("FLOGN.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4014|(2<<10)|(3<<7), 0x1230); TEST("FLOGN.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4014|(3<<10)|(5<<7), 0xC856); TEST("FLOGN.L", "#$6789ABCD, FP6", 0xF200|074, 0x4014|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FLOGN.S", "#7.88999976E-10, FP7",0xF200|074, 0x4014|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FLOGN.X", "#-89000000032, FP0", 0xF200|074, 0x4014|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FLOGN.P", "#9.12E+20, FP1", 0xF200|074, 0x4014|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FLOGN.W", "#$1234, FP2", 0xF200|074, 0x4014|(4<<10)|(2<<7), 0x1234); - TEST("FLOGN.D", "#-8.25, FP3", 0xF200|074, 0x4014|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FLOGN.B", "#$23, FP4", 0xF200|074, 0x4014|(6<<10)|(4<<7), 0x0023); + TFLT("FLOGN.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4014|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FLOGN.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4014|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FLOGN.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4014|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FLOGN.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4014|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FLOG10.X", "FP0, FP1", 0xF200, 0x0015|(0<<10)|(1<<7)); TEST("FLOG10.X", "FP2", 0xF200, 0x0015|(2<<10)|(2<<7)); @@ -3207,15 +3230,16 @@ static void test_float_arithmetic() { TEST("FLOG10.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4015|(2<<10)|(3<<7), 0x1230); TEST("FLOG10.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4015|(3<<10)|(5<<7), 0xC856); TEST("FLOG10.L", "#$6789ABCD, FP6", 0xF200|074, 0x4015|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FLOG10.S", "#7.88999976E-10, FP7",0xF200|074, 0x4015|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FLOG10.X", "#-89000000032, FP0", 0xF200|074, 0x4015|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FLOG10.P", "#9.12E+20, FP1", 0xF200|074, 0x4015|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FLOG10.W", "#$1234, FP2", 0xF200|074, 0x4015|(4<<10)|(2<<7), 0x1234); - TEST("FLOG10.D", "#-8.25, FP3", 0xF200|074, 0x4015|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FLOG10.B", "#$23, FP4", 0xF200|074, 0x4015|(6<<10)|(4<<7), 0x0023); + TFLT("FLOG10.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4015|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FLOG10.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4015|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FLOG10.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4015|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FLOG10.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4015|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FLOG2.X", "FP0, FP1", 0xF200, 0x0016|(0<<10)|(1<<7)); TEST("FLOG2.X", "FP2", 0xF200, 0x0016|(2<<10)|(2<<7)); @@ -3241,15 +3265,16 @@ static void test_float_arithmetic() { TEST("FLOG2.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4016|(2<<10)|(3<<7), 0x1230); TEST("FLOG2.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4016|(3<<10)|(5<<7), 0xC856); TEST("FLOG2.L", "#$6789ABCD, FP6", 0xF200|074, 0x4016|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FLOG2.S", "#7.88999976E-10, FP7",0xF200|074, 0x4016|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FLOG2.X", "#-89000000032, FP0", 0xF200|074, 0x4016|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FLOG2.P", "#9.12E+20, FP1", 0xF200|074, 0x4016|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FLOG2.W", "#$1234, FP2", 0xF200|074, 0x4016|(4<<10)|(2<<7), 0x1234); - TEST("FLOG2.D", "#-8.25, FP3", 0xF200|074, 0x4016|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FLOG2.B", "#$23, FP4", 0xF200|074, 0x4016|(6<<10)|(4<<7), 0x0023); + TFLT("FLOG2.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4016|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FLOG2.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4016|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FLOG2.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4016|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FLOG2.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4016|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FABS.X", "FP0, FP1", 0xF200, 0x0018|(0<<10)|(1<<7)); TEST("FABS.X", "FP2", 0xF200, 0x0018|(2<<10)|(2<<7)); @@ -3275,15 +3300,16 @@ static void test_float_arithmetic() { TEST("FABS.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4018|(2<<10)|(3<<7), 0x1230); TEST("FABS.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4018|(3<<10)|(5<<7), 0xC856); TEST("FABS.L", "#$6789ABCD, FP6", 0xF200|074, 0x4018|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FABS.S", "#7.88999976E-10, FP7",0xF200|074, 0x4018|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FABS.X", "#-89000000032, FP0", 0xF200|074, 0x4018|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FABS.P", "#9.12E+20, FP1", 0xF200|074, 0x4018|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FABS.W", "#$1234, FP2", 0xF200|074, 0x4018|(4<<10)|(2<<7), 0x1234); - TEST("FABS.D", "#-8.25, FP3", 0xF200|074, 0x4018|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FABS.B", "#$23, FP4", 0xF200|074, 0x4018|(6<<10)|(4<<7), 0x0023); + TFLT("FABS.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4018|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FABS.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4018|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FABS.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4018|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FABS.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4018|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FCOSH.X", "FP0, FP1", 0xF200, 0x0019|(0<<10)|(1<<7)); TEST("FCOSH.X", "FP2", 0xF200, 0x0019|(2<<10)|(2<<7)); @@ -3309,15 +3335,16 @@ static void test_float_arithmetic() { TEST("FCOSH.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4019|(2<<10)|(3<<7), 0x1230); TEST("FCOSH.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4019|(3<<10)|(5<<7), 0xC856); TEST("FCOSH.L", "#$6789ABCD, FP6", 0xF200|074, 0x4019|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FCOSH.S", "#7.88999976E-10, FP7",0xF200|074, 0x4019|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FCOSH.X", "#-89000000032, FP0", 0xF200|074, 0x4019|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FCOSH.P", "#9.12E+20, FP1", 0xF200|074, 0x4019|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FCOSH.W", "#$1234, FP2", 0xF200|074, 0x4019|(4<<10)|(2<<7), 0x1234); - TEST("FCOSH.D", "#-8.25, FP3", 0xF200|074, 0x4019|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FCOSH.B", "#$23, FP4", 0xF200|074, 0x4019|(6<<10)|(4<<7), 0x0023); + TFLT("FCOSH.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4019|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FCOSH.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4019|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FCOSH.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4019|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FCOSH.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4019|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FNEG.X", "FP0, FP1", 0xF200, 0x001A|(0<<10)|(1<<7)); TEST("FNEG.X", "FP2", 0xF200, 0x001A|(2<<10)|(2<<7)); @@ -3343,15 +3370,16 @@ static void test_float_arithmetic() { TEST("FNEG.X", "(*+$1234,PC), FP3", 0xF200|072, 0x401A|(2<<10)|(3<<7), 0x1230); TEST("FNEG.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x401A|(3<<10)|(5<<7), 0xC856); TEST("FNEG.L", "#$6789ABCD, FP6", 0xF200|074, 0x401A|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FNEG.S", "#7.88999976E-10, FP7",0xF200|074, 0x401A|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FNEG.X", "#-89000000032, FP0", 0xF200|074, 0x401A|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FNEG.P", "#9.12E+20, FP1", 0xF200|074, 0x401A|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FNEG.W", "#$1234, FP2", 0xF200|074, 0x401A|(4<<10)|(2<<7), 0x1234); - TEST("FNEG.D", "#-8.25, FP3", 0xF200|074, 0x401A|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FNEG.B", "#$23, FP4", 0xF200|074, 0x401A|(6<<10)|(4<<7), 0x0023); + TFLT("FNEG.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x401A|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FNEG.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x401A|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FNEG.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x401A|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FNEG.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x401A|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FACOS.X", "FP0, FP1", 0xF200, 0x001C|(0<<10)|(1<<7)); TEST("FACOS.X", "FP2", 0xF200, 0x001C|(2<<10)|(2<<7)); @@ -3377,15 +3405,16 @@ static void test_float_arithmetic() { TEST("FACOS.X", "(*+$1234,PC), FP3", 0xF200|072, 0x401C|(2<<10)|(3<<7), 0x1230); TEST("FACOS.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x401C|(3<<10)|(5<<7), 0xC856); TEST("FACOS.L", "#$6789ABCD, FP6", 0xF200|074, 0x401C|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FACOS.S", "#7.88999976E-10, FP7",0xF200|074, 0x401C|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FACOS.X", "#-89000000032, FP0", 0xF200|074, 0x401C|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FACOS.P", "#9.12E+20, FP1", 0xF200|074, 0x401C|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FACOS.W", "#$1234, FP2", 0xF200|074, 0x401C|(4<<10)|(2<<7), 0x1234); - TEST("FACOS.D", "#-8.25, FP3", 0xF200|074, 0x401C|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FACOS.B", "#$23, FP4", 0xF200|074, 0x401C|(6<<10)|(4<<7), 0x0023); + TFLT("FACOS.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x401C|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FACOS.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x401C|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FACOS.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x401C|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FACOS.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x401C|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FCOS.X", "FP0, FP1", 0xF200, 0x001D|(0<<10)|(1<<7)); TEST("FCOS.X", "FP2", 0xF200, 0x001D|(2<<10)|(2<<7)); @@ -3411,15 +3440,16 @@ static void test_float_arithmetic() { TEST("FCOS.X", "(*+$1234,PC), FP3", 0xF200|072, 0x401D|(2<<10)|(3<<7), 0x1230); TEST("FCOS.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x401D|(3<<10)|(5<<7), 0xC856); TEST("FCOS.L", "#$6789ABCD, FP6", 0xF200|074, 0x401D|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FCOS.S", "#7.88999976E-10, FP7",0xF200|074, 0x401D|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FCOS.X", "#-89000000032, FP0", 0xF200|074, 0x401D|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FCOS.P", "#9.12E+20, FP1", 0xF200|074, 0x401D|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FCOS.W", "#$1234, FP2", 0xF200|074, 0x401D|(4<<10)|(2<<7), 0x1234); - TEST("FCOS.D", "#-8.25, FP3", 0xF200|074, 0x401D|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FCOS.B", "#$23, FP4", 0xF200|074, 0x401D|(6<<10)|(4<<7), 0x0023); + TFLT("FCOS.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x401D|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FCOS.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x401D|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FCOS.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x401D|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FCOS.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x401D|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FGETEXP.X", "FP0, FP1", 0xF200, 0x001E|(0<<10)|(1<<7)); TEST("FGETEXP.X", "FP2", 0xF200, 0x001E|(2<<10)|(2<<7)); @@ -3445,15 +3475,16 @@ static void test_float_arithmetic() { TEST("FGETEXP.X", "(*+$1234,PC), FP3", 0xF200|072, 0x401E|(2<<10)|(3<<7), 0x1230); TEST("FGETEXP.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x401E|(3<<10)|(5<<7), 0xC856); TEST("FGETEXP.L", "#$6789ABCD, FP6", 0xF200|074, 0x401E|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FGETEXP.S", "#7.88999976E-10, FP7",0xF200|074, 0x401E|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FGETEXP.X", "#-89000000032, FP0", 0xF200|074, 0x401E|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FGETEXP.P", "#9.12E+20, FP1", 0xF200|074, 0x401E|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FGETEXP.W", "#$1234, FP2", 0xF200|074, 0x401E|(4<<10)|(2<<7), 0x1234); - TEST("FGETEXP.D", "#-8.25, FP3", 0xF200|074, 0x401E|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FGETEXP.B", "#$23, FP4", 0xF200|074, 0x401E|(6<<10)|(4<<7), 0x0023); + TFLT("FGETEXP.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x401E|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FGETEXP.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x401E|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FGETEXP.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x401E|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FGETEXP.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x401E|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FGETMAN.X", "FP0, FP1", 0xF200, 0x001F|(0<<10)|(1<<7)); TEST("FGETMAN.X", "FP2", 0xF200, 0x001F|(2<<10)|(2<<7)); @@ -3479,15 +3510,16 @@ static void test_float_arithmetic() { TEST("FGETMAN.X", "(*+$1234,PC), FP3", 0xF200|072, 0x401F|(2<<10)|(3<<7), 0x1230); TEST("FGETMAN.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x401F|(3<<10)|(5<<7), 0xC856); TEST("FGETMAN.L", "#$6789ABCD, FP6", 0xF200|074, 0x401F|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FGETMAN.S", "#7.88999976E-10, FP7",0xF200|074, 0x401F|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FGETMAN.X", "#-89000000032, FP0", 0xF200|074, 0x401F|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FGETMAN.P", "#9.12E+20, FP1", 0xF200|074, 0x401F|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FGETMAN.W", "#$1234, FP2", 0xF200|074, 0x401F|(4<<10)|(2<<7), 0x1234); - TEST("FGETMAN.D", "#-8.25, FP3", 0xF200|074, 0x401F|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FGETMAN.B", "#$23, FP4", 0xF200|074, 0x401F|(6<<10)|(4<<7), 0x0023); + TFLT("FGETMAN.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x401F|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FGETMAN.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x401F|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FGETMAN.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x401F|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FGETMAN.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x401F|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FDIV.X", "FP0, FP1", 0xF200, 0x0020|(0<<10)|(1<<7)); TEST("FDIV.X", "FP2, FP2", 0xF200, 0x0020|(2<<10)|(2<<7)); @@ -3513,15 +3545,16 @@ static void test_float_arithmetic() { TEST("FDIV.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4020|(2<<10)|(3<<7), 0x1230); TEST("FDIV.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4020|(3<<10)|(5<<7), 0xC856); TEST("FDIV.L", "#$6789ABCD, FP6", 0xF200|074, 0x4020|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FDIV.S", "#7.88999976E-10, FP7",0xF200|074, 0x4020|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FDIV.X", "#-89000000032, FP0", 0xF200|074, 0x4020|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FDIV.P", "#9.12E+20, FP1", 0xF200|074, 0x4020|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FDIV.W", "#$1234, FP2", 0xF200|074, 0x4020|(4<<10)|(2<<7), 0x1234); - TEST("FDIV.D", "#-8.25, FP3", 0xF200|074, 0x4020|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FDIV.B", "#$23, FP4", 0xF200|074, 0x4020|(6<<10)|(4<<7), 0x0023); + TFLT("FDIV.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4020|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FDIV.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4020|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FDIV.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4020|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FDIV.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4020|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FMOD.X", "FP0, FP1", 0xF200, 0x0021|(0<<10)|(1<<7)); TEST("FMOD.X", "FP2, FP2", 0xF200, 0x0021|(2<<10)|(2<<7)); @@ -3547,15 +3580,16 @@ static void test_float_arithmetic() { TEST("FMOD.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4021|(2<<10)|(3<<7), 0x1230); TEST("FMOD.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4021|(3<<10)|(5<<7), 0xC856); TEST("FMOD.L", "#$6789ABCD, FP6", 0xF200|074, 0x4021|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FMOD.S", "#7.88999976E-10, FP7",0xF200|074, 0x4021|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FMOD.X", "#-89000000032, FP0", 0xF200|074, 0x4021|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FMOD.P", "#9.12E+20, FP1", 0xF200|074, 0x4021|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FMOD.W", "#$1234, FP2", 0xF200|074, 0x4021|(4<<10)|(2<<7), 0x1234); - TEST("FMOD.D", "#-8.25, FP3", 0xF200|074, 0x4021|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FMOD.B", "#$23, FP4", 0xF200|074, 0x4021|(6<<10)|(4<<7), 0x0023); + TFLT("FMOD.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4021|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FMOD.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4021|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FMOD.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4021|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FMOD.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4021|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FADD.X", "FP0, FP1", 0xF200, 0x0022|(0<<10)|(1<<7)); TEST("FADD.X", "FP2, FP2", 0xF200, 0x0022|(2<<10)|(2<<7)); @@ -3581,15 +3615,16 @@ static void test_float_arithmetic() { TEST("FADD.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4022|(2<<10)|(3<<7), 0x1230); TEST("FADD.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4022|(3<<10)|(5<<7), 0xC856); TEST("FADD.L", "#$6789ABCD, FP6", 0xF200|074, 0x4022|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FADD.S", "#7.88999976E-10, FP7",0xF200|074, 0x4022|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FADD.X", "#-89000000032, FP0", 0xF200|074, 0x4022|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FADD.P", "#9.12E+20, FP1", 0xF200|074, 0x4022|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FADD.W", "#$1234, FP2", 0xF200|074, 0x4022|(4<<10)|(2<<7), 0x1234); - TEST("FADD.D", "#-8.25, FP3", 0xF200|074, 0x4022|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FADD.B", "#$23, FP4", 0xF200|074, 0x4022|(6<<10)|(4<<7), 0x0023); + TFLT("FADD.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4022|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FADD.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4022|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FADD.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4022|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FADD.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4022|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FMUL.X", "FP0, FP1", 0xF200, 0x0023|(0<<10)|(1<<7)); TEST("FMUL.X", "FP2, FP2", 0xF200, 0x0023|(2<<10)|(2<<7)); @@ -3615,15 +3650,16 @@ static void test_float_arithmetic() { TEST("FMUL.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4023|(2<<10)|(3<<7), 0x1230); TEST("FMUL.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4023|(3<<10)|(5<<7), 0xC856); TEST("FMUL.L", "#$6789ABCD, FP6", 0xF200|074, 0x4023|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FMUL.S", "#7.88999976E-10, FP7",0xF200|074, 0x4023|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FMUL.X", "#-89000000032, FP0", 0xF200|074, 0x4023|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FMUL.P", "#9.12E+20, FP1", 0xF200|074, 0x4023|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FMUL.W", "#$1234, FP2", 0xF200|074, 0x4023|(4<<10)|(2<<7), 0x1234); - TEST("FMUL.D", "#-8.25, FP3", 0xF200|074, 0x4023|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FMUL.B", "#$23, FP4", 0xF200|074, 0x4023|(6<<10)|(4<<7), 0x0023); + TFLT("FMUL.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4023|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FMUL.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4023|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FMUL.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4023|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FMUL.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4023|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSGLDIV.X", "FP0, FP1", 0xF200, 0x0024|(0<<10)|(1<<7)); TEST("FSGLDIV.X", "FP2, FP2", 0xF200, 0x0024|(2<<10)|(2<<7)); @@ -3649,15 +3685,16 @@ static void test_float_arithmetic() { TEST("FSGLDIV.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4024|(2<<10)|(3<<7), 0x1230); TEST("FSGLDIV.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4024|(3<<10)|(5<<7), 0xC856); TEST("FSGLDIV.L", "#$6789ABCD, FP6", 0xF200|074, 0x4024|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSGLDIV.S", "#7.88999976E-10, FP7",0xF200|074, 0x4024|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSGLDIV.X", "#-89000000032, FP0", 0xF200|074, 0x4024|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSGLDIV.P", "#9.12E+20, FP1", 0xF200|074, 0x4024|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FSGLDIV.W", "#$1234, FP2", 0xF200|074, 0x4024|(4<<10)|(2<<7), 0x1234); - TEST("FSGLDIV.D", "#-8.25, FP3", 0xF200|074, 0x4024|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSGLDIV.B", "#$23, FP4", 0xF200|074, 0x4024|(6<<10)|(4<<7), 0x0023); + TFLT("FSGLDIV.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4024|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FSGLDIV.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4024|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FSGLDIV.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4024|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FSGLDIV.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4024|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FREM.X", "FP0, FP1", 0xF200, 0x0025|(0<<10)|(1<<7)); TEST("FREM.X", "FP2, FP2", 0xF200, 0x0025|(2<<10)|(2<<7)); @@ -3683,15 +3720,16 @@ static void test_float_arithmetic() { TEST("FREM.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4025|(2<<10)|(3<<7), 0x1230); TEST("FREM.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4025|(3<<10)|(5<<7), 0xC856); TEST("FREM.L", "#$6789ABCD, FP6", 0xF200|074, 0x4025|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FREM.S", "#7.88999976E-10, FP7",0xF200|074, 0x4025|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FREM.X", "#-89000000032, FP0", 0xF200|074, 0x4025|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FREM.P", "#9.12E+20, FP1", 0xF200|074, 0x4025|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FREM.W", "#$1234, FP2", 0xF200|074, 0x4025|(4<<10)|(2<<7), 0x1234); - TEST("FREM.D", "#-8.25, FP3", 0xF200|074, 0x4025|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FREM.B", "#$23, FP4", 0xF200|074, 0x4025|(6<<10)|(4<<7), 0x0023); + TFLT("FREM.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4025|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FREM.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4025|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FREM.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4025|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FREM.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4025|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSCALE.X", "FP0, FP1", 0xF200, 0x0026|(0<<10)|(1<<7)); TEST("FSCALE.X", "FP2, FP2", 0xF200, 0x0026|(2<<10)|(2<<7)); @@ -3717,15 +3755,16 @@ static void test_float_arithmetic() { TEST("FSCALE.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4026|(2<<10)|(3<<7), 0x1230); TEST("FSCALE.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4026|(3<<10)|(5<<7), 0xC856); TEST("FSCALE.L", "#$6789ABCD, FP6", 0xF200|074, 0x4026|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSCALE.S", "#7.88999976E-10, FP7",0xF200|074, 0x4026|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSCALE.X", "#-89000000032, FP0", 0xF200|074, 0x4026|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSCALE.P", "#9.12E+20, FP1", 0xF200|074, 0x4026|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FSCALE.W", "#$1234, FP2", 0xF200|074, 0x4026|(4<<10)|(2<<7), 0x1234); - TEST("FSCALE.D", "#-8.25, FP3", 0xF200|074, 0x4026|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSCALE.B", "#$23, FP4", 0xF200|074, 0x4026|(6<<10)|(4<<7), 0x0023); + TFLT("FSCALE.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4026|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FSCALE.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4026|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FSCALE.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4026|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FSCALE.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4026|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSGLMUL.X", "FP0, FP1", 0xF200, 0x0027|(0<<10)|(1<<7)); TEST("FSGLMUL.X", "FP2, FP2", 0xF200, 0x0027|(2<<10)|(2<<7)); @@ -3751,15 +3790,16 @@ static void test_float_arithmetic() { TEST("FSGLMUL.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4027|(2<<10)|(3<<7), 0x1230); TEST("FSGLMUL.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4027|(3<<10)|(5<<7), 0xC856); TEST("FSGLMUL.L", "#$6789ABCD, FP6", 0xF200|074, 0x4027|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSGLMUL.S", "#7.88999976E-10, FP7",0xF200|074, 0x4027|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSGLMUL.X", "#-89000000032, FP0", 0xF200|074, 0x4027|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSGLMUL.P", "#9.12E+20, FP1", 0xF200|074, 0x4027|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FSGLMUL.W", "#$1234, FP2", 0xF200|074, 0x4027|(4<<10)|(2<<7), 0x1234); - TEST("FSGLMUL.D", "#-8.25, FP3", 0xF200|074, 0x4027|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSGLMUL.B", "#$23, FP4", 0xF200|074, 0x4027|(6<<10)|(4<<7), 0x0023); + TFLT("FSGLMUL.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4027|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FSGLMUL.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4027|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FSGLMUL.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4027|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FSGLMUL.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4027|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSUB.X", "FP0, FP1", 0xF200, 0x0028|(0<<10)|(1<<7)); TEST("FSUB.X", "FP2, FP2", 0xF200, 0x0028|(2<<10)|(2<<7)); @@ -3785,15 +3825,16 @@ static void test_float_arithmetic() { TEST("FSUB.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4028|(2<<10)|(3<<7), 0x1230); TEST("FSUB.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4028|(3<<10)|(5<<7), 0xC856); TEST("FSUB.L", "#$6789ABCD, FP6", 0xF200|074, 0x4028|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSUB.S", "#7.88999976E-10, FP7",0xF200|074, 0x4028|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSUB.X", "#-89000000032, FP0", 0xF200|074, 0x4028|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSUB.P", "#9.12E+20, FP1", 0xF200|074, 0x4028|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FSUB.W", "#$1234, FP2", 0xF200|074, 0x4028|(4<<10)|(2<<7), 0x1234); - TEST("FSUB.D", "#-8.25, FP3", 0xF200|074, 0x4028|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSUB.B", "#$23, FP4", 0xF200|074, 0x4028|(6<<10)|(4<<7), 0x0023); + TFLT("FSUB.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4028|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FSUB.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4028|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FSUB.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4028|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FSUB.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4028|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSINCOS.X", "FP0, FP2:FP1", 0xF200, 0x0032|(0<<10)|(1<<7)); TEST("FSINCOS.X", "FP1, FP1:FP1", 0xF200, 0x0031|(1<<10)|(1<<7)); @@ -3819,15 +3860,16 @@ static void test_float_arithmetic() { TEST("FSINCOS.X", "(*+$1234,PC), FP0:FP3", 0xF200|072, 0x4030|(2<<10)|(3<<7), 0x1230); TEST("FSINCOS.P", "(*+90,PC,A4.L), FP7:FP5", 0xF200|073, 0x4037|(3<<10)|(5<<7), 0xC856); TEST("FSINCOS.L", "#$6789ABCD, FP5:FP6", 0xF200|074, 0x4035|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FSINCOS.S", "#7.88999976E-10, FP6:FP7",0xF200|074, 0x4036|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FSINCOS.X", "#-89000000032, FP4:FP0", 0xF200|074, 0x4034|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FSINCOS.P", "#9.12E+20, FP3:FP1", 0xF200|074, 0x4033|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FSINCOS.W", "#$1234, FP1:FP2", 0xF200|074, 0x4031|(4<<10)|(2<<7), 0x1234); - TEST("FSINCOS.D", "#-8.25, FP0:FP3", 0xF200|074, 0x4030|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FSINCOS.B", "#$23, FP7:FP4", 0xF200|074, 0x4037|(6<<10)|(4<<7), 0x0023); + TFLT("FSINCOS.S", "#7.88999976E-10, FP6:FP7", "#$3058E0F0, FP6:FP7", + 0xF200|074, 0x4036|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FSINCOS.X", "#-89000000032, FP4:FP0", "#$C0230000A5C681D100000000, FP4:FP0", + 0xF200|074, 0x4034|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FSINCOS.P", "#9.12E+20, FP3:FP1", "#$002000091200000000000000, FP3:FP1", + 0xF200|074, 0x4033|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FSINCOS.D", "#-8.25, FP0:FP3", "#$C020800000000000, FP0:FP3", + 0xF200|074, 0x4030|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FCMP.X", "FP0, FP1", 0xF200, 0x0038|(0<<10)|(1<<7)); TEST("FCMP.X", "FP2, FP2", 0xF200, 0x0038|(2<<10)|(2<<7)); @@ -3853,15 +3895,16 @@ static void test_float_arithmetic() { TEST("FCMP.X", "(*+$1234,PC), FP3", 0xF200|072, 0x4038|(2<<10)|(3<<7), 0x1230); TEST("FCMP.P", "(*+90,PC,A4.L), FP5", 0xF200|073, 0x4038|(3<<10)|(5<<7), 0xC856); TEST("FCMP.L", "#$6789ABCD, FP6", 0xF200|074, 0x4038|(0<<10)|(6<<7), 0x6789, 0xABCD); - TEST("FCMP.S", "#7.88999976E-10, FP7",0xF200|074, 0x4038|(1<<10)|(7<<7), 0x3058, 0xE0F0); - TEST("FCMP.X", "#-89000000032, FP0", 0xF200|074, 0x4038|(2<<10)|(0<<7), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FCMP.P", "#9.12E+20, FP1", 0xF200|074, 0x4038|(3<<10)|(1<<7), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FCMP.W", "#$1234, FP2", 0xF200|074, 0x4038|(4<<10)|(2<<7), 0x1234); - TEST("FCMP.D", "#-8.25, FP3", 0xF200|074, 0x4038|(5<<10)|(3<<7), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FCMP.B", "#$23, FP4", 0xF200|074, 0x4038|(6<<10)|(4<<7), 0x0023); + TFLT("FCMP.S", "#7.88999976E-10, FP7", "#$3058E0F0, FP7", + 0xF200|074, 0x4038|(1<<10)|(7<<7), 0x3058, 0xE0F0); + TFLT("FCMP.X", "#-89000000032, FP0", "#$C0230000A5C681D100000000, FP0", + 0xF200|074, 0x4038|(2<<10)|(0<<7), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FCMP.P", "#9.12E+20, FP1", "#$002000091200000000000000, FP1", + 0xF200|074, 0x4038|(3<<10)|(1<<7), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FCMP.D", "#-8.25, FP3", "#$C020800000000000, FP3", + 0xF200|074, 0x4038|(5<<10)|(3<<7), 0xC020, 0x8000, 0x0000, 0x0000); TEST("FTST.X", "FP0", 0xF200, 0x003A|(0<<10)); TEST("FTST.L", "D2", 0xF200|002, 0x403A|(0<<10)); @@ -3886,15 +3929,16 @@ static void test_float_arithmetic() { TEST("FTST.X", "(*+$1234,PC)", 0xF200|072, 0x403A|(2<<10), 0x1230); TEST("FTST.P", "(*+90,PC,A4.L)", 0xF200|073, 0x403A|(3<<10), 0xC856); TEST("FTST.L", "#$6789ABCD", 0xF200|074, 0x403A|(0<<10), 0x6789, 0xABCD); - TEST("FTST.S", "#7.88999976E-10",0xF200|074, 0x403A|(1<<10), 0x3058, 0xE0F0); - TEST("FTST.X", "#-89000000032", 0xF200|074, 0x403A|(2<<10), - 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); - TEST("FTST.P", "#9.12E+20", 0xF200|074, 0x403A|(3<<10), - 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); TEST("FTST.W", "#$1234", 0xF200|074, 0x403A|(4<<10), 0x1234); - TEST("FTST.D", "#-8.25", 0xF200|074, 0x403A|(5<<10), - 0xC020, 0x8000, 0x0000, 0x0000); TEST("FTST.B", "#$23", 0xF200|074, 0x403A|(6<<10), 0x0023); + TFLT("FTST.S", "#7.88999976E-10", "#$3058E0F0", + 0xF200|074, 0x403A|(1<<10), 0x3058, 0xE0F0); + TFLT("FTST.X", "#-89000000032", "#$C0230000A5C681D100000000", + 0xF200|074, 0x403A|(2<<10), 0xC023, 0x0000, 0xA5C6, 0x81D1, 0x0000, 0x0000); + TFLT("FTST.P", "#9.12E+20", "#$002000091200000000000000", + 0xF200|074, 0x403A|(3<<10), 0x0020, 0x0009, 0x1200, 0x0000, 0x0000, 0x0000); + TFLT("FTST.D", "#-8.25", "#$C020800000000000", + 0xF200|074, 0x403A|(5<<10), 0xC020, 0x8000, 0x0000, 0x0000); } static void test_float_branch() { @@ -4431,7 +4475,7 @@ void run_tests(const char *cpu) { RUN_TEST(test_program); RUN_TEST(test_system); RUN_TEST(test_multiproc); -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_MC68000_NOFPU) +#if !defined(LIBASM_MC68000_NOFPU) RUN_TEST(test_float_move); RUN_TEST(test_float_arithmetic); RUN_TEST(test_float_branch); diff --git a/test/test_dis_ns32000.cpp b/test/test_dis_ns32000.cpp index cfbbb18f..6728cb60 100644 --- a/test/test_dis_ns32000.cpp +++ b/test/test_dis_ns32000.cpp @@ -25,6 +25,14 @@ using namespace libasm::test; DisNs32000 dis32k; Disassembler &disassembler(dis32k); +#if defined(LIBASM_DIS_NOFLOAT) +#define TFLT(insn, opr, hex, ...) ERRT(insn, hex, FLOAT_NOT_SUPPORTED, hex, __VA_ARGS__) +#define EFLT(insn, opr, error, at, hex, ...) ERRT(insn, hex, FLOAT_NOT_SUPPORTED, hex, __VA_ARGS__) +#else +#define TFLT(insn, opr, hex, ...) TEST(insn, opr, __VA_ARGS__) +#define EFLT(insn, opr, error, at, hex, ...) ERRT(insn, opr, error, at, __VA_ARGS__) +#endif + static void set_up() { disassembler.reset(); disassembler.setOption("relative", "enable"); @@ -485,21 +493,26 @@ static void test_format_8() { ERRT("INSD", "R0, R2, 0(R1), 33", OVERFLOW_RANGE, "33", 0xAE, 0x43, 0x12, 0x00, 0x21); } -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) static void test_format_9_fpu() { TEST("MOVF", "F1, 8(SB)", 0xBE, 0x85, 0x0E, 0x08); TEST("MOVL", "F2, 8(SB)", 0xBE, 0x84, 0x16, 0x08); - TEST("MOVF", "NAN, F1", 0xBE, 0x45, 0xA0, 0x7F, 0xC0, 0x00, 0x00); - TEST("MOVF", "INF, F2", 0xBE, 0x85, 0xA0, 0x7F, 0x80, 0x00, 0x00); - TEST("MOVF", "-INF, F2", 0xBE, 0x85, 0xA0, 0xFF, 0x80, 0x00, 0x00); - TEST("MOVF", "0, F3", 0xBE, 0xC5, 0xA0, 0x00, 0x00, 0x00, 0x00); - TEST("MOVF", "-0, F3", 0xBE, 0xC5, 0xA0, 0x80, 0x00, 0x00, 0x00); - TEST("MOVL", "NAN, F0", 0xBE, 0x04, 0xA0, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL", "INF, F2", 0xBE, 0x84, 0xA0, 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL", "-INF, F2", 0xBE, 0x84, 0xA0, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL", "0, F4", 0xBE, 0x04, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); - TEST("MOVL", "-0, F4", 0xBE, 0x04, 0xA1, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + TFLT("MOVF", "NAN, F1", "0x0000C07F, F1", 0xBE, 0x45, 0xA0, 0x7F, 0xC0, 0x00, 0x00); + TFLT("MOVF", "INF, F2", "0x0000807F, F2", 0xBE, 0x85, 0xA0, 0x7F, 0x80, 0x00, 0x00); + TFLT("MOVF", "-INF, F2", "0x000080FF, F2", 0xBE, 0x85, 0xA0, 0xFF, 0x80, 0x00, 0x00); + TFLT("MOVF", "0, F3", "0x00000000, F3", 0xBE, 0xC5, 0xA0, 0x00, 0x00, 0x00, 0x00); + TFLT("MOVF", "-0, F3", "0x00000080, F3", 0xBE, 0xC5, 0xA0, 0x80, 0x00, 0x00, 0x00); + TFLT("MOVL", "NAN, F0", "0x000000000000F87F, F0", + 0xBE, 0x04, 0xA0, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + TFLT("MOVL", "INF, F2", "0x000000000000F07F, F2", + 0xBE, 0x84, 0xA0, 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + TFLT("MOVL", "-INF, F2", "0x000000000000F0FF, F2", + 0xBE, 0x84, 0xA0, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + TFLT("MOVL", "0, F4", "0x0000000000000000, F4", + 0xBE, 0x04, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + TFLT("MOVL", "-0, F4", "0x0000000000000080, F4", + 0xBE, 0x04, 0xA1, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); TEST("MOVBF", "2, F0", 0x3E, 0x04, 0xA0, 0x02); TEST("MOVBL", "R1, F2", 0x3E, 0x80, 0x08); @@ -551,11 +564,11 @@ static void test_format_11_fpu() { TEST("ADDL", "16(SB), F4", 0xBE, 0x00, 0xD1, 0x10); TEST("CMPF", "F1, F3", 0xBE, 0xC9, 0x08); TEST("CMPL", "F6, F4", 0xBE, 0x08, 0x31); - TEST("CMPF", "1.25, 3.75", + TFLT("CMPF", "1.25, 3.75", "0x0000A03F, 0x00007040", 0xBE, 0x09, 0xA5, 0x3F, 0xA0, 0x00, 0x00, 0x40, 0x70, 0x00, 0x00); - TEST("CMPL", "1.25, 3.75", + TFLT("CMPL", "1.25, 3.75", "0x000000000000F43F, 0x0000000000000E40", 0xBE, 0x08, 0xA5, 0x3F, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); @@ -587,11 +600,11 @@ static void test_format_11_fpu() { ERRT("SUBL", "16(SB), F3", REGISTER_NOT_ALIGNED, "F3", 0xBE, 0xD0, 0xD0, 0x10); disassembler.setOption("gnu-as", "on"); - TEST("CMPF", "0F1.25, 0F3.75", + TFLT("CMPF", "0F1.25, 0F3.75", "0x0000A03F, 0x00007040", 0xBE, 0x09, 0xA5, 0x3F, 0xA0, 0x00, 0x00, 0x40, 0x70, 0x00, 0x00); - TEST("CMPL", "0L1.25, 0L3.75", + TFLT("CMPL", "0L1.25, 0L3.75", "0x000000000000F43F, 0x0000000000000E40", 0xBE, 0x08, 0xA5, 0x3F, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); @@ -655,7 +668,7 @@ static void test_format_14_mmu() { static void test_generic_addressing() { // Register TEST("ADDW", "R1, R2", 0x81, 0x08); -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) TEST("ADDF", "F1, F2", 0xBE, 0x81, 0x08); #endif // Register Relative @@ -673,17 +686,24 @@ static void test_generic_addressing() { ERRT("ADDB", "R1, 0", OPERAND_NOT_ALLOWED, "0", 0x00, 0x0D); ERRT("ADDW", "R1, 0", OPERAND_NOT_ALLOWED, "0", 0x01, 0x0D); ERRT("ADDD", "R1, 0", OPERAND_NOT_ALLOWED, "0", 0x03, 0x0D); -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) - TEST("ADDF", "3.14159012, F1", +#if !defined(LIBASM_NS32000_NOFPU) + TFLT("ADDF", "3.14159012, F1", "0xD00F4940, F1", 0xBE, 0x41, 0xA0, 0x40, 0x49, 0x0F, 0xD0); - TEST("ADDF", "299792000, F3", + TFLT("ADDF", "299792000, F3", "0xB4F38E4D, F3", 0xBE, 0xC1, 0xA0, 0x4D, 0x8E, 0xF3, 0xB4); - TEST("ADDL", "2.7182818284590451, F2", + TFLT("ADDL", "2.7182818284590451, F2", "0x6957148B0ABF0540, F2", 0xBE, 0x80, 0xA0, 0x40, 0x05, 0xBF, 0x0A, 0x8B, 0x14, 0x57, 0x69); - TEST("ADDL", "6.6260701499999998E-34, F4", + TFLT("ADDL", "6.6260701499999998E-34, F4", "0x113102DE0B860B39, F4", 0xBE, 0x00, 0xA1, 0x39, 0x0B, 0x86, 0x0B, 0xDE, 0x02, 0x31, 0x11); +#if defined(LIBASM_DIS_NOFLOAT) + ERRT("ADDF", "F1, 0x00000000", OPERAND_NOT_ALLOWED, + "0x00000000", 0xBE, 0x01, 0x0D); + ERRT("ADDL", "F2, 0x0000000000000000", OPERAND_NOT_ALLOWED, + "0x0000000000000000", 0xBE, 0x00, 0x15); +#else ERRT("ADDF", "F1, 0", OPERAND_NOT_ALLOWED, "0", 0xBE, 0x01, 0x0D); ERRT("ADDL", "F2, 0", OPERAND_NOT_ALLOWED, "0", 0xBE, 0x00, 0x15); +#endif #endif // Absolute @@ -800,8 +820,30 @@ static void test_formatter() { TEST("SLSW", "@X'00000E", 0xBD, 0xAA, 0x0E); TEST("CMPW", "X'1234, X'5678", 0x05, 0xA5, 0x12, 0x34, 0x56, 0x78); +#if !defined(LIBASM_NS32000_NOFPU) + TFLT("ADDF", "3.14159012, F1", "X'D00F4940, F1", + 0xBE, 0x41, 0xA0, 0x40, 0x49, 0x0F, 0xD0); + TFLT("ADDF", "299792000, F3", "X'B4F38E4D, F3", + 0xBE, 0xC1, 0xA0, 0x4D, 0x8E, 0xF3, 0xB4); + TFLT("ADDL", "2.7182818284590451, F2", "X'6957148B0ABF0540, F2", + 0xBE, 0x80, 0xA0, 0x40, 0x05, 0xBF, 0x0A, 0x8B, 0x14, 0x57, 0x69); + TFLT("ADDL", "6.6260701499999998E-34, F4", "X'113102DE0B860B39, F4", + 0xBE, 0x00, 0xA1, 0x39, 0x0B, 0x86, 0x0B, 0xDE, 0x02, 0x31, 0x11); +#endif + disassembler.setOption("gnu-as", "enable"); ATEST(0x1000, "SHSW", "0x00100F(PC)", 0xBD, 0xDD, 0x0F); + +#if !defined(LIBASM_NS32000_NOFPU) + TFLT("ADDF", "0F3.14159012, F1", "0xD00F4940, F1", + 0xBE, 0x41, 0xA0, 0x40, 0x49, 0x0F, 0xD0); + TFLT("ADDF", "0F299792000, F3", "0xB4F38E4D, F3", + 0xBE, 0xC1, 0xA0, 0x4D, 0x8E, 0xF3, 0xB4); + TFLT("ADDL", "0L2.7182818284590451, F2", "0x6957148B0ABF0540, F2", + 0xBE, 0x80, 0xA0, 0x40, 0x05, 0xBF, 0x0A, 0x8B, 0x14, 0x57, 0x69); + TFLT("ADDL", "0L6.6260701499999998E-34, F4", "0x113102DE0B860B39, F4", + 0xBE, 0x00, 0xA1, 0x39, 0x0B, 0x86, 0x0B, 0xDE, 0x02, 0x31, 0x11); +#endif } // clang-format on @@ -998,7 +1040,7 @@ void run_tests(const char *cpu) { RUN_TEST(test_format_6); RUN_TEST(test_format_7); RUN_TEST(test_format_8); -#if !defined(LIBASM_DIS_NOFLOAT) && !defined(LIBASM_NS32000_NOFPU) +#if !defined(LIBASM_NS32000_NOFPU) RUN_TEST(test_format_9_fpu); RUN_TEST(test_format_11_fpu); #endif