Message ID | 87liolvzby.fsf@firetop.home |
---|---|
State | New |
Headers | show |
Richard Sandiford [rdsandiford@googlemail.com] wrote: > This pattern maps directly to __builtin_mips_prepend, which is defined > to take and return an SI type, so :SI is the correct choice here. > > I agree it might be nice to have a function that operates on 64-bit > values for 64-bit targets though. For compatibility reasons, > we'd probably have to define both a new function and a new pattern > (or at least an iterator version of the current pattern). > There's currently no way of generating PREPENDD or PREPENDW either. > > I consider this API to be owned by MTI, so we'd need to coordinate > with them. Chao-Ying, what do you think? Do you already have > something like this internally? As there is no MIPS64 core with dsp/dspr2 in the market, we haven't tested/ported these built-in functions to MIPS64. I think it's better to keep the current prototype of __builtin_mips_prepend to return an SI type. We may need to add new built-in functions for instructions involving accumulators and for new MIPS64 dsp/dspr2 instructions to MIPS64. For existing built-in functions involving only integer registers/immediates, we may not change them. For Liu, is this solution suitable for you? Thanks! Regards, Chao-ying
On Fri, Feb 3, 2012 at 12:40 PM, Fu, Chao-Ying <fu@mips.com> wrote: > Richard Sandiford [rdsandiford@googlemail.com] wrote: > >> This pattern maps directly to __builtin_mips_prepend, which is defined >> to take and return an SI type, so :SI is the correct choice here. >> >> I agree it might be nice to have a function that operates on 64-bit >> values for 64-bit targets though. For compatibility reasons, >> we'd probably have to define both a new function and a new pattern >> (or at least an iterator version of the current pattern). >> There's currently no way of generating PREPENDD or PREPENDW either. >> >> I consider this API to be owned by MTI, so we'd need to coordinate >> with them. Chao-Ying, what do you think? Do you already have >> something like this internally? > > As there is no MIPS64 core with dsp/dspr2 in the market, we haven't tested/ported these built-in functions to MIPS64. > > I think it's better to keep the current prototype of __builtin_mips_prepend to return an SI type. > We may need to add new built-in functions for instructions involving accumulators and for new MIPS64 dsp/dspr2 instructions to MIPS64. > For existing built-in functions involving only integer registers/immediates, we may not change them. > For Liu, is this solution suitable for you? Thanks! > OK, I get. But, sorry, my mips64dspr2 patch has be done... Should I summit it? > Regards, > Chao-ying
Liu [proljc@gmail.com] wrote: > OK, I get. > But, sorry, my mips64dspr2 patch has be done... > Should I summit it? I just wonder what version of the MIPS64 DSP/DSPr2 spec that you implemented. Do you have a target CPU that has these MIPS64 DSP/DSPr2 instructions? My concern is that the latest spec removed a lot of new instructions. Thanks! Regards, Chao-ying
On Fri, Feb 3, 2012 at 3:59 PM, Fu, Chao-Ying <fu@mips.com> wrote: > Liu [proljc@gmail.com] wrote: > >> OK, I get. >> But, sorry, my mips64dspr2 patch has be done... >> Should I summit it? > > I just wonder what version of the MIPS64 DSP/DSPr2 spec that you implemented. Do you have a target CPU that has these MIPS64 DSP/DSPr2 instructions? My concern is that the latest spec removed a lot of new instructions. Thanks! > MIPS® Architecture for Programmers VolumeIV-e: The MIPS® DSP Application- Specific Extension to the MIPS64® Architecture Document Number: MD00375 Revision 2.34 May 6, 2011 I have lots of MIPS64 CPU but no DSP:( > Regards, > Chao-ying
Index: gcc/config/mips/mips-dspr2.md =================================================================== --- gcc/config/mips/mips-dspr2.md 2012-02-02 18:32:00.000000000 +0000 +++ gcc/config/mips/mips-dspr2.md 2012-02-02 18:32:11.000000000 +0000 @@ -353,7 +353,7 @@ (define_insn "mips_prepend" "ISA_HAS_DSPR2" { if (INTVAL (operands[3]) & ~(unsigned HOST_WIDE_INT) 31) - operands[2] = GEN_INT (INTVAL (operands[2]) & 31); + operands[3] = GEN_INT (INTVAL (operands[3]) & 31); return "prepend\t%0,%z2,%3"; } [(set_attr "type" "arith") Index: gcc/testsuite/gcc.target/mips/mips-prepend-1.c =================================================================== --- /dev/null 2012-02-02 18:24:25.322640797 +0000 +++ gcc/testsuite/gcc.target/mips/mips-prepend-1.c 2012-02-02 18:31:04.000000000 +0000 @@ -0,0 +1,8 @@ +/* { dg-options "-mdspr2" } */ +/* { dg-final { scan-assembler "prepend\[^\n\]*,10" } } */ + +NOMIPS16 int +foo (int x, int y) +{ + return __builtin_mips_prepend (x, y, 42); +}