// a list of zero or more source variable identifiers. A variable identifier is a variable name
// declared earlier in the code (as a function parameter, local or global variable).
// An instruction name designates an instruction that must be exported by the implementation.
-// Each instruction receives data from destination and source variable identifiers and returns
-// data in the destination variable identifier.
+// Each instruction receives data from source variable identifiers and returns data in the
+// destination variable identifier.
//
// It is up to the implementation how to define a particular operator or constructor. If it is
// expected to being used rarely, it can be defined in terms of other operators and constructors,
//
void __operator += (inout float a, const float b) {
- __asm float_add a, b;
+ __asm float_add a, a, b;
}
void __operator -= (inout float a, const float b) {
}
void __operator *= (inout float a, const float b) {
- __asm float_multiply a, b;
+ __asm float_multiply a, a, b;
}
void __operator /= (inout float a, const float b) {
- __asm float_divide a, b;
+ __asm float_divide a, a, b;
}
void __operator += (inout int x, const int y) {
//
float __operator - (const float a) {
- float c = a;
- __asm float_negate c;
+ float c;
+ __asm float_negate c, a;
return c;
}
bool __operator ! (const bool a) {
return a == false;
}
-\r
+
"\n"
"\n"
"void __operator += (inout float a, const float b) {\n"
-" __asm float_add a, b;\n"
+" __asm float_add a, a, b;\n"
"}\n"
"\n"
"void __operator -= (inout float a, const float b) {\n"
"}\n"
"\n"
"void __operator *= (inout float a, const float b) {\n"
-" __asm float_multiply a, b;\n"
+" __asm float_multiply a, a, b;\n"
"}\n"
"\n"
"void __operator /= (inout float a, const float b) {\n"
-" __asm float_divide a, b;\n"
+" __asm float_divide a, a, b;\n"
"}\n"
"\n"
"void __operator += (inout int x, const int y) {\n"
"\n"
"\n"
"float __operator - (const float a) {\n"
-" float c = a;\n"
-" __asm float_negate c;\n"
+" float c;\n"
+" __asm float_negate c, a;\n"
" return c;\n"
"}\n"
"\n"