5 ms·
Obviously that doesn't generalize for opcodes with 0, 1, 3 or more input operands. As a concrete example, consider a fused multiply-add operation: `rd = fma rs1
by lifthrasiir 3y ago
Obviously that doesn't generalize for opcodes with 0, 1, 3 or more input operands. As a concrete example, consider a fused multiply-add operation: `rd = fma rs1, rs2, rs3` is consistent, but how would you convert it to an infix notation?
- _a_a_a_ 3y agord = rs1 * rs2 + rs3 It's no different from parsing if/then/else. Provided one assignment maps to one opcode, it's unambiguous.
- prabhu-yu 3y agopre-fix is the finest notation for many reasons. So, Intel syntax makes more sense than ATT syntax. Even C functions are pre-fix. [function_name arg1, arg2 ...] If schools were teaching pre-fix, we would be in better position to appreciate Intel syntax. Higher maths uses pre-fix, for example: y=f(x) unfortenately, above line is not pure prefix... = y f(x) would be pure pre-fix.
- _a_a_a_ 3y agox++ is a postfix kind-of function a ? b : c is ternary infix Edit: arguably /* comment! */ is a function that takes an unquoted string. It's a no-op function so the compiler removes it at compile time (giggle)