llvm.org GIT mirror llvm / bbe7c65
Use intrinsics for Neon vmull operations. Radar 9208957. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128591 91177308-0d34-0410-b5e6-96231b3b80d8 Bob Wilson 9 years ago
2 changed file(s) with 17 addition(s) and 27 deletion(s). Raw diff Collapse all Expand all
607607 case OpMul:
608608 s += "__a * __b;";
609609 break;
610 case OpMullN:
611 s += Extend(typestr, "__a") + " * " +
612 Extend(typestr, Duplicate(nElts << (int)quad, typestr, "__b")) + ";";
613 break;
614610 case OpMullLane:
615 s += Extend(typestr, "__a") + " * " +
616 Extend(typestr, SplatLane(nElts, "__b", "__c")) + ";";
617 break;
618 case OpMull:
619 s += Extend(typestr, "__a") + " * " + Extend(typestr, "__b") + ";";
611 s += MangleName("vmull", typestr, ClassS) + "(__a, " +
612 SplatLane(nElts, "__b", "__c") + ");";
620613 break;
621614 case OpMlaN:
622615 s += "__a + (__b * " + Duplicate(nElts, typestr, "__c") + ");";
628621 s += "__a + (__b * __c);";
629622 break;
630623 case OpMlalN:
631 s += "__a + (" + Extend(typestr, "__b") + " * " +
632 Extend(typestr, Duplicate(nElts, typestr, "__c")) + ");";
624 s += "__a + " + MangleName("vmull", typestr, ClassS) + "(__b, " +
625 Duplicate(nElts, typestr, "__c") + ");";
633626 break;
634627 case OpMlalLane:
635 s += "__a + (" + Extend(typestr, "__b") + " * " +
636 Extend(typestr, SplatLane(nElts, "__c", "__d")) + ");";
628 s += "__a + " + MangleName("vmull", typestr, ClassS) + "(__b, " +
629 SplatLane(nElts, "__c", "__d") + ");";
637630 break;
638631 case OpMlal:
639 s += "__a + (" + Extend(typestr, "__b") + " * " +
640 Extend(typestr, "__c") + ");";
632 s += "__a + " + MangleName("vmull", typestr, ClassS) + "(__b, __c);";
641633 break;
642634 case OpMlsN:
643635 s += "__a - (__b * " + Duplicate(nElts, typestr, "__c") + ");";
649641 s += "__a - (__b * __c);";
650642 break;
651643 case OpMlslN:
652 s += "__a - (" + Extend(typestr, "__b") + " * " +
653 Extend(typestr, Duplicate(nElts, typestr, "__c")) + ");";
644 s += "__a - " + MangleName("vmull", typestr, ClassS) + "(__b, " +
645 Duplicate(nElts, typestr, "__c") + ");";
654646 break;
655647 case OpMlslLane:
656 s += "__a - (" + Extend(typestr, "__b") + " * " +
657 Extend(typestr, SplatLane(nElts, "__c", "__d")) + ");";
648 s += "__a - " + MangleName("vmull", typestr, ClassS) + "(__b, " +
649 SplatLane(nElts, "__c", "__d") + ");";
658650 break;
659651 case OpMlsl:
660 s += "__a - (" + Extend(typestr, "__b") + " * " +
661 Extend(typestr, "__c") + ");";
652 s += "__a - " + MangleName("vmull", typestr, ClassS) + "(__b, __c);";
662653 break;
663654 case OpQDMullLane:
664655 s += MangleName("vqdmull", typestr, ClassS) + "(__a, " +
11471138
11481139 std::vector RV = Records.getAllDerivedDefinitions("Inst");
11491140
1150 // Emit vmovl and vabd intrinsics first so they can be used by other
1141 // Emit vmovl, vmull and vabd intrinsics first so they can be used by other
11511142 // intrinsics. (Some of the saturating multiply instructions are also
11521143 // used to implement the corresponding "_lane" variants, but tablegen
11531144 // sorts the records into alphabetical order so that the "_lane" variants
11541145 // come after the intrinsics they use.)
11551146 emitIntrinsic(OS, Records.getDef("VMOVL"));
1147 emitIntrinsic(OS, Records.getDef("VMULL"));
11561148 emitIntrinsic(OS, Records.getDef("VABD"));
11571149
11581150 for (unsigned i = 0, e = RV.size(); i != e; ++i) {
11591151 Record *R = RV[i];
1160 if (R->getName() != "VMOVL" && R->getName() != "VABD")
1152 if (R->getName() != "VMOVL" &&
1153 R->getName() != "VMULL" &&
1154 R->getName() != "VABD")
11611155 emitIntrinsic(OS, R);
11621156 }
11631157
2929 OpSubl,
3030 OpSubw,
3131 OpMul,
32 OpMull,
3332 OpMla,
3433 OpMlal,
3534 OpMls,
3635 OpMlsl,
3736 OpMulN,
38 OpMullN,
3937 OpMlaN,
4038 OpMlsN,
4139 OpMlalN,
104102 OpMap["OP_SUBL"] = OpSubl;
105103 OpMap["OP_SUBW"] = OpSubw;
106104 OpMap["OP_MUL"] = OpMul;
107 OpMap["OP_MULL"] = OpMull;
108105 OpMap["OP_MLA"] = OpMla;
109106 OpMap["OP_MLAL"] = OpMlal;
110107 OpMap["OP_MLS"] = OpMls;
111108 OpMap["OP_MLSL"] = OpMlsl;
112109 OpMap["OP_MUL_N"] = OpMulN;
113 OpMap["OP_MULL_N"]= OpMullN;
114110 OpMap["OP_MLA_N"] = OpMlaN;
115111 OpMap["OP_MLS_N"] = OpMlsN;
116112 OpMap["OP_MLAL_N"] = OpMlalN;