diff --git a/Manual.md b/Manual.md index bc6ef1b..7191f5b 100644 --- a/Manual.md +++ b/Manual.md @@ -102,7 +102,7 @@ Allocates new integer vector uniforms (or arrays of uniforms) and creates aliase ### .bool ``` -.fvec unifName1, unifName2[size], unifName3, ... +.bool unifName1, unifName2[size], unifName3, ... ``` Allocates new boolean uniforms (or arrays of uniforms) and creates aliases for them that point to the allocated registers. Example: @@ -189,14 +189,14 @@ Syntax | Description `callu bReg, procName` | `ifu bReg` | `jmpu bReg, labelName` | -`lrp rDest, rSrcF, rSrc2, rSrc3` | -`mad rDest, rSrcF, rSrc2, rSrc3` | +`madi rDest, rSrc1, rSrc2, rSrc1` | +`mad rDest, rSrc1, rSrc1, rSrc2` | ### Description of operands - `rDest`: Represents a destination operand (register). - `rSrc1`: Represents a so-called SRC1 source operand (register), which allows accessing floating-point vector uniforms and relative addressing. -- `rSrc2`, `rSrc3` and `rSrcF`: They represent other source operands (registers), which are limited to input and scratch registers. +- `rSrc2`: Represents a so-called SRC2 source operand (register), which is limited to input and scratch registers. - `iReg`: Represents an integer vector uniform source operand. - `bReg`: Represents a boolean uniform source operand. - `procName`: Represents the name of a procedure. diff --git a/source/maestro_opcodes.h b/source/maestro_opcodes.h index 1884879..47201d4 100644 --- a/source/maestro_opcodes.h +++ b/source/maestro_opcodes.h @@ -52,6 +52,6 @@ enum MAESTRO_CMP, // only the upper 5 bits are used for the opcode // Only the upper 3 bits are used for the following opcodes - MAESTRO_LRP = 0x30, + MAESTRO_MADI = 0x30, MAESTRO_MAD = 0x38, }; diff --git a/source/picasso_assembler.cpp b/source/picasso_assembler.cpp index 1d1c8cc..2a7c861 100644 --- a/source/picasso_assembler.cpp +++ b/source/picasso_assembler.cpp @@ -760,6 +760,33 @@ DEF_COMMAND(format5) return 0; } +DEF_COMMAND(format5i) +{ + NEXT_ARG(destName); + NEXT_ARG(src1Name); + NEXT_ARG(src2Name); + NEXT_ARG(src3Name); + ENSURE_NO_MORE_ARGS(); + + ARG_TO_DEST_REG(rDest, destName); + ARG_TO_SRC1_REG(rSrc1, src1Name); + ARG_TO_SRC2_REG(rSrc2, src2Name); + ARG_TO_SRC1_REG(rSrc3, src3Name); + + int opdesc = 0; + safe_call(findOrAddOpdesc(opdesc, OPDESC_MAKE(maskFromSwizzling(rDestSw), rSrc1Sw, rSrc2Sw, rSrc3Sw), OPDESC_MASK_D123)); + + if (opdesc >= 32) + return throwError("opdesc allocation error\n"); + +#ifdef DEBUG + printf("%s:%02X d%02X, d%02X, d%02X, d%02X (0x%X)\n", cmdName, opcode, rDest, rSrc1, rSrc2, rSrc3, opdesc); +#endif + BUF.push_back(FMT_OPCODE(opcode) | opdesc | (rSrc3<<5) | (rSrc2<<12) | (rSrc1<<17) | (rDest<<24)); + + return 0; +} + DEF_COMMAND(formatmova) { NEXT_ARG(src1Name); @@ -979,7 +1006,7 @@ static const cmdTableType cmdTable[] = DEC_COMMAND(IFU, format3), DEC_COMMAND(JMPU, format3), - DEC_COMMAND(LRP, format5), + DEC_COMMAND(MADI, format5i), DEC_COMMAND(MAD, format5), { NULL, NULL },