Esempio n. 1
0
 public void writeExtra(eExtra what, string VECTOR_TYPE, string TYPE_SUFFIX, string cns)
 {
     writer.WriteLine("		namespace {0}", cns);
     writer.WriteLine("		{");
     ExtraCodeParser.write(writer, what, 3, VECTOR_TYPE, TYPE_SUFFIX);
     writer.WriteLine("		}}	// namespace Intrinsics::{0}::{1}", ns, cns);
 }
Esempio n. 2
0
 public void writeExtra(eExtra what, string VECTOR_TYPE, string TYPE_SUFFIX)
 {
     ExtraCodeParser.write(writer, what, 2, VECTOR_TYPE, TYPE_SUFFIX);
 }
Esempio n. 3
0
        public static void generateExtras(string destFolder)
        {
            ExtraCodeParser.copyStatic("fp16c.hpp", destFolder);

            string extra = Path.Combine(destFolder, "Extra");

            if (!Directory.Exists(extra))
            {
                Directory.CreateDirectory(extra);
            }
            ExtraCodeParser.copyStatic("common.hpp", extra);

            string f = "__m128";
            string d = "__m128d";
            string i = "__m128i";

            // SSE1
            using (var w = new ExtraWriter(extra, "sse-extra", "Sse"))
            {
                w.writeExtra(eExtra.sse1, f, "ps");
                w.extraFloat(f, "ps", false);
            }

            // SSE2
            using (var w = new ExtraWriter(extra, "sse2-extra", "Sse", @"""../sse.hpp"""))
            {
                // Double stuff
                w.writeExtra(eExtra.sse2, d, "pd");
                w.extraFloat(d, "pd", false);
                w.line();
                w.extraInteger(i, false);
            }

            // SSE 4.2
            using (var w = new ExtraWriter(extra, "sse4.2-extra", "Sse", @"""../sse2.hpp""", @"""../sse4.1.hpp"""))                 // cmpeq_epi64 is SSE 4.1, while cmpgt_epi64 is SSE 4.2. Looks like Intel forgot about that, and fixed later :-)
            {
                w.writeExtra(eExtra.sse42, null, null);
                w.writeExtra(eExtra.int_math, i, "epi64");
                w.line();
                w.line("#if INTRINSICS_SUPPORT_OPERATORS");
                w.writeExtra(eExtra.int_math_ops, i, "epi64", "Int64");
                w.line("#endif // INTRINSICS_SUPPORT_OPERATORS");
            }

            // AVX1
            f = "__m256";
            d = "__m256d";
            i = "__m256i";
            using (var w = new ExtraWriter(extra, "avx-extra", "Avx"))
            {
                w.writeExtra(eExtra.avx1, f, "ps");
                w.extraFloat(f, "ps", true);
                w.extraFloat(d, "pd", true);
            }

            // AVX2
            using (var w = new ExtraWriter(extra, "avx2-extra", "Avx", @"""../avx.hpp"""))
            {
                w.writeExtra(eExtra.avx2, f, "ps");
                w.extraInteger(i, true);
            }
        }