Adding 'v16f16' to tablegen

I have been able to adapt the main LLVM sources to work with vectors of 16 x FP16 values and I have introduced the ‘v16f16’ data type to CLang and LLVM, but I am stumped on how to get TableGen to recognise this type. At the moment I am trying to optimise the calling convention code, and whenever I refer to ‘v16f16’ I get a crash in TableGen (unrecognised type). Unfortunately I haven’t got my head around the innards of TableGen yet, so I am asking if anyone has any advice on how to add a new vector data type to TableGen?

The main reason I need this is that OpenCL supports vectors with 16 elements for all supported scalar types, and the SHAVE processor does support FP16 (aka ‘half’) data types. Although we don’t natively support 16 x FP16, I would like to optimise how values of this type are passed and returned; so any advice is appreciated.

I have the same problem with ‘v16f64’, although this type does not occur in any real code that I have found outside the OpenCL test-suite.



Did you add the type to include llvm/CodeGen/ and utils/TableGen/CodeGenTarget.cpp?

Thanks Craig.

I have ‘v16f16’ added to ‘’ just before ‘v1f32’ and then the values of the following enumerates increased by one to correspond to this insertion. And also changed ‘include/llvm/CodeGen/MachineValueType.h’ to match this change.

However, I have not changed ‘utils/TableGen/CodeGenTarget.cpp’ so I will try that out.

Thanks for this insight,