On Tue, Sep 20, 2011 at 3:38 PM, Jakub Jelinek <ja...@redhat.com> wrote:
> On Tue, Sep 20, 2011 at 07:15:42AM +0200, Uros Bizjak wrote:
>> Perhaps use mode attribute that defines "f" for FP modes and "%i" for
>> integer modes. "%i" is further processed in ix86_output_operand  (or
>> perhaps ASM_OUTPUT_OPCODE, similar to %v ?) to output "i" for
>> TARGET_AVX2 or "f" otherwise.
>>
>
> We can do something like following for the patterns (it can't be
> like %v, because it is not at the beginning of the insn, so it either
> could be some punctuation character without operand (but no idea
> where would it take the mode from), or as this patch, which has
> an operand number from which to take the mode - but as the code
> uses strtoul to parse the number, we can't have %I0128, so it can't
> expand just to i/f, but to i128/f128.
>
> But still no idea how to do it nicely for the "mode" attribute,
> define_mode_attr can't be conditional.  Using if_then_else
> for "mode" attribute is of course possible, but ugly.

No, you define mode attribute like

(define_mode_attr somesuffix [(V2DI "%i") (V2DF "f") ...])

where integer modes map to %i and FP modes to "f".

Then, just return "vextract<somesuffix>128\t{$0x1, %1, %0|%0, %1, 0x1}"

(You can use punctuation char in place of %i, it doesn't depend on
operands at all.)

Uros.

Reply via email to