Cleanup 3dnow builtin handling. Most of them were already handled by LLVM connecting intrinsics and builtins in IntrinsicsX86.td.

llvm-svn: 149233
This commit is contained in:
Craig Topper 2012-01-30 08:18:19 +00:00
parent 516cba3380
commit d6d3a05b4f
4 changed files with 2 additions and 121 deletions

View File

@ -42,8 +42,6 @@ BUILTIN(__builtin_ia32_pfrcpit1, "V2fV2fV2f", "nc")
BUILTIN(__builtin_ia32_pfrcpit2, "V2fV2fV2f", "nc")
BUILTIN(__builtin_ia32_pfrsqrt, "V2fV2f", "nc")
BUILTIN(__builtin_ia32_pfrsqit1, "V2fV2fV2f", "nc")
// GCC has pfrsqrtit1, even though this is not the name of the instruction.
BUILTIN(__builtin_ia32_pfrsqrtit1, "V2fV2fV2f", "nc")
BUILTIN(__builtin_ia32_pfsub, "V2fV2fV2f", "nc")
BUILTIN(__builtin_ia32_pfsubr, "V2fV2fV2f", "nc")
BUILTIN(__builtin_ia32_pi2fd, "V2fV2i", "nc")

View File

@ -2343,128 +2343,12 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
return SI;
}
// 3DNow!
case X86::BI__builtin_ia32_pavgusb:
case X86::BI__builtin_ia32_pf2id:
case X86::BI__builtin_ia32_pfacc:
case X86::BI__builtin_ia32_pfadd:
case X86::BI__builtin_ia32_pfcmpeq:
case X86::BI__builtin_ia32_pfcmpge:
case X86::BI__builtin_ia32_pfcmpgt:
case X86::BI__builtin_ia32_pfmax:
case X86::BI__builtin_ia32_pfmin:
case X86::BI__builtin_ia32_pfmul:
case X86::BI__builtin_ia32_pfrcp:
case X86::BI__builtin_ia32_pfrcpit1:
case X86::BI__builtin_ia32_pfrcpit2:
case X86::BI__builtin_ia32_pfrsqrt:
case X86::BI__builtin_ia32_pfrsqit1:
case X86::BI__builtin_ia32_pfrsqrtit1:
case X86::BI__builtin_ia32_pfsub:
case X86::BI__builtin_ia32_pfsubr:
case X86::BI__builtin_ia32_pi2fd:
case X86::BI__builtin_ia32_pmulhrw:
case X86::BI__builtin_ia32_pf2iw:
case X86::BI__builtin_ia32_pfnacc:
case X86::BI__builtin_ia32_pfpnacc:
case X86::BI__builtin_ia32_pi2fw:
case X86::BI__builtin_ia32_pswapdsf:
case X86::BI__builtin_ia32_pswapdsi: {
const char *name = 0;
Intrinsic::ID ID = Intrinsic::not_intrinsic;
switch(BuiltinID) {
case X86::BI__builtin_ia32_pavgusb:
name = "pavgusb";
ID = Intrinsic::x86_3dnow_pavgusb;
break;
case X86::BI__builtin_ia32_pf2id:
name = "pf2id";
ID = Intrinsic::x86_3dnow_pf2id;
break;
case X86::BI__builtin_ia32_pfacc:
name = "pfacc";
ID = Intrinsic::x86_3dnow_pfacc;
break;
case X86::BI__builtin_ia32_pfadd:
name = "pfadd";
ID = Intrinsic::x86_3dnow_pfadd;
break;
case X86::BI__builtin_ia32_pfcmpeq:
name = "pfcmpeq";
ID = Intrinsic::x86_3dnow_pfcmpeq;
break;
case X86::BI__builtin_ia32_pfcmpge:
name = "pfcmpge";
ID = Intrinsic::x86_3dnow_pfcmpge;
break;
case X86::BI__builtin_ia32_pfcmpgt:
name = "pfcmpgt";
ID = Intrinsic::x86_3dnow_pfcmpgt;
break;
case X86::BI__builtin_ia32_pfmax:
name = "pfmax";
ID = Intrinsic::x86_3dnow_pfmax;
break;
case X86::BI__builtin_ia32_pfmin:
name = "pfmin";
ID = Intrinsic::x86_3dnow_pfmin;
break;
case X86::BI__builtin_ia32_pfmul:
name = "pfmul";
ID = Intrinsic::x86_3dnow_pfmul;
break;
case X86::BI__builtin_ia32_pfrcp:
name = "pfrcp";
ID = Intrinsic::x86_3dnow_pfrcp;
break;
case X86::BI__builtin_ia32_pfrcpit1:
name = "pfrcpit1";
ID = Intrinsic::x86_3dnow_pfrcpit1;
break;
case X86::BI__builtin_ia32_pfrcpit2:
name = "pfrcpit2";
ID = Intrinsic::x86_3dnow_pfrcpit2;
break;
case X86::BI__builtin_ia32_pfrsqrt:
name = "pfrsqrt";
ID = Intrinsic::x86_3dnow_pfrsqrt;
break;
case X86::BI__builtin_ia32_pfrsqit1:
case X86::BI__builtin_ia32_pfrsqrtit1:
name = "pfrsqit1";
ID = Intrinsic::x86_3dnow_pfrsqit1;
break;
case X86::BI__builtin_ia32_pfsub:
name = "pfsub";
ID = Intrinsic::x86_3dnow_pfsub;
break;
case X86::BI__builtin_ia32_pfsubr:
name = "pfsubr";
ID = Intrinsic::x86_3dnow_pfsubr;
break;
case X86::BI__builtin_ia32_pi2fd:
name = "pi2fd";
ID = Intrinsic::x86_3dnow_pi2fd;
break;
case X86::BI__builtin_ia32_pmulhrw:
name = "pmulhrw";
ID = Intrinsic::x86_3dnow_pmulhrw;
break;
case X86::BI__builtin_ia32_pf2iw:
name = "pf2iw";
ID = Intrinsic::x86_3dnowa_pf2iw;
break;
case X86::BI__builtin_ia32_pfnacc:
name = "pfnacc";
ID = Intrinsic::x86_3dnowa_pfnacc;
break;
case X86::BI__builtin_ia32_pfpnacc:
name = "pfpnacc";
ID = Intrinsic::x86_3dnowa_pfpnacc;
break;
case X86::BI__builtin_ia32_pi2fw:
name = "pi2fw";
ID = Intrinsic::x86_3dnowa_pi2fw;
break;
default: llvm_unreachable("Unsupported intrinsic!");
case X86::BI__builtin_ia32_pswapdsf:
case X86::BI__builtin_ia32_pswapdsi:
name = "pswapd";

View File

@ -105,7 +105,7 @@ _m_pfrsqrt(__m64 __m) {
static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
_m_pfrsqrtit1(__m64 __m1, __m64 __m2) {
return (__m64)__builtin_ia32_pfrsqrtit1((__v2sf)__m1, (__v2sf)__m2);
return (__m64)__builtin_ia32_pfrsqit1((__v2sf)__m1, (__v2sf)__m2);
}
static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))

View File

@ -486,7 +486,6 @@ void f0() {
tmp_V2f = __builtin_ia32_pfrcpit2(tmp_V2f, tmp_V2f);
tmp_V2f = __builtin_ia32_pfrsqrt(tmp_V2f);
tmp_V2f = __builtin_ia32_pfrsqit1(tmp_V2f, tmp_V2f);
tmp_V2f = __builtin_ia32_pfrsqrtit1(tmp_V2f, tmp_V2f);
tmp_V2f = __builtin_ia32_pfsub(tmp_V2f, tmp_V2f);
tmp_V2f = __builtin_ia32_pfsubr(tmp_V2f, tmp_V2f);
tmp_V2f = __builtin_ia32_pi2fd(tmp_V2i);