1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132
|
// RUN: mlir-opt %s | mlir-opt | FileCheck %s
// RUN: mlir-opt %s --mlir-print-op-generic | mlir-opt | FileCheck %s
// CHECK-LABEL: test_addi
func.func @test_addi(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.addi %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_addi_tensor
func.func @test_addi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.addi %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_addi_vector
func.func @test_addi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.addi %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_addi_scalable_vector
func.func @test_addi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.addi %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_addui_extended
func.func @test_addui_extended(%arg0 : i64, %arg1 : i64) -> i64 {
%sum, %overflow = arith.addui_extended %arg0, %arg1 : i64, i1
return %sum : i64
}
// CHECK-LABEL: test_addui_extended_tensor
func.func @test_addui_extended_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%sum, %overflow = arith.addui_extended %arg0, %arg1 : tensor<8x8xi64>, tensor<8x8xi1>
return %sum : tensor<8x8xi64>
}
// CHECK-LABEL: test_addui_extended_vector
func.func @test_addui_extended_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0:2 = arith.addui_extended %arg0, %arg1 : vector<8xi64>, vector<8xi1>
return %0#0 : vector<8xi64>
}
// CHECK-LABEL: test_addui_extended_scalable_vector
func.func @test_addui_extended_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0:2 = arith.addui_extended %arg0, %arg1 : vector<[8]xi64>, vector<[8]xi1>
return %0#0 : vector<[8]xi64>
}
// CHECK-LABEL: test_subi
func.func @test_subi(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.subi %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_subi_tensor
func.func @test_subi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.subi %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_subi_vector
func.func @test_subi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.subi %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_subi_scalable_vector
func.func @test_subi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.subi %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_muli
func.func @test_muli(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.muli %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_muli_tensor
func.func @test_muli_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.muli %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_muli_vector
func.func @test_muli_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.muli %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_muli_scalable_vector
func.func @test_muli_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.muli %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_mulsi_extended
func.func @test_mulsi_extended(%arg0 : i32, %arg1 : i32) -> i32 {
%low, %high = arith.mulsi_extended %arg0, %arg1 : i32
return %high : i32
}
// CHECK-LABEL: test_mulsi_extended_tensor
func.func @test_mulsi_extended_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%low, %high = arith.mulsi_extended %arg0, %arg1 : tensor<8x8xi64>
return %high : tensor<8x8xi64>
}
// CHECK-LABEL: test_mulsi_extended_vector
func.func @test_mulsi_extended_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0:2 = arith.mulsi_extended %arg0, %arg1 : vector<8xi64>
return %0#0 : vector<8xi64>
}
// CHECK-LABEL: test_mulsi_extended_scalable_vector
func.func @test_mulsi_extended_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0:2 = arith.mulsi_extended %arg0, %arg1 : vector<[8]xi64>
return %0#1 : vector<[8]xi64>
}
// CHECK-LABEL: test_mului_extended
func.func @test_mului_extended(%arg0 : i32, %arg1 : i32) -> i32 {
%low, %high = arith.mului_extended %arg0, %arg1 : i32
return %high : i32
}
// CHECK-LABEL: test_mului_extended_tensor
func.func @test_mului_extended_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%low, %high = arith.mului_extended %arg0, %arg1 : tensor<8x8xi64>
return %high : tensor<8x8xi64>
}
// CHECK-LABEL: test_mului_extended_vector
func.func @test_mului_extended_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0:2 = arith.mului_extended %arg0, %arg1 : vector<8xi64>
return %0#0 : vector<8xi64>
}
// CHECK-LABEL: test_mului_extended_scalable_vector
func.func @test_mului_extended_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0:2 = arith.mului_extended %arg0, %arg1 : vector<[8]xi64>
return %0#1 : vector<[8]xi64>
}
// CHECK-LABEL: test_divui
func.func @test_divui(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.divui %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_divui_tensor
func.func @test_divui_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.divui %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_divui_vector
func.func @test_divui_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.divui %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_divui_scalable_vector
func.func @test_divui_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.divui %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_divsi
func.func @test_divsi(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.divsi %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_divsi_tensor
func.func @test_divsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.divsi %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_divsi_vector
func.func @test_divsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.divsi %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_divsi_scalable_vector
func.func @test_divsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.divsi %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_remui
func.func @test_remui(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.remui %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_remui_tensor
func.func @test_remui_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.remui %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_remui_vector
func.func @test_remui_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.remui %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_remui_scalable_vector
func.func @test_remui_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.remui %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_remsi
func.func @test_remsi(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.remsi %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_remsi_tensor
func.func @test_remsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.remsi %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_remsi_vector
func.func @test_remsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.remsi %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_remsi_scalable_vector
func.func @test_remsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.remsi %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_andi
func.func @test_andi(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.andi %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_andi_tensor
func.func @test_andi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.andi %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_andi_vector
func.func @test_andi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.andi %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_andi_scalable_vector
func.func @test_andi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.andi %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_ori
func.func @test_ori(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.ori %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_ori_tensor
func.func @test_ori_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.ori %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_ori_vector
func.func @test_ori_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.ori %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_ori_scalable_vector
func.func @test_ori_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.ori %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_xori
func.func @test_xori(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.xori %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_xori_tensor
func.func @test_xori_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.xori %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_xori_vector
func.func @test_xori_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.xori %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_xori_scalable_vector
func.func @test_xori_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.xori %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_ceildivsi
func.func @test_ceildivsi(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.ceildivsi %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_ceildivsi_tensor
func.func @test_ceildivsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.ceildivsi %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_ceildivsi_vector
func.func @test_ceildivsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.ceildivsi %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_ceildivsi_scalable_vector
func.func @test_ceildivsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.ceildivsi %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_floordivsi
func.func @test_floordivsi(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.floordivsi %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_floordivsi_tensor
func.func @test_floordivsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.floordivsi %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_floordivsi_vector
func.func @test_floordivsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.floordivsi %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_floordivsi_scalable_vector
func.func @test_floordivsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.floordivsi %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_shli
func.func @test_shli(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.shli %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_shli_tensor
func.func @test_shli_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.shli %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_shli_vector
func.func @test_shli_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.shli %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_shli_scalable_vector
func.func @test_shli_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.shli %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_shrui
func.func @test_shrui(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.shrui %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_shrui_tensor
func.func @test_shrui_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.shrui %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_shrui_vector
func.func @test_shrui_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.shrui %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_shrui_scalable_vector
func.func @test_shrui_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.shrui %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_shrsi
func.func @test_shrsi(%arg0 : i64, %arg1 : i64) -> i64 {
%0 = arith.shrsi %arg0, %arg1 : i64
return %0 : i64
}
// CHECK-LABEL: test_shrsi_tensor
func.func @test_shrsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {
%0 = arith.shrsi %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_shrsi_vector
func.func @test_shrsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {
%0 = arith.shrsi %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_shrsi_scalable_vector
func.func @test_shrsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {
%0 = arith.shrsi %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_negf
func.func @test_negf(%arg0 : f64) -> f64 {
%0 = arith.negf %arg0 : f64
return %0 : f64
}
// CHECK-LABEL: test_negf_tensor
func.func @test_negf_tensor(%arg0 : tensor<8x8xf64>) -> tensor<8x8xf64> {
%0 = arith.negf %arg0 : tensor<8x8xf64>
return %0 : tensor<8x8xf64>
}
// CHECK-LABEL: test_negf_vector
func.func @test_negf_vector(%arg0 : vector<8xf64>) -> vector<8xf64> {
%0 = arith.negf %arg0 : vector<8xf64>
return %0 : vector<8xf64>
}
// CHECK-LABEL: test_negf_scalable_vector
func.func @test_negf_scalable_vector(%arg0 : vector<[8]xf64>) -> vector<[8]xf64> {
%0 = arith.negf %arg0 : vector<[8]xf64>
return %0 : vector<[8]xf64>
}
// CHECK-LABEL: test_addf
func.func @test_addf(%arg0 : f64, %arg1 : f64) -> f64 {
%0 = arith.addf %arg0, %arg1 : f64
return %0 : f64
}
// CHECK-LABEL: test_addf_tensor
func.func @test_addf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {
%0 = arith.addf %arg0, %arg1 : tensor<8x8xf64>
return %0 : tensor<8x8xf64>
}
// CHECK-LABEL: test_addf_vector
func.func @test_addf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {
%0 = arith.addf %arg0, %arg1 : vector<8xf64>
return %0 : vector<8xf64>
}
// CHECK-LABEL: test_addf_scalable_vector
func.func @test_addf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {
%0 = arith.addf %arg0, %arg1 : vector<[8]xf64>
return %0 : vector<[8]xf64>
}
// CHECK-LABEL: test_subf
func.func @test_subf(%arg0 : f64, %arg1 : f64) -> f64 {
%0 = arith.subf %arg0, %arg1 : f64
return %0 : f64
}
// CHECK-LABEL: test_subf_tensor
func.func @test_subf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {
%0 = arith.subf %arg0, %arg1 : tensor<8x8xf64>
return %0 : tensor<8x8xf64>
}
// CHECK-LABEL: test_subf_vector
func.func @test_subf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {
%0 = arith.subf %arg0, %arg1 : vector<8xf64>
return %0 : vector<8xf64>
}
// CHECK-LABEL: test_subf_scalable_vector
func.func @test_subf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {
%0 = arith.subf %arg0, %arg1 : vector<[8]xf64>
return %0 : vector<[8]xf64>
}
// CHECK-LABEL: test_mulf
func.func @test_mulf(%arg0 : f64, %arg1 : f64) -> f64 {
%0 = arith.mulf %arg0, %arg1 : f64
return %0 : f64
}
// CHECK-LABEL: test_mulf_tensor
func.func @test_mulf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {
%0 = arith.mulf %arg0, %arg1 : tensor<8x8xf64>
return %0 : tensor<8x8xf64>
}
// CHECK-LABEL: test_mulf_vector
func.func @test_mulf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {
%0 = arith.mulf %arg0, %arg1 : vector<8xf64>
return %0 : vector<8xf64>
}
// CHECK-LABEL: test_mulf_scalable_vector
func.func @test_mulf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {
%0 = arith.mulf %arg0, %arg1 : vector<[8]xf64>
return %0 : vector<[8]xf64>
}
// CHECK-LABEL: test_divf
func.func @test_divf(%arg0 : f64, %arg1 : f64) -> f64 {
%0 = arith.divf %arg0, %arg1 : f64
return %0 : f64
}
// CHECK-LABEL: test_divf_tensor
func.func @test_divf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {
%0 = arith.divf %arg0, %arg1 : tensor<8x8xf64>
return %0 : tensor<8x8xf64>
}
// CHECK-LABEL: test_divf_vector
func.func @test_divf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {
%0 = arith.divf %arg0, %arg1 : vector<8xf64>
return %0 : vector<8xf64>
}
// CHECK-LABEL: test_divf_scalable_vector
func.func @test_divf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {
%0 = arith.divf %arg0, %arg1 : vector<[8]xf64>
return %0 : vector<[8]xf64>
}
// CHECK-LABEL: test_remf
func.func @test_remf(%arg0 : f64, %arg1 : f64) -> f64 {
%0 = arith.remf %arg0, %arg1 : f64
return %0 : f64
}
// CHECK-LABEL: test_remf_tensor
func.func @test_remf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {
%0 = arith.remf %arg0, %arg1 : tensor<8x8xf64>
return %0 : tensor<8x8xf64>
}
// CHECK-LABEL: test_remf_vector
func.func @test_remf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {
%0 = arith.remf %arg0, %arg1 : vector<8xf64>
return %0 : vector<8xf64>
}
// CHECK-LABEL: test_remf_scalable_vector
func.func @test_remf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {
%0 = arith.remf %arg0, %arg1 : vector<[8]xf64>
return %0 : vector<[8]xf64>
}
// CHECK-LABEL: test_extui
func.func @test_extui(%arg0 : i32) -> i64 {
%0 = arith.extui %arg0 : i32 to i64
return %0 : i64
}
// CHECK-LABEL: test_extui_tensor
func.func @test_extui_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xi64> {
%0 = arith.extui %arg0 : tensor<8x8xi32> to tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_extui_vector
func.func @test_extui_vector(%arg0 : vector<8xi32>) -> vector<8xi64> {
%0 = arith.extui %arg0 : vector<8xi32> to vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_extui_scalable_vector
func.func @test_extui_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xi64> {
%0 = arith.extui %arg0 : vector<[8]xi32> to vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_extsi
func.func @test_extsi(%arg0 : i32) -> i64 {
%0 = arith.extsi %arg0 : i32 to i64
return %0 : i64
}
// CHECK-LABEL: test_extsi_tensor
func.func @test_extsi_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xi64> {
%0 = arith.extsi %arg0 : tensor<8x8xi32> to tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_extsi_vector
func.func @test_extsi_vector(%arg0 : vector<8xi32>) -> vector<8xi64> {
%0 = arith.extsi %arg0 : vector<8xi32> to vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_extsi_scalable_vector
func.func @test_extsi_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xi64> {
%0 = arith.extsi %arg0 : vector<[8]xi32> to vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_extf
func.func @test_extf(%arg0 : f32) -> f64 {
%0 = arith.extf %arg0 : f32 to f64
return %0 : f64
}
// CHECK-LABEL: test_extf_tensor
func.func @test_extf_tensor(%arg0 : tensor<8x8xf32>) -> tensor<8x8xf64> {
%0 = arith.extf %arg0 : tensor<8x8xf32> to tensor<8x8xf64>
return %0 : tensor<8x8xf64>
}
// CHECK-LABEL: test_extf_tensor_encoding
func.func @test_extf_tensor_encoding(%arg0 : tensor<8x8xf32, "foo">) -> tensor<8x8xf64, "foo"> {
%0 = arith.extf %arg0 : tensor<8x8xf32, "foo"> to tensor<8x8xf64, "foo">
return %0 : tensor<8x8xf64, "foo">
}
// CHECK-LABEL: test_extf_vector
func.func @test_extf_vector(%arg0 : vector<8xf32>) -> vector<8xf64> {
%0 = arith.extf %arg0 : vector<8xf32> to vector<8xf64>
return %0 : vector<8xf64>
}
// CHECK-LABEL: test_extf_scalable_vector
func.func @test_extf_scalable_vector(%arg0 : vector<[8]xf32>) -> vector<[8]xf64> {
%0 = arith.extf %arg0 : vector<[8]xf32> to vector<[8]xf64>
return %0 : vector<[8]xf64>
}
// CHECK-LABEL: test_trunci
func.func @test_trunci(%arg0 : i32) -> i16 {
%0 = arith.trunci %arg0 : i32 to i16
return %0 : i16
}
// CHECK-LABEL: test_trunci_tensor
func.func @test_trunci_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xi16> {
%0 = arith.trunci %arg0 : tensor<8x8xi32> to tensor<8x8xi16>
return %0 : tensor<8x8xi16>
}
// CHECK-LABEL: test_trunci_vector
func.func @test_trunci_vector(%arg0 : vector<8xi32>) -> vector<8xi16> {
%0 = arith.trunci %arg0 : vector<8xi32> to vector<8xi16>
return %0 : vector<8xi16>
}
// CHECK-LABEL: test_trunci_scalable_vector
func.func @test_trunci_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xi16> {
%0 = arith.trunci %arg0 : vector<[8]xi32> to vector<[8]xi16>
return %0 : vector<[8]xi16>
}
// CHECK-LABEL: test_truncf
func.func @test_truncf(%arg0 : f32) -> bf16 {
%0 = arith.truncf %arg0 : f32 to bf16
return %0 : bf16
}
// CHECK-LABEL: test_truncf_tensor
func.func @test_truncf_tensor(%arg0 : tensor<8x8xf32>) -> tensor<8x8xbf16> {
%0 = arith.truncf %arg0 : tensor<8x8xf32> to tensor<8x8xbf16>
return %0 : tensor<8x8xbf16>
}
// CHECK-LABEL: test_truncf_vector
func.func @test_truncf_vector(%arg0 : vector<8xf32>) -> vector<8xbf16> {
%0 = arith.truncf %arg0 : vector<8xf32> to vector<8xbf16>
return %0 : vector<8xbf16>
}
// CHECK-LABEL: test_truncf_scalable_vector
func.func @test_truncf_scalable_vector(%arg0 : vector<[8]xf32>) -> vector<[8]xbf16> {
%0 = arith.truncf %arg0 : vector<[8]xf32> to vector<[8]xbf16>
return %0 : vector<[8]xbf16>
}
// CHECK-LABEL: test_uitofp
func.func @test_uitofp(%arg0 : i32) -> f32 {
%0 = arith.uitofp %arg0 : i32 to f32
return %0 : f32
}
// CHECK-LABEL: test_uitofp_tensor
func.func @test_uitofp_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xf32> {
%0 = arith.uitofp %arg0 : tensor<8x8xi32> to tensor<8x8xf32>
return %0 : tensor<8x8xf32>
}
// CHECK-LABEL: test_uitofp_vector
func.func @test_uitofp_vector(%arg0 : vector<8xi32>) -> vector<8xf32> {
%0 = arith.uitofp %arg0 : vector<8xi32> to vector<8xf32>
return %0 : vector<8xf32>
}
// CHECK-LABEL: test_uitofp_scalable_vector
func.func @test_uitofp_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xf32> {
%0 = arith.uitofp %arg0 : vector<[8]xi32> to vector<[8]xf32>
return %0 : vector<[8]xf32>
}
// CHECK-LABEL: test_sitofp
func.func @test_sitofp(%arg0 : i16) -> f64 {
%0 = arith.sitofp %arg0 : i16 to f64
return %0 : f64
}
// CHECK-LABEL: test_sitofp_tensor
func.func @test_sitofp_tensor(%arg0 : tensor<8x8xi16>) -> tensor<8x8xf64> {
%0 = arith.sitofp %arg0 : tensor<8x8xi16> to tensor<8x8xf64>
return %0 : tensor<8x8xf64>
}
// CHECK-LABEL: test_sitofp_vector
func.func @test_sitofp_vector(%arg0 : vector<8xi16>) -> vector<8xf64> {
%0 = arith.sitofp %arg0 : vector<8xi16> to vector<8xf64>
return %0 : vector<8xf64>
}
// CHECK-LABEL: test_sitofp_scalable_vector
func.func @test_sitofp_scalable_vector(%arg0 : vector<[8]xi16>) -> vector<[8]xf64> {
%0 = arith.sitofp %arg0 : vector<[8]xi16> to vector<[8]xf64>
return %0 : vector<[8]xf64>
}
// CHECK-LABEL: test_fptoui
func.func @test_fptoui(%arg0 : bf16) -> i8 {
%0 = arith.fptoui %arg0 : bf16 to i8
return %0 : i8
}
// CHECK-LABEL: test_fptoui_tensor
func.func @test_fptoui_tensor(%arg0 : tensor<8x8xbf16>) -> tensor<8x8xi8> {
%0 = arith.fptoui %arg0 : tensor<8x8xbf16> to tensor<8x8xi8>
return %0 : tensor<8x8xi8>
}
// CHECK-LABEL: test_fptoui_vector
func.func @test_fptoui_vector(%arg0 : vector<8xbf16>) -> vector<8xi8> {
%0 = arith.fptoui %arg0 : vector<8xbf16> to vector<8xi8>
return %0 : vector<8xi8>
}
// CHECK-LABEL: test_fptoui_scalable_vector
func.func @test_fptoui_scalable_vector(%arg0 : vector<[8]xbf16>) -> vector<[8]xi8> {
%0 = arith.fptoui %arg0 : vector<[8]xbf16> to vector<[8]xi8>
return %0 : vector<[8]xi8>
}
// CHECK-LABEL: test_fptosi
func.func @test_fptosi(%arg0 : f64) -> i64 {
%0 = arith.fptosi %arg0 : f64 to i64
return %0 : i64
}
// CHECK-LABEL: test_fptosi_tensor
func.func @test_fptosi_tensor(%arg0 : tensor<8x8xf64>) -> tensor<8x8xi64> {
%0 = arith.fptosi %arg0 : tensor<8x8xf64> to tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_fptosi_vector
func.func @test_fptosi_vector(%arg0 : vector<8xf64>) -> vector<8xi64> {
%0 = arith.fptosi %arg0 : vector<8xf64> to vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_fptosi_scalable_vector
func.func @test_fptosi_scalable_vector(%arg0 : vector<[8]xf64>) -> vector<[8]xi64> {
%0 = arith.fptosi %arg0 : vector<[8]xf64> to vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_index_cast0
func.func @test_index_cast0(%arg0 : i32) -> index {
%0 = arith.index_cast %arg0 : i32 to index
return %0 : index
}
// CHECK-LABEL: test_index_cast_tensor0
func.func @test_index_cast_tensor0(%arg0 : tensor<8x8xi32>) -> tensor<8x8xindex> {
%0 = arith.index_cast %arg0 : tensor<8x8xi32> to tensor<8x8xindex>
return %0 : tensor<8x8xindex>
}
// CHECK-LABEL: test_index_cast_vector0
func.func @test_index_cast_vector0(%arg0 : vector<8xi32>) -> vector<8xindex> {
%0 = arith.index_cast %arg0 : vector<8xi32> to vector<8xindex>
return %0 : vector<8xindex>
}
// CHECK-LABEL: test_index_cast_scalable_vector0
func.func @test_index_cast_scalable_vector0(%arg0 : vector<[8]xi32>) -> vector<[8]xindex> {
%0 = arith.index_cast %arg0 : vector<[8]xi32> to vector<[8]xindex>
return %0 : vector<[8]xindex>
}
// CHECK-LABEL: test_index_cast1
func.func @test_index_cast1(%arg0 : index) -> i64 {
%0 = arith.index_cast %arg0 : index to i64
return %0 : i64
}
// CHECK-LABEL: test_index_cast_tensor1
func.func @test_index_cast_tensor1(%arg0 : tensor<8x8xindex>) -> tensor<8x8xi64> {
%0 = arith.index_cast %arg0 : tensor<8x8xindex> to tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_index_cast_vector1
func.func @test_index_cast_vector1(%arg0 : vector<8xindex>) -> vector<8xi64> {
%0 = arith.index_cast %arg0 : vector<8xindex> to vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_index_cast_scalable_vector1
func.func @test_index_cast_scalable_vector1(%arg0 : vector<[8]xindex>) -> vector<[8]xi64> {
%0 = arith.index_cast %arg0 : vector<[8]xindex> to vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_index_castui0
func.func @test_index_castui0(%arg0 : i32) -> index {
%0 = arith.index_castui %arg0 : i32 to index
return %0 : index
}
// CHECK-LABEL: test_index_castui_tensor0
func.func @test_index_castui_tensor0(%arg0 : tensor<8x8xi32>) -> tensor<8x8xindex> {
%0 = arith.index_castui %arg0 : tensor<8x8xi32> to tensor<8x8xindex>
return %0 : tensor<8x8xindex>
}
// CHECK-LABEL: test_index_castui_vector0
func.func @test_index_castui_vector0(%arg0 : vector<8xi32>) -> vector<8xindex> {
%0 = arith.index_castui %arg0 : vector<8xi32> to vector<8xindex>
return %0 : vector<8xindex>
}
// CHECK-LABEL: test_index_castui_scalable_vector0
func.func @test_index_castui_scalable_vector0(%arg0 : vector<[8]xi32>) -> vector<[8]xindex> {
%0 = arith.index_castui %arg0 : vector<[8]xi32> to vector<[8]xindex>
return %0 : vector<[8]xindex>
}
// CHECK-LABEL: test_indexui_cast1
func.func @test_indexui_cast1(%arg0 : index) -> i64 {
%0 = arith.index_castui %arg0 : index to i64
return %0 : i64
}
// CHECK-LABEL: test_index_castui_tensor1
func.func @test_index_castui_tensor1(%arg0 : tensor<8x8xindex>) -> tensor<8x8xi64> {
%0 = arith.index_castui %arg0 : tensor<8x8xindex> to tensor<8x8xi64>
return %0 : tensor<8x8xi64>
}
// CHECK-LABEL: test_index_castui_vector1
func.func @test_index_castui_vector1(%arg0 : vector<8xindex>) -> vector<8xi64> {
%0 = arith.index_castui %arg0 : vector<8xindex> to vector<8xi64>
return %0 : vector<8xi64>
}
// CHECK-LABEL: test_index_castui_scalable_vector1
func.func @test_index_castui_scalable_vector1(%arg0 : vector<[8]xindex>) -> vector<[8]xi64> {
%0 = arith.index_castui %arg0 : vector<[8]xindex> to vector<[8]xi64>
return %0 : vector<[8]xi64>
}
// CHECK-LABEL: test_bitcast0
func.func @test_bitcast0(%arg0 : i64) -> f64 {
%0 = arith.bitcast %arg0 : i64 to f64
return %0 : f64
}
// CHECK-LABEL: test_bitcast_tensor0
func.func @test_bitcast_tensor0(%arg0 : tensor<8x8xi64>) -> tensor<8x8xf64> {
%0 = arith.bitcast %arg0 : tensor<8x8xi64> to tensor<8x8xf64>
return %0 : tensor<8x8xf64>
}
// CHECK-LABEL: test_bitcast_vector0
func.func @test_bitcast_vector0(%arg0 : vector<8xi64>) -> vector<8xf64> {
%0 = arith.bitcast %arg0 : vector<8xi64> to vector<8xf64>
return %0 : vector<8xf64>
}
// CHECK-LABEL: test_bitcast_scalable_vector0
func.func @test_bitcast_scalable_vector0(%arg0 : vector<[8]xi64>) -> vector<[8]xf64> {
%0 = arith.bitcast %arg0 : vector<[8]xi64> to vector<[8]xf64>
return %0 : vector<[8]xf64>
}
// CHECK-LABEL: test_bitcast1
func.func @test_bitcast1(%arg0 : f32) -> i32 {
%0 = arith.bitcast %arg0 : f32 to i32
return %0 : i32
}
// CHECK-LABEL: test_bitcast_tensor1
func.func @test_bitcast_tensor1(%arg0 : tensor<8x8xf32>) -> tensor<8x8xi32> {
%0 = arith.bitcast %arg0 : tensor<8x8xf32> to tensor<8x8xi32>
return %0 : tensor<8x8xi32>
}
// CHECK-LABEL: test_bitcast_vector1
func.func @test_bitcast_vector1(%arg0 : vector<8xf32>) -> vector<8xi32> {
%0 = arith.bitcast %arg0 : vector<8xf32> to vector<8xi32>
return %0 : vector<8xi32>
}
// CHECK-LABEL: test_bitcast_scalable_vector1
func.func @test_bitcast_scalable_vector1(%arg0 : vector<[8]xf32>) -> vector<[8]xi32> {
%0 = arith.bitcast %arg0 : vector<[8]xf32> to vector<[8]xi32>
return %0 : vector<[8]xi32>
}
// CHECK-LABEL: test_cmpi
func.func @test_cmpi(%arg0 : i64, %arg1 : i64) -> i1 {
%0 = arith.cmpi ne, %arg0, %arg1 : i64
return %0 : i1
}
// CHECK-LABEL: test_cmpi_tensor
func.func @test_cmpi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi1> {
%0 = arith.cmpi slt, %arg0, %arg1 : tensor<8x8xi64>
return %0 : tensor<8x8xi1>
}
// CHECK-LABEL: test_cmpi_tensor_encoding
func.func @test_cmpi_tensor_encoding(%arg0 : tensor<8x8xi64, "foo">, %arg1 : tensor<8x8xi64, "foo">) -> tensor<8x8xi1, "foo"> {
%0 = arith.cmpi slt, %arg0, %arg1 : tensor<8x8xi64, "foo">
return %0 : tensor<8x8xi1, "foo">
}
// CHECK-LABEL: test_cmpi_vector
func.func @test_cmpi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi1> {
%0 = arith.cmpi ult, %arg0, %arg1 : vector<8xi64>
return %0 : vector<8xi1>
}
// CHECK-LABEL: test_cmpi_scalable_vector
func.func @test_cmpi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi1> {
%0 = arith.cmpi ult, %arg0, %arg1 : vector<[8]xi64>
return %0 : vector<[8]xi1>
}
// CHECK-LABEL: test_cmpi_vector_0d
func.func @test_cmpi_vector_0d(%arg0 : vector<i64>, %arg1 : vector<i64>) -> vector<i1> {
%0 = arith.cmpi ult, %arg0, %arg1 : vector<i64>
return %0 : vector<i1>
}
// CHECK-LABEL: test_cmpf
func.func @test_cmpf(%arg0 : f64, %arg1 : f64) -> i1 {
%0 = arith.cmpf oeq, %arg0, %arg1 : f64
return %0 : i1
}
// CHECK-LABEL: test_cmpf_tensor
func.func @test_cmpf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xi1> {
%0 = arith.cmpf olt, %arg0, %arg1 : tensor<8x8xf64>
return %0 : tensor<8x8xi1>
}
// CHECK-LABEL: test_cmpf_vector
func.func @test_cmpf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xi1> {
%0 = arith.cmpf ult, %arg0, %arg1 : vector<8xf64>
return %0 : vector<8xi1>
}
// CHECK-LABEL: test_cmpf_scalable_vector
func.func @test_cmpf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xi1> {
%0 = arith.cmpf ult, %arg0, %arg1 : vector<[8]xf64>
return %0 : vector<[8]xi1>
}
// CHECK-LABEL: test_index_cast
func.func @test_index_cast(%arg0 : index) -> i64 {
%0 = arith.index_cast %arg0 : index to i64
return %0 : i64
}
// CHECK-LABEL: test_index_cast_tensor
func.func @test_index_cast_tensor(%arg0 : tensor<index>) -> tensor<i64> {
%0 = arith.index_cast %arg0 : tensor<index> to tensor<i64>
return %0 : tensor<i64>
}
// CHECK-LABEL: test_index_cast_tensor_reverse
func.func @test_index_cast_tensor_reverse(%arg0 : tensor<i64>) -> tensor<index> {
%0 = arith.index_cast %arg0 : tensor<i64> to tensor<index>
return %0 : tensor<index>
}
// CHECK-LABEL: func @bitcast(
func.func @bitcast(%arg : f32) -> i32 {
%res = arith.bitcast %arg : f32 to i32
return %res : i32
}
// CHECK-LABEL: test_constant
func.func @test_constant() -> () {
// CHECK: %c42_i32 = arith.constant 42 : i32
%0 = "arith.constant"(){value = 42 : i32} : () -> i32
// CHECK: %c42_i32_0 = arith.constant 42 : i32
%1 = arith.constant 42 : i32
// CHECK: %c43 = arith.constant {crazy = "func.foo"} 43 : index
%2 = arith.constant {crazy = "func.foo"} 43: index
// CHECK: %cst = arith.constant 4.300000e+01 : bf16
%3 = arith.constant 43.0 : bf16
// CHECK: %cst_1 = arith.constant dense<0> : vector<4xi32>
%4 = arith.constant dense<0> : vector<4 x i32>
// CHECK: %cst_2 = arith.constant dense<0> : tensor<42xi32>
%5 = arith.constant dense<0> : tensor<42 x i32>
// CHECK: %cst_3 = arith.constant dense<0> : vector<42xi32>
%6 = arith.constant dense<0> : vector<42 x i32>
// CHECK: %true = arith.constant true
%7 = arith.constant true
// CHECK: %false = arith.constant false
%8 = arith.constant false
// CHECK: %c-1_i128 = arith.constant -1 : i128
%9 = arith.constant 340282366920938463463374607431768211455 : i128
// CHECK: %c85070591730234615865843651857942052864_i128 = arith.constant 85070591730234615865843651857942052864 : i128
%10 = arith.constant 85070591730234615865843651857942052864 : i128
return
}
// CHECK-LABEL: func @maximum
func.func @maximum(%v1: vector<4xf32>, %v2: vector<4xf32>,
%sv1: vector<[4]xf32>, %sv2: vector<[4]xf32>,
%f1: f32, %f2: f32,
%i1: i32, %i2: i32) {
%max_vector = arith.maxf %v1, %v2 : vector<4xf32>
%max_scalable_vector = arith.maxf %sv1, %sv2 : vector<[4]xf32>
%max_float = arith.maxf %f1, %f2 : f32
%max_signed = arith.maxsi %i1, %i2 : i32
%max_unsigned = arith.maxui %i1, %i2 : i32
return
}
// CHECK-LABEL: func @minimum
func.func @minimum(%v1: vector<4xf32>, %v2: vector<4xf32>,
%sv1: vector<[4]xf32>, %sv2: vector<[4]xf32>,
%f1: f32, %f2: f32,
%i1: i32, %i2: i32) {
%min_vector = arith.minf %v1, %v2 : vector<4xf32>
%min_scalable_vector = arith.minf %sv1, %sv2 : vector<[4]xf32>
%min_float = arith.minf %f1, %f2 : f32
%min_signed = arith.minsi %i1, %i2 : i32
%min_unsigned = arith.minui %i1, %i2 : i32
return
}
// CHECK-LABEL: @fastmath
func.func @fastmath(%arg0: f32, %arg1: f32, %arg2: i32) {
// CHECK: {{.*}} = arith.addf %arg0, %arg1 fastmath<fast> : f32
// CHECK: {{.*}} = arith.subf %arg0, %arg1 fastmath<fast> : f32
// CHECK: {{.*}} = arith.mulf %arg0, %arg1 fastmath<fast> : f32
// CHECK: {{.*}} = arith.divf %arg0, %arg1 fastmath<fast> : f32
// CHECK: {{.*}} = arith.remf %arg0, %arg1 fastmath<fast> : f32
// CHECK: {{.*}} = arith.negf %arg0 fastmath<fast> : f32
%0 = arith.addf %arg0, %arg1 fastmath<fast> : f32
%1 = arith.subf %arg0, %arg1 fastmath<fast> : f32
%2 = arith.mulf %arg0, %arg1 fastmath<fast> : f32
%3 = arith.divf %arg0, %arg1 fastmath<fast> : f32
%4 = arith.remf %arg0, %arg1 fastmath<fast> : f32
%5 = arith.negf %arg0 fastmath<fast> : f32
// CHECK: {{.*}} = arith.addf %arg0, %arg1 : f32
%6 = arith.addf %arg0, %arg1 fastmath<none> : f32
// CHECK: {{.*}} = arith.addf %arg0, %arg1 fastmath<nnan,ninf> : f32
%7 = arith.addf %arg0, %arg1 fastmath<nnan,ninf> : f32
// CHECK: {{.*}} = arith.mulf %arg0, %arg1 fastmath<fast> : f32
%8 = arith.mulf %arg0, %arg1 fastmath<reassoc,nnan,ninf,nsz,arcp,contract,afn> : f32
return
}
// CHECK-LABEL: @select_tensor
func.func @select_tensor(%arg0 : tensor<8xi1>, %arg1 : tensor<8xi32>, %arg2 : tensor<8xi32>) -> tensor<8xi32> {
// CHECK: = arith.select %{{.*}}, %{{.*}}, %{{.*}} : tensor<8xi1>, tensor<8xi32>
%0 = arith.select %arg0, %arg1, %arg2 : tensor<8xi1>, tensor<8xi32>
return %0 : tensor<8xi32>
}
// CHECK-LABEL: @select_tensor_encoding
func.func @select_tensor_encoding(
%arg0 : tensor<8xi1, "foo">, %arg1 : tensor<8xi32, "foo">, %arg2 : tensor<8xi32, "foo">) -> tensor<8xi32, "foo"> {
// CHECK: = arith.select %{{.*}}, %{{.*}}, %{{.*}} : tensor<8xi1, "foo">, tensor<8xi32, "foo">
%0 = arith.select %arg0, %arg1, %arg2 : tensor<8xi1, "foo">, tensor<8xi32, "foo">
return %0 : tensor<8xi32, "foo">
}
|