[LLVMdev] Regular Expressions

Chris Lattner clattner at apple.com
Tue Jun 16 23:06:24 PDT 2009


On Jun 16, 2009, at 5:49 PM, David Greene wrote:

> On Tuesday 16 June 2009 19:35, David Greene wrote:
>
>> So which is more intuitive and less error-prone?
>>
>> defm BLENDPS  :  
>> sse41_avx_fp_binary_vector_osta_vintrinsic_rmi_rrmi<0x0C,
>>                  i32i8imm, "blend", "blend", "f32", 4>;
>>
>> or
>>
>> defm BLENDPS  :  
>> sse41_avx_fp_binary_vector_osta_vintrinsic_rmi_rrmi<0x0C,
>>                  i32i8imm, "blendps", "blendps">;
>
> Here's another option:
>
> defm BLENDPS  :  
> sse41_avx_fp_binary_vector_osta_vintrinsic_rmi_rrmi<0x0C,
>                   i32i8imm, "blendps", "blendps", v4f32, v8f32>;
>
> This is somewhere between the first and second options.  It's not as
> convenient as the second but is more intuitive than the first.  Still,
> looking at some random individual instruction, it wouldn't be  
> immediately
> clear to me what those multiple types mean.  I might think they're  
> source
> and destination types, for example.

I think I understand what you're saying with "munging strings is  
easier".  However, I still don't understand why you can't pass down  
some 'my_f32' instead of '"f32"' and have the defm pull out the right  
fields from my_f32.  The AVX type would be v8f32, the SSE type would  
be v4f32, etc.

More generally, I don't see how strings can be better in any  
circumstance: in any case where you pass down a string, you can pass  
down a def that has fields relating to how you would otherwise munge  
the string, no?

-Chris



More information about the llvm-dev mailing list