mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	add support for the sse.cmp.* intrinsics, which fixes sse.isamax with the CBE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47824 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -2507,6 +2507,10 @@ void CWriter::lowerIntrinsics(Function &F) { | |||||||
|           case Intrinsic::prefetch: |           case Intrinsic::prefetch: | ||||||
|           case Intrinsic::dbg_stoppoint: |           case Intrinsic::dbg_stoppoint: | ||||||
|           case Intrinsic::powi: |           case Intrinsic::powi: | ||||||
|  |           case Intrinsic::x86_sse_cmp_ss: | ||||||
|  |           case Intrinsic::x86_sse_cmp_ps: | ||||||
|  |           case Intrinsic::x86_sse2_cmp_sd: | ||||||
|  |           case Intrinsic::x86_sse2_cmp_pd: | ||||||
|               // We directly implement these intrinsics |               // We directly implement these intrinsics | ||||||
|             break; |             break; | ||||||
|           default: |           default: | ||||||
| @@ -2768,6 +2772,40 @@ bool CWriter::visitBuiltinCall(CallInst &I, Intrinsic::ID ID, | |||||||
|         << SPI.getFileName() << "\"\n"; |         << SPI.getFileName() << "\"\n"; | ||||||
|     return true; |     return true; | ||||||
|   } |   } | ||||||
|  |   case Intrinsic::x86_sse_cmp_ss: | ||||||
|  |   case Intrinsic::x86_sse_cmp_ps: | ||||||
|  |   case Intrinsic::x86_sse2_cmp_sd: | ||||||
|  |   case Intrinsic::x86_sse2_cmp_pd: | ||||||
|  |     Out << '('; | ||||||
|  |     printType(Out, I.getType()); | ||||||
|  |     Out << ')';   | ||||||
|  |     // Multiple GCC builtins multiplex onto this intrinsic. | ||||||
|  |     switch (cast<ConstantInt>(I.getOperand(3))->getZExtValue()) { | ||||||
|  |     default: assert(0 && "Invalid llvm.x86.sse.cmp!"); | ||||||
|  |     case 0: Out << "__builtin_ia32_cmpeq"; break; | ||||||
|  |     case 1: Out << "__builtin_ia32_cmplt"; break; | ||||||
|  |     case 2: Out << "__builtin_ia32_cmple"; break; | ||||||
|  |     case 3: Out << "__builtin_ia32_cmpunord"; break; | ||||||
|  |     case 4: Out << "__builtin_ia32_cmpneq"; break; | ||||||
|  |     case 5: Out << "__builtin_ia32_cmpnlt"; break; | ||||||
|  |     case 6: Out << "__builtin_ia32_cmpnle"; break; | ||||||
|  |     case 7: Out << "__builtin_ia32_cmpord"; break; | ||||||
|  |     } | ||||||
|  |     if (ID == Intrinsic::x86_sse_cmp_ps || ID == Intrinsic::x86_sse2_cmp_pd) | ||||||
|  |       Out << 'p'; | ||||||
|  |     else | ||||||
|  |       Out << 's'; | ||||||
|  |     if (ID == Intrinsic::x86_sse_cmp_ss || ID == Intrinsic::x86_sse_cmp_ps) | ||||||
|  |       Out << 's'; | ||||||
|  |     else | ||||||
|  |       Out << 'd'; | ||||||
|  |        | ||||||
|  |     Out << "("; | ||||||
|  |     writeOperand(I.getOperand(1)); | ||||||
|  |     Out << ", "; | ||||||
|  |     writeOperand(I.getOperand(2)); | ||||||
|  |     Out << ")"; | ||||||
|  |     return true; | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user