From 599d18f26f25ca29e704190f25adcaa0bb9ed4f5 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 5 Jun 2021 17:22:39 +0100 Subject: Experimental support for inline swizzling for array types of len <= 4 e.g. `v.xyz`, `v.argb`, `v.xxx` --- src/entity.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/entity.cpp') diff --git a/src/entity.cpp b/src/entity.cpp index 173a3fcd0..30bbef9dc 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -40,27 +40,28 @@ enum EntityFlag : u64 { EntityFlag_Param = 1ull<<4, EntityFlag_Result = 1ull<<5, EntityFlag_ArrayElem = 1ull<<6, - EntityFlag_Ellipsis = 1ull<<7, - EntityFlag_NoAlias = 1ull<<8, - EntityFlag_TypeField = 1ull<<9, - EntityFlag_Value = 1ull<<10, - EntityFlag_Sret = 1ull<<11, - EntityFlag_ByVal = 1ull<<12, - EntityFlag_BitFieldValue = 1ull<<13, - EntityFlag_PolyConst = 1ull<<14, - EntityFlag_NotExported = 1ull<<15, - EntityFlag_ConstInput = 1ull<<16, + EntityFlag_ArraySwizzle = 1ull<<7, + EntityFlag_Ellipsis = 1ull<<8, + EntityFlag_NoAlias = 1ull<<9, + EntityFlag_TypeField = 1ull<<10, + EntityFlag_Value = 1ull<<11, + EntityFlag_Sret = 1ull<<12, + EntityFlag_ByVal = 1ull<<13, + EntityFlag_BitFieldValue = 1ull<<14, + EntityFlag_PolyConst = 1ull<<15, + EntityFlag_NotExported = 1ull<<16, + EntityFlag_ConstInput = 1ull<<17, - EntityFlag_Static = 1ull<<17, + EntityFlag_Static = 1ull<<18, - EntityFlag_ImplicitReference = 1ull<<18, // NOTE(bill): equivalent to `const &` in C++ + EntityFlag_ImplicitReference = 1ull<<19, // NOTE(bill): equivalent to `const &` in C++ - EntityFlag_SoaPtrField = 1ull<<19, // to allow s.x[0] where `s.x` is a pointer rather than a slice + EntityFlag_SoaPtrField = 1ull<<20, // to allow s.x[0] where `s.x` is a pointer rather than a slice - EntityFlag_ProcBodyChecked = 1ull<<20, + EntityFlag_ProcBodyChecked = 1ull<<21, - EntityFlag_CVarArg = 1ull<<21, - EntityFlag_AutoCast = 1ull<<22, + EntityFlag_CVarArg = 1ull<<22, + EntityFlag_AutoCast = 1ull<<23, EntityFlag_Disabled = 1ull<<24, EntityFlag_Cold = 1ull<<25, // procedure is rarely called -- cgit v1.2.3