X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=scripts%2Fgen_cmp.php;fp=scripts%2Fgen_cmp.php;h=89524ee8abde5f2f21c7c846a6cade29b13b8214;hb=e11280a7b6ed67a4d79b14569ca06131ea2338bd;hp=0000000000000000000000000000000000000000;hpb=224b0dc90c463f236a978f41c66c2f2b565038b5;p=m6w6%2Fext-psi diff --git a/scripts/gen_cmp.php b/scripts/gen_cmp.php new file mode 100644 index 0000000..89524ee --- /dev/null +++ b/scripts/gen_cmp.php @@ -0,0 +1,27 @@ + "fval", + "DOUBLE" => "dval", + "LONG_DOUBLE" => "ldval", + "INT8" => "i8", + "UINT8" => "u8", + "INT16" => "i16", + "UINT16" => "u16", + "INT32" => "i32", + "UINT32" => "u32", + "INT64" => "i64", + "UINT64" => "u64", +]; + +printf("\tswitch (t1) { \\\n"); +foreach ($types as $t1 => $f1) { + printf("\tcase PSI_T_%s: \\\n", $t1); + printf("\t\tswitch (t2) { \\\n"); + foreach ($types as $t2 => $f2) { + printf("\t\tcase PSI_T_%s:\tPSI_CALC_OP2(u8, %s, %s);\tbreak; \\\n", + $t2, $f1, $f2); + } + printf("\t\tEMPTY_SWITCH_DEFAULT_CASE(); \\\n\t\t} \\\n\t\tbreak; \\\n"); +} +printf("\tEMPTY_SWITCH_DEFAULT_CASE(); \\\n\t} \\\n"); \ No newline at end of file