X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fintel%2Fgenxml%2Fgen_macros.h;h=9d0172d041c58c06962e4138559a8baf7047f122;hb=ffc8f2ba4c2cc38c5612ef20235b90b648c4feff;hp=052c57f8a770229cc148962d19c062c0cb0cc74c;hpb=2c3f95d6aaab38cd66dd3dee1b089d5c91928eea;p=mesa.git diff --git a/src/intel/genxml/gen_macros.h b/src/intel/genxml/gen_macros.h index 052c57f8a77..9d0172d041c 100644 --- a/src/intel/genxml/gen_macros.h +++ b/src/intel/genxml/gen_macros.h @@ -21,27 +21,14 @@ * IN THE SOFTWARE. */ -#pragma once +#ifndef GEN_MACROS_H +#define GEN_MACROS_H /* Macros for handling per-gen compilation. * * The prefixing macros GENX() and genX() automatically prefix whatever you * give them by GENX_ or genX_ where X is the gen number. * - * You can declare a function to be used on some range of gens like this: - * - * GENX_FUNC(GEN7, GEN75) void - * genX(my_function_name)(args...) - * { - * // Do stuff - * } - * - * If the file is compiled for any set of gens containing gen7 and gen75, - * the function will effectively only get compiled twice as - * gen7_my_function_nmae and gen75_my_function_name. The function has to - * be compilable on all gens, but it will become a static inline that gets - * discarded by the compiler on all gens not in range. - * * You can do pseudo-runtime checks in your function such as * * if (GEN_GEN > 8 || GEN_IS_HASWELL) { @@ -71,9 +58,22 @@ #define GEN_GEN ((GEN_VERSIONx10) / 10) #define GEN_IS_HASWELL ((GEN_VERSIONx10) == 75) +#define GEN_IS_G4X ((GEN_VERSIONx10) == 45) /* Prefixing macros */ -#if (GEN_VERSIONx10 == 70) +#if (GEN_VERSIONx10 == 40) +# define GENX(X) GEN4_##X +# define genX(x) gen4_##x +#elif (GEN_VERSIONx10 == 45) +# define GENX(X) GEN45_##X +# define genX(x) gen45_##x +#elif (GEN_VERSIONx10 == 50) +# define GENX(X) GEN5_##X +# define genX(x) gen5_##x +#elif (GEN_VERSIONx10 == 60) +# define GENX(X) GEN6_##X +# define genX(x) gen6_##x +#elif (GEN_VERSIONx10 == 70) # define GENX(X) GEN7_##X # define genX(x) gen7_##x #elif (GEN_VERSIONx10 == 75) @@ -85,6 +85,17 @@ #elif (GEN_VERSIONx10 == 90) # define GENX(X) GEN9_##X # define genX(x) gen9_##x +#elif (GEN_VERSIONx10 == 100) +# define GENX(X) GEN10_##X +# define genX(x) gen10_##x +#elif (GEN_VERSIONx10 == 110) +# define GENX(X) GEN11_##X +# define genX(x) gen11_##x +#elif (GEN_VERSIONx10 == 120) +# define GENX(X) GEN12_##X +# define genX(x) gen12_##x #else # error "Need to add prefixing macros for this gen" #endif + +#endif /* GEN_MACROS_H */