Skip to content

Commit 9fc2f78

Browse files
[X86][NFC] Added/Updated Trigonometric functions testcases (#127094)
- Added sin/cos testcases. - Added i686 checks for all testcases. - Moved fp16 and fp128 cases into separate files. - Dropped tests for ppc_fp128 type. - Added global-isel runs as precommit testing for #126931
1 parent 88163ca commit 9fc2f78

File tree

12 files changed

+1309
-410
lines changed

12 files changed

+1309
-410
lines changed

llvm/test/CodeGen/X86/fp128-libcalls.ll

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,3 +921,271 @@ entry:
921921
ret fp128 %call
922922
}
923923
declare fp128 @llvm.fma.f128(fp128, fp128, fp128)
924+
925+
define fp128 @Test128Acos(fp128 %a) nounwind {
926+
; ANDROID-LABEL: Test128Acos:
927+
; ANDROID: # %bb.0:
928+
; ANDROID-NEXT: jmp acosl@PLT # TAILCALL
929+
;
930+
; GNU-LABEL: Test128Acos:
931+
; GNU: # %bb.0:
932+
; GNU-NEXT: jmp acosf128@PLT # TAILCALL
933+
;
934+
; X86-LABEL: Test128Acos:
935+
; X86: # %bb.0:
936+
; X86-NEXT: pushl %esi
937+
; X86-NEXT: subl $24, %esp
938+
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
939+
; X86-NEXT: subl $12, %esp
940+
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
941+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
942+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
943+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
944+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
945+
; X86-NEXT: pushl %eax
946+
; X86-NEXT: calll acosl
947+
; X86-NEXT: addl $28, %esp
948+
; X86-NEXT: movaps (%esp), %xmm0
949+
; X86-NEXT: movaps %xmm0, (%esi)
950+
; X86-NEXT: movl %esi, %eax
951+
; X86-NEXT: addl $24, %esp
952+
; X86-NEXT: popl %esi
953+
; X86-NEXT: retl $4
954+
%x = call fp128 @llvm.acos.f128(fp128 %a)
955+
ret fp128 %x
956+
}
957+
958+
define fp128 @Test128Asin(fp128 %a) nounwind {
959+
; ANDROID-LABEL: Test128Asin:
960+
; ANDROID: # %bb.0:
961+
; ANDROID-NEXT: jmp asinl@PLT # TAILCALL
962+
;
963+
; GNU-LABEL: Test128Asin:
964+
; GNU: # %bb.0:
965+
; GNU-NEXT: jmp asinf128@PLT # TAILCALL
966+
;
967+
; X86-LABEL: Test128Asin:
968+
; X86: # %bb.0:
969+
; X86-NEXT: pushl %esi
970+
; X86-NEXT: subl $24, %esp
971+
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
972+
; X86-NEXT: subl $12, %esp
973+
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
974+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
975+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
976+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
977+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
978+
; X86-NEXT: pushl %eax
979+
; X86-NEXT: calll asinl
980+
; X86-NEXT: addl $28, %esp
981+
; X86-NEXT: movaps (%esp), %xmm0
982+
; X86-NEXT: movaps %xmm0, (%esi)
983+
; X86-NEXT: movl %esi, %eax
984+
; X86-NEXT: addl $24, %esp
985+
; X86-NEXT: popl %esi
986+
; X86-NEXT: retl $4
987+
%x = call fp128 @llvm.asin.f128(fp128 %a)
988+
ret fp128 %x
989+
}
990+
991+
define fp128 @Test128Atan(fp128 %a) nounwind {
992+
; ANDROID-LABEL: Test128Atan:
993+
; ANDROID: # %bb.0:
994+
; ANDROID-NEXT: jmp atanl@PLT # TAILCALL
995+
;
996+
; GNU-LABEL: Test128Atan:
997+
; GNU: # %bb.0:
998+
; GNU-NEXT: jmp atanf128@PLT # TAILCALL
999+
;
1000+
; X86-LABEL: Test128Atan:
1001+
; X86: # %bb.0:
1002+
; X86-NEXT: pushl %esi
1003+
; X86-NEXT: subl $24, %esp
1004+
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
1005+
; X86-NEXT: subl $12, %esp
1006+
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
1007+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1008+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1009+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1010+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1011+
; X86-NEXT: pushl %eax
1012+
; X86-NEXT: calll atanl
1013+
; X86-NEXT: addl $28, %esp
1014+
; X86-NEXT: movaps (%esp), %xmm0
1015+
; X86-NEXT: movaps %xmm0, (%esi)
1016+
; X86-NEXT: movl %esi, %eax
1017+
; X86-NEXT: addl $24, %esp
1018+
; X86-NEXT: popl %esi
1019+
; X86-NEXT: retl $4
1020+
%x = call fp128 @llvm.atan.f128(fp128 %a)
1021+
ret fp128 %x
1022+
}
1023+
1024+
define fp128 @Test128Atan2(fp128 %a, fp128 %b) nounwind {
1025+
; ANDROID-LABEL: Test128Atan2:
1026+
; ANDROID: # %bb.0:
1027+
; ANDROID-NEXT: jmp atan2l@PLT # TAILCALL
1028+
;
1029+
; GNU-LABEL: Test128Atan2:
1030+
; GNU: # %bb.0:
1031+
; GNU-NEXT: jmp atan2f128@PLT # TAILCALL
1032+
;
1033+
; X86-LABEL: Test128Atan2:
1034+
; X86: # %bb.0:
1035+
; X86-NEXT: pushl %esi
1036+
; X86-NEXT: subl $24, %esp
1037+
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
1038+
; X86-NEXT: subl $12, %esp
1039+
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
1040+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1041+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1042+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1043+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1044+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1045+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1046+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1047+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1048+
; X86-NEXT: pushl %eax
1049+
; X86-NEXT: calll atan2l
1050+
; X86-NEXT: addl $44, %esp
1051+
; X86-NEXT: movaps (%esp), %xmm0
1052+
; X86-NEXT: movaps %xmm0, (%esi)
1053+
; X86-NEXT: movl %esi, %eax
1054+
; X86-NEXT: addl $24, %esp
1055+
; X86-NEXT: popl %esi
1056+
; X86-NEXT: retl $4
1057+
%x = call fp128 @llvm.atan2.f128(fp128 %a, fp128 %b)
1058+
ret fp128 %x
1059+
}
1060+
1061+
define fp128 @Test128Cosh(fp128 %a) nounwind {
1062+
; ANDROID-LABEL: Test128Cosh:
1063+
; ANDROID: # %bb.0:
1064+
; ANDROID-NEXT: jmp coshl@PLT # TAILCALL
1065+
;
1066+
; GNU-LABEL: Test128Cosh:
1067+
; GNU: # %bb.0:
1068+
; GNU-NEXT: jmp coshf128@PLT # TAILCALL
1069+
;
1070+
; X86-LABEL: Test128Cosh:
1071+
; X86: # %bb.0:
1072+
; X86-NEXT: pushl %esi
1073+
; X86-NEXT: subl $24, %esp
1074+
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
1075+
; X86-NEXT: subl $12, %esp
1076+
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
1077+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1078+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1079+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1080+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1081+
; X86-NEXT: pushl %eax
1082+
; X86-NEXT: calll coshl
1083+
; X86-NEXT: addl $28, %esp
1084+
; X86-NEXT: movaps (%esp), %xmm0
1085+
; X86-NEXT: movaps %xmm0, (%esi)
1086+
; X86-NEXT: movl %esi, %eax
1087+
; X86-NEXT: addl $24, %esp
1088+
; X86-NEXT: popl %esi
1089+
; X86-NEXT: retl $4
1090+
%x = call fp128 @llvm.cosh.f128(fp128 %a)
1091+
ret fp128 %x
1092+
}
1093+
1094+
define fp128 @Test128Sinh(fp128 %a) nounwind {
1095+
; ANDROID-LABEL: Test128Sinh:
1096+
; ANDROID: # %bb.0:
1097+
; ANDROID-NEXT: jmp sinhl@PLT # TAILCALL
1098+
;
1099+
; GNU-LABEL: Test128Sinh:
1100+
; GNU: # %bb.0:
1101+
; GNU-NEXT: jmp sinhf128@PLT # TAILCALL
1102+
;
1103+
; X86-LABEL: Test128Sinh:
1104+
; X86: # %bb.0:
1105+
; X86-NEXT: pushl %esi
1106+
; X86-NEXT: subl $24, %esp
1107+
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
1108+
; X86-NEXT: subl $12, %esp
1109+
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
1110+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1111+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1112+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1113+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1114+
; X86-NEXT: pushl %eax
1115+
; X86-NEXT: calll sinhl
1116+
; X86-NEXT: addl $28, %esp
1117+
; X86-NEXT: movaps (%esp), %xmm0
1118+
; X86-NEXT: movaps %xmm0, (%esi)
1119+
; X86-NEXT: movl %esi, %eax
1120+
; X86-NEXT: addl $24, %esp
1121+
; X86-NEXT: popl %esi
1122+
; X86-NEXT: retl $4
1123+
%x = call fp128 @llvm.sinh.f128(fp128 %a)
1124+
ret fp128 %x
1125+
}
1126+
1127+
define fp128 @Test128Tan(fp128 %a) nounwind {
1128+
; ANDROID-LABEL: Test128Tan:
1129+
; ANDROID: # %bb.0:
1130+
; ANDROID-NEXT: jmp tanl@PLT # TAILCALL
1131+
;
1132+
; GNU-LABEL: Test128Tan:
1133+
; GNU: # %bb.0:
1134+
; GNU-NEXT: jmp tanf128@PLT # TAILCALL
1135+
;
1136+
; X86-LABEL: Test128Tan:
1137+
; X86: # %bb.0:
1138+
; X86-NEXT: pushl %esi
1139+
; X86-NEXT: subl $24, %esp
1140+
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
1141+
; X86-NEXT: subl $12, %esp
1142+
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
1143+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1144+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1145+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1146+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1147+
; X86-NEXT: pushl %eax
1148+
; X86-NEXT: calll tanl
1149+
; X86-NEXT: addl $28, %esp
1150+
; X86-NEXT: movaps (%esp), %xmm0
1151+
; X86-NEXT: movaps %xmm0, (%esi)
1152+
; X86-NEXT: movl %esi, %eax
1153+
; X86-NEXT: addl $24, %esp
1154+
; X86-NEXT: popl %esi
1155+
; X86-NEXT: retl $4
1156+
%x = call fp128 @llvm.tan.f128(fp128 %a)
1157+
ret fp128 %x
1158+
}
1159+
1160+
define fp128 @Test128Tanh(fp128 %a) nounwind {
1161+
; ANDROID-LABEL: Test128Tanh:
1162+
; ANDROID: # %bb.0:
1163+
; ANDROID-NEXT: jmp tanhl@PLT # TAILCALL
1164+
;
1165+
; GNU-LABEL: Test128Tanh:
1166+
; GNU: # %bb.0:
1167+
; GNU-NEXT: jmp tanhf128@PLT # TAILCALL
1168+
;
1169+
; X86-LABEL: Test128Tanh:
1170+
; X86: # %bb.0:
1171+
; X86-NEXT: pushl %esi
1172+
; X86-NEXT: subl $24, %esp
1173+
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
1174+
; X86-NEXT: subl $12, %esp
1175+
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
1176+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1177+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1178+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1179+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
1180+
; X86-NEXT: pushl %eax
1181+
; X86-NEXT: calll tanhl
1182+
; X86-NEXT: addl $28, %esp
1183+
; X86-NEXT: movaps (%esp), %xmm0
1184+
; X86-NEXT: movaps %xmm0, (%esi)
1185+
; X86-NEXT: movl %esi, %eax
1186+
; X86-NEXT: addl $24, %esp
1187+
; X86-NEXT: popl %esi
1188+
; X86-NEXT: retl $4
1189+
%x = call fp128 @llvm.tanh.f128(fp128 %a)
1190+
ret fp128 %x
1191+
}

0 commit comments

Comments
 (0)