1190 lines · plain
1// RUN: mlir-opt %s | mlir-opt | FileCheck %s2// RUN: mlir-opt %s --mlir-print-op-generic | mlir-opt | FileCheck %s3 4// CHECK-LABEL: test_addi5func.func @test_addi(%arg0 : i64, %arg1 : i64) -> i64 {6 %0 = arith.addi %arg0, %arg1 : i647 return %0 : i648}9 10// CHECK-LABEL: test_addi_tensor11func.func @test_addi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {12 %0 = arith.addi %arg0, %arg1 : tensor<8x8xi64>13 return %0 : tensor<8x8xi64>14}15 16// CHECK-LABEL: test_addi_vector17func.func @test_addi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {18 %0 = arith.addi %arg0, %arg1 : vector<8xi64>19 return %0 : vector<8xi64>20}21 22// CHECK-LABEL: test_addi_scalable_vector23func.func @test_addi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {24 %0 = arith.addi %arg0, %arg1 : vector<[8]xi64>25 return %0 : vector<[8]xi64>26}27 28// CHECK-LABEL: test_addui_extended29func.func @test_addui_extended(%arg0 : i64, %arg1 : i64) -> i64 {30 %sum, %overflow = arith.addui_extended %arg0, %arg1 : i64, i131 return %sum : i6432}33 34// CHECK-LABEL: test_addui_extended_tensor35func.func @test_addui_extended_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {36 %sum, %overflow = arith.addui_extended %arg0, %arg1 : tensor<8x8xi64>, tensor<8x8xi1>37 return %sum : tensor<8x8xi64>38}39 40// CHECK-LABEL: test_addui_extended_vector41func.func @test_addui_extended_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {42 %0:2 = arith.addui_extended %arg0, %arg1 : vector<8xi64>, vector<8xi1>43 return %0#0 : vector<8xi64>44}45 46// CHECK-LABEL: test_addui_extended_scalable_vector47func.func @test_addui_extended_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {48 %0:2 = arith.addui_extended %arg0, %arg1 : vector<[8]xi64>, vector<[8]xi1>49 return %0#0 : vector<[8]xi64>50}51 52// CHECK-LABEL: test_subi53func.func @test_subi(%arg0 : i64, %arg1 : i64) -> i64 {54 %0 = arith.subi %arg0, %arg1 : i6455 return %0 : i6456}57 58// CHECK-LABEL: test_subi_tensor59func.func @test_subi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {60 %0 = arith.subi %arg0, %arg1 : tensor<8x8xi64>61 return %0 : tensor<8x8xi64>62}63 64// CHECK-LABEL: test_subi_vector65func.func @test_subi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {66 %0 = arith.subi %arg0, %arg1 : vector<8xi64>67 return %0 : vector<8xi64>68}69 70// CHECK-LABEL: test_subi_scalable_vector71func.func @test_subi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {72 %0 = arith.subi %arg0, %arg1 : vector<[8]xi64>73 return %0 : vector<[8]xi64>74}75 76// CHECK-LABEL: test_muli77func.func @test_muli(%arg0 : i64, %arg1 : i64) -> i64 {78 %0 = arith.muli %arg0, %arg1 : i6479 return %0 : i6480}81 82// CHECK-LABEL: test_muli_tensor83func.func @test_muli_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {84 %0 = arith.muli %arg0, %arg1 : tensor<8x8xi64>85 return %0 : tensor<8x8xi64>86}87 88// CHECK-LABEL: test_muli_vector89func.func @test_muli_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {90 %0 = arith.muli %arg0, %arg1 : vector<8xi64>91 return %0 : vector<8xi64>92}93 94// CHECK-LABEL: test_muli_scalable_vector95func.func @test_muli_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {96 %0 = arith.muli %arg0, %arg1 : vector<[8]xi64>97 return %0 : vector<[8]xi64>98}99 100// CHECK-LABEL: test_mulsi_extended101func.func @test_mulsi_extended(%arg0 : i32, %arg1 : i32) -> i32 {102 %low, %high = arith.mulsi_extended %arg0, %arg1 : i32103 return %high : i32104}105 106// CHECK-LABEL: test_mulsi_extended_tensor107func.func @test_mulsi_extended_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {108 %low, %high = arith.mulsi_extended %arg0, %arg1 : tensor<8x8xi64>109 return %high : tensor<8x8xi64>110}111 112// CHECK-LABEL: test_mulsi_extended_vector113func.func @test_mulsi_extended_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {114 %0:2 = arith.mulsi_extended %arg0, %arg1 : vector<8xi64>115 return %0#0 : vector<8xi64>116}117 118// CHECK-LABEL: test_mulsi_extended_scalable_vector119func.func @test_mulsi_extended_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {120 %0:2 = arith.mulsi_extended %arg0, %arg1 : vector<[8]xi64>121 return %0#1 : vector<[8]xi64>122}123 124// CHECK-LABEL: test_mului_extended125func.func @test_mului_extended(%arg0 : i32, %arg1 : i32) -> i32 {126 %low, %high = arith.mului_extended %arg0, %arg1 : i32127 return %high : i32128}129 130// CHECK-LABEL: test_mului_extended_tensor131func.func @test_mului_extended_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {132 %low, %high = arith.mului_extended %arg0, %arg1 : tensor<8x8xi64>133 return %high : tensor<8x8xi64>134}135 136// CHECK-LABEL: test_mului_extended_vector137func.func @test_mului_extended_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {138 %0:2 = arith.mului_extended %arg0, %arg1 : vector<8xi64>139 return %0#0 : vector<8xi64>140}141 142// CHECK-LABEL: test_mului_extended_scalable_vector143func.func @test_mului_extended_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {144 %0:2 = arith.mului_extended %arg0, %arg1 : vector<[8]xi64>145 return %0#1 : vector<[8]xi64>146}147 148// CHECK-LABEL: test_divui149func.func @test_divui(%arg0 : i64, %arg1 : i64) -> i64 {150 %0 = arith.divui %arg0, %arg1 : i64151 return %0 : i64152}153 154// CHECK-LABEL: test_divui_exact155func.func @test_divui_exact(%arg0 : i64, %arg1 : i64) -> i64 {156 %0 = arith.divui %arg0, %arg1 exact : i64157 return %0 : i64158}159 160// CHECK-LABEL: test_divui_tensor161func.func @test_divui_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {162 %0 = arith.divui %arg0, %arg1 : tensor<8x8xi64>163 return %0 : tensor<8x8xi64>164}165 166// CHECK-LABEL: test_divui_vector167func.func @test_divui_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {168 %0 = arith.divui %arg0, %arg1 : vector<8xi64>169 return %0 : vector<8xi64>170}171 172// CHECK-LABEL: test_divui_scalable_vector173func.func @test_divui_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {174 %0 = arith.divui %arg0, %arg1 : vector<[8]xi64>175 return %0 : vector<[8]xi64>176}177 178// CHECK-LABEL: test_divsi179func.func @test_divsi(%arg0 : i64, %arg1 : i64) -> i64 {180 %0 = arith.divsi %arg0, %arg1 : i64181 return %0 : i64182}183 184// CHECK-LABEL: test_divsi_exact185func.func @test_divsi_exact(%arg0 : i64, %arg1 : i64) -> i64 {186 %0 = arith.divsi %arg0, %arg1 exact : i64187 return %0 : i64188}189 190// CHECK-LABEL: test_divsi_tensor191func.func @test_divsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {192 %0 = arith.divsi %arg0, %arg1 : tensor<8x8xi64>193 return %0 : tensor<8x8xi64>194}195 196// CHECK-LABEL: test_divsi_vector197func.func @test_divsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {198 %0 = arith.divsi %arg0, %arg1 : vector<8xi64>199 return %0 : vector<8xi64>200}201 202// CHECK-LABEL: test_divsi_scalable_vector203func.func @test_divsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {204 %0 = arith.divsi %arg0, %arg1 : vector<[8]xi64>205 return %0 : vector<[8]xi64>206}207 208// CHECK-LABEL: test_remui209func.func @test_remui(%arg0 : i64, %arg1 : i64) -> i64 {210 %0 = arith.remui %arg0, %arg1 : i64211 return %0 : i64212}213 214// CHECK-LABEL: test_remui_tensor215func.func @test_remui_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {216 %0 = arith.remui %arg0, %arg1 : tensor<8x8xi64>217 return %0 : tensor<8x8xi64>218}219 220// CHECK-LABEL: test_remui_vector221func.func @test_remui_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {222 %0 = arith.remui %arg0, %arg1 : vector<8xi64>223 return %0 : vector<8xi64>224}225 226// CHECK-LABEL: test_remui_scalable_vector227func.func @test_remui_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {228 %0 = arith.remui %arg0, %arg1 : vector<[8]xi64>229 return %0 : vector<[8]xi64>230}231 232// CHECK-LABEL: test_remsi233func.func @test_remsi(%arg0 : i64, %arg1 : i64) -> i64 {234 %0 = arith.remsi %arg0, %arg1 : i64235 return %0 : i64236}237 238// CHECK-LABEL: test_remsi_tensor239func.func @test_remsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {240 %0 = arith.remsi %arg0, %arg1 : tensor<8x8xi64>241 return %0 : tensor<8x8xi64>242}243 244// CHECK-LABEL: test_remsi_vector245func.func @test_remsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {246 %0 = arith.remsi %arg0, %arg1 : vector<8xi64>247 return %0 : vector<8xi64>248}249 250// CHECK-LABEL: test_remsi_scalable_vector251func.func @test_remsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {252 %0 = arith.remsi %arg0, %arg1 : vector<[8]xi64>253 return %0 : vector<[8]xi64>254}255 256// CHECK-LABEL: test_andi257func.func @test_andi(%arg0 : i64, %arg1 : i64) -> i64 {258 %0 = arith.andi %arg0, %arg1 : i64259 return %0 : i64260}261 262// CHECK-LABEL: test_andi_tensor263func.func @test_andi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {264 %0 = arith.andi %arg0, %arg1 : tensor<8x8xi64>265 return %0 : tensor<8x8xi64>266}267 268// CHECK-LABEL: test_andi_vector269func.func @test_andi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {270 %0 = arith.andi %arg0, %arg1 : vector<8xi64>271 return %0 : vector<8xi64>272}273 274// CHECK-LABEL: test_andi_scalable_vector275func.func @test_andi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {276 %0 = arith.andi %arg0, %arg1 : vector<[8]xi64>277 return %0 : vector<[8]xi64>278}279 280// CHECK-LABEL: test_ori281func.func @test_ori(%arg0 : i64, %arg1 : i64) -> i64 {282 %0 = arith.ori %arg0, %arg1 : i64283 return %0 : i64284}285 286// CHECK-LABEL: test_ori_tensor287func.func @test_ori_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {288 %0 = arith.ori %arg0, %arg1 : tensor<8x8xi64>289 return %0 : tensor<8x8xi64>290}291 292// CHECK-LABEL: test_ori_vector293func.func @test_ori_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {294 %0 = arith.ori %arg0, %arg1 : vector<8xi64>295 return %0 : vector<8xi64>296}297 298// CHECK-LABEL: test_ori_scalable_vector299func.func @test_ori_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {300 %0 = arith.ori %arg0, %arg1 : vector<[8]xi64>301 return %0 : vector<[8]xi64>302}303 304// CHECK-LABEL: test_xori305func.func @test_xori(%arg0 : i64, %arg1 : i64) -> i64 {306 %0 = arith.xori %arg0, %arg1 : i64307 return %0 : i64308}309 310// CHECK-LABEL: test_xori_tensor311func.func @test_xori_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {312 %0 = arith.xori %arg0, %arg1 : tensor<8x8xi64>313 return %0 : tensor<8x8xi64>314}315 316// CHECK-LABEL: test_xori_vector317func.func @test_xori_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {318 %0 = arith.xori %arg0, %arg1 : vector<8xi64>319 return %0 : vector<8xi64>320}321 322// CHECK-LABEL: test_xori_scalable_vector323func.func @test_xori_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {324 %0 = arith.xori %arg0, %arg1 : vector<[8]xi64>325 return %0 : vector<[8]xi64>326}327 328// CHECK-LABEL: test_ceildivsi329func.func @test_ceildivsi(%arg0 : i64, %arg1 : i64) -> i64 {330 %0 = arith.ceildivsi %arg0, %arg1 : i64331 return %0 : i64332}333 334// CHECK-LABEL: test_ceildivsi_tensor335func.func @test_ceildivsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {336 %0 = arith.ceildivsi %arg0, %arg1 : tensor<8x8xi64>337 return %0 : tensor<8x8xi64>338}339 340// CHECK-LABEL: test_ceildivsi_vector341func.func @test_ceildivsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {342 %0 = arith.ceildivsi %arg0, %arg1 : vector<8xi64>343 return %0 : vector<8xi64>344}345 346// CHECK-LABEL: test_ceildivsi_scalable_vector347func.func @test_ceildivsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {348 %0 = arith.ceildivsi %arg0, %arg1 : vector<[8]xi64>349 return %0 : vector<[8]xi64>350}351 352// CHECK-LABEL: test_floordivsi353func.func @test_floordivsi(%arg0 : i64, %arg1 : i64) -> i64 {354 %0 = arith.floordivsi %arg0, %arg1 : i64355 return %0 : i64356}357 358// CHECK-LABEL: test_floordivsi_tensor359func.func @test_floordivsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {360 %0 = arith.floordivsi %arg0, %arg1 : tensor<8x8xi64>361 return %0 : tensor<8x8xi64>362}363 364// CHECK-LABEL: test_floordivsi_vector365func.func @test_floordivsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {366 %0 = arith.floordivsi %arg0, %arg1 : vector<8xi64>367 return %0 : vector<8xi64>368}369 370// CHECK-LABEL: test_floordivsi_scalable_vector371func.func @test_floordivsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {372 %0 = arith.floordivsi %arg0, %arg1 : vector<[8]xi64>373 return %0 : vector<[8]xi64>374}375 376// CHECK-LABEL: test_shli377func.func @test_shli(%arg0 : i64, %arg1 : i64) -> i64 {378 %0 = arith.shli %arg0, %arg1 : i64379 return %0 : i64380}381 382// CHECK-LABEL: test_shli_tensor383func.func @test_shli_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {384 %0 = arith.shli %arg0, %arg1 : tensor<8x8xi64>385 return %0 : tensor<8x8xi64>386}387 388// CHECK-LABEL: test_shli_vector389func.func @test_shli_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {390 %0 = arith.shli %arg0, %arg1 : vector<8xi64>391 return %0 : vector<8xi64>392}393 394// CHECK-LABEL: test_shli_scalable_vector395func.func @test_shli_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {396 %0 = arith.shli %arg0, %arg1 : vector<[8]xi64>397 return %0 : vector<[8]xi64>398}399 400// CHECK-LABEL: test_shrui401func.func @test_shrui(%arg0 : i64, %arg1 : i64) -> i64 {402 %0 = arith.shrui %arg0, %arg1 : i64403 return %0 : i64404}405 406// CHECK-LABEL: test_shrui_exact407func.func @test_shrui_exact(%arg0 : i64, %arg1 : i64) -> i64 {408 %0 = arith.shrui %arg0, %arg1 exact : i64409 return %0 : i64410}411 412// CHECK-LABEL: test_shrui_tensor413func.func @test_shrui_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {414 %0 = arith.shrui %arg0, %arg1 : tensor<8x8xi64>415 return %0 : tensor<8x8xi64>416}417 418// CHECK-LABEL: test_shrui_vector419func.func @test_shrui_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {420 %0 = arith.shrui %arg0, %arg1 : vector<8xi64>421 return %0 : vector<8xi64>422}423 424// CHECK-LABEL: test_shrui_scalable_vector425func.func @test_shrui_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {426 %0 = arith.shrui %arg0, %arg1 : vector<[8]xi64>427 return %0 : vector<[8]xi64>428}429 430// CHECK-LABEL: test_shrsi431func.func @test_shrsi(%arg0 : i64, %arg1 : i64) -> i64 {432 %0 = arith.shrsi %arg0, %arg1 : i64433 return %0 : i64434}435 436// CHECK-LABEL: test_shrsi_exact437func.func @test_shrsi_exact(%arg0 : i64, %arg1 : i64) -> i64 {438 %0 = arith.shrsi %arg0, %arg1 exact : i64439 return %0 : i64440}441 442// CHECK-LABEL: test_shrsi_tensor443func.func @test_shrsi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi64> {444 %0 = arith.shrsi %arg0, %arg1 : tensor<8x8xi64>445 return %0 : tensor<8x8xi64>446}447 448// CHECK-LABEL: test_shrsi_vector449func.func @test_shrsi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi64> {450 %0 = arith.shrsi %arg0, %arg1 : vector<8xi64>451 return %0 : vector<8xi64>452}453 454// CHECK-LABEL: test_shrsi_scalable_vector455func.func @test_shrsi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi64> {456 %0 = arith.shrsi %arg0, %arg1 : vector<[8]xi64>457 return %0 : vector<[8]xi64>458}459 460// CHECK-LABEL: test_negf461func.func @test_negf(%arg0 : f64) -> f64 {462 %0 = arith.negf %arg0 : f64463 return %0 : f64464}465 466// CHECK-LABEL: test_negf_tensor467func.func @test_negf_tensor(%arg0 : tensor<8x8xf64>) -> tensor<8x8xf64> {468 %0 = arith.negf %arg0 : tensor<8x8xf64>469 return %0 : tensor<8x8xf64>470}471 472// CHECK-LABEL: test_negf_vector473func.func @test_negf_vector(%arg0 : vector<8xf64>) -> vector<8xf64> {474 %0 = arith.negf %arg0 : vector<8xf64>475 return %0 : vector<8xf64>476}477 478// CHECK-LABEL: test_negf_scalable_vector479func.func @test_negf_scalable_vector(%arg0 : vector<[8]xf64>) -> vector<[8]xf64> {480 %0 = arith.negf %arg0 : vector<[8]xf64>481 return %0 : vector<[8]xf64>482}483 484// CHECK-LABEL: test_addf485func.func @test_addf(%arg0 : f64, %arg1 : f64) -> f64 {486 %0 = arith.addf %arg0, %arg1 : f64487 return %0 : f64488}489 490// CHECK-LABEL: test_addf_tensor491func.func @test_addf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {492 %0 = arith.addf %arg0, %arg1 : tensor<8x8xf64>493 return %0 : tensor<8x8xf64>494}495 496// CHECK-LABEL: test_addf_vector497func.func @test_addf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {498 %0 = arith.addf %arg0, %arg1 : vector<8xf64>499 return %0 : vector<8xf64>500}501 502// CHECK-LABEL: test_addf_scalable_vector503func.func @test_addf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {504 %0 = arith.addf %arg0, %arg1 : vector<[8]xf64>505 return %0 : vector<[8]xf64>506}507 508// CHECK-LABEL: test_subf509func.func @test_subf(%arg0 : f64, %arg1 : f64) -> f64 {510 %0 = arith.subf %arg0, %arg1 : f64511 return %0 : f64512}513 514// CHECK-LABEL: test_subf_tensor515func.func @test_subf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {516 %0 = arith.subf %arg0, %arg1 : tensor<8x8xf64>517 return %0 : tensor<8x8xf64>518}519 520// CHECK-LABEL: test_subf_vector521func.func @test_subf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {522 %0 = arith.subf %arg0, %arg1 : vector<8xf64>523 return %0 : vector<8xf64>524}525 526// CHECK-LABEL: test_subf_scalable_vector527func.func @test_subf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {528 %0 = arith.subf %arg0, %arg1 : vector<[8]xf64>529 return %0 : vector<[8]xf64>530}531 532// CHECK-LABEL: test_mulf533func.func @test_mulf(%arg0 : f64, %arg1 : f64) -> f64 {534 %0 = arith.mulf %arg0, %arg1 : f64535 return %0 : f64536}537 538// CHECK-LABEL: test_mulf_tensor539func.func @test_mulf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {540 %0 = arith.mulf %arg0, %arg1 : tensor<8x8xf64>541 return %0 : tensor<8x8xf64>542}543 544// CHECK-LABEL: test_mulf_vector545func.func @test_mulf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {546 %0 = arith.mulf %arg0, %arg1 : vector<8xf64>547 return %0 : vector<8xf64>548}549 550// CHECK-LABEL: test_mulf_scalable_vector551func.func @test_mulf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {552 %0 = arith.mulf %arg0, %arg1 : vector<[8]xf64>553 return %0 : vector<[8]xf64>554}555 556// CHECK-LABEL: test_divf557func.func @test_divf(%arg0 : f64, %arg1 : f64) -> f64 {558 %0 = arith.divf %arg0, %arg1 : f64559 return %0 : f64560}561 562// CHECK-LABEL: test_divf_tensor563func.func @test_divf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {564 %0 = arith.divf %arg0, %arg1 : tensor<8x8xf64>565 return %0 : tensor<8x8xf64>566}567 568// CHECK-LABEL: test_divf_vector569func.func @test_divf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {570 %0 = arith.divf %arg0, %arg1 : vector<8xf64>571 return %0 : vector<8xf64>572}573 574// CHECK-LABEL: test_divf_scalable_vector575func.func @test_divf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {576 %0 = arith.divf %arg0, %arg1 : vector<[8]xf64>577 return %0 : vector<[8]xf64>578}579 580// CHECK-LABEL: test_remf581func.func @test_remf(%arg0 : f64, %arg1 : f64) -> f64 {582 %0 = arith.remf %arg0, %arg1 : f64583 return %0 : f64584}585 586// CHECK-LABEL: test_remf_tensor587func.func @test_remf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xf64> {588 %0 = arith.remf %arg0, %arg1 : tensor<8x8xf64>589 return %0 : tensor<8x8xf64>590}591 592// CHECK-LABEL: test_remf_vector593func.func @test_remf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xf64> {594 %0 = arith.remf %arg0, %arg1 : vector<8xf64>595 return %0 : vector<8xf64>596}597 598// CHECK-LABEL: test_remf_scalable_vector599func.func @test_remf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xf64> {600 %0 = arith.remf %arg0, %arg1 : vector<[8]xf64>601 return %0 : vector<[8]xf64>602}603 604// CHECK-LABEL: test_extui605func.func @test_extui(%arg0 : i32) -> i64 {606 %0 = arith.extui %arg0 : i32 to i64607 return %0 : i64608}609 610// CHECK-LABEL: test_extui_tensor611func.func @test_extui_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xi64> {612 %0 = arith.extui %arg0 : tensor<8x8xi32> to tensor<8x8xi64>613 return %0 : tensor<8x8xi64>614}615 616// CHECK-LABEL: test_extui_vector617func.func @test_extui_vector(%arg0 : vector<8xi32>) -> vector<8xi64> {618 %0 = arith.extui %arg0 : vector<8xi32> to vector<8xi64>619 return %0 : vector<8xi64>620}621 622// CHECK-LABEL: test_extui_scalable_vector623func.func @test_extui_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xi64> {624 %0 = arith.extui %arg0 : vector<[8]xi32> to vector<[8]xi64>625 return %0 : vector<[8]xi64>626}627 628// CHECK-LABEL: test_extsi629func.func @test_extsi(%arg0 : i32) -> i64 {630 %0 = arith.extsi %arg0 : i32 to i64631 return %0 : i64632}633 634// CHECK-LABEL: test_extsi_tensor635func.func @test_extsi_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xi64> {636 %0 = arith.extsi %arg0 : tensor<8x8xi32> to tensor<8x8xi64>637 return %0 : tensor<8x8xi64>638}639 640// CHECK-LABEL: test_extsi_vector641func.func @test_extsi_vector(%arg0 : vector<8xi32>) -> vector<8xi64> {642 %0 = arith.extsi %arg0 : vector<8xi32> to vector<8xi64>643 return %0 : vector<8xi64>644}645 646// CHECK-LABEL: test_extsi_scalable_vector647func.func @test_extsi_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xi64> {648 %0 = arith.extsi %arg0 : vector<[8]xi32> to vector<[8]xi64>649 return %0 : vector<[8]xi64>650}651 652// CHECK-LABEL: test_extf653func.func @test_extf(%arg0 : f32) -> f64 {654 %0 = arith.extf %arg0 : f32 to f64655 return %0 : f64656}657 658// CHECK-LABEL: test_extf_tensor659func.func @test_extf_tensor(%arg0 : tensor<8x8xf32>) -> tensor<8x8xf64> {660 %0 = arith.extf %arg0 : tensor<8x8xf32> to tensor<8x8xf64>661 return %0 : tensor<8x8xf64>662}663 664// CHECK-LABEL: test_extf_tensor_encoding665func.func @test_extf_tensor_encoding(%arg0 : tensor<8x8xf32, "foo">) -> tensor<8x8xf64, "foo"> {666 %0 = arith.extf %arg0 : tensor<8x8xf32, "foo"> to tensor<8x8xf64, "foo">667 return %0 : tensor<8x8xf64, "foo">668}669 670// CHECK-LABEL: test_extf_vector671func.func @test_extf_vector(%arg0 : vector<8xf32>) -> vector<8xf64> {672 %0 = arith.extf %arg0 : vector<8xf32> to vector<8xf64>673 return %0 : vector<8xf64>674}675 676// CHECK-LABEL: test_extf_scalable_vector677func.func @test_extf_scalable_vector(%arg0 : vector<[8]xf32>) -> vector<[8]xf64> {678 %0 = arith.extf %arg0 : vector<[8]xf32> to vector<[8]xf64>679 return %0 : vector<[8]xf64>680}681 682// CHECK-LABEL: test_trunci683func.func @test_trunci(%arg0 : i32) -> i16 {684 %0 = arith.trunci %arg0 : i32 to i16685 return %0 : i16686}687 688// CHECK-LABEL: test_trunci_tensor689func.func @test_trunci_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xi16> {690 %0 = arith.trunci %arg0 : tensor<8x8xi32> to tensor<8x8xi16>691 return %0 : tensor<8x8xi16>692}693 694// CHECK-LABEL: test_trunci_vector695func.func @test_trunci_vector(%arg0 : vector<8xi32>) -> vector<8xi16> {696 %0 = arith.trunci %arg0 : vector<8xi32> to vector<8xi16>697 return %0 : vector<8xi16>698}699 700// CHECK-LABEL: test_trunci_scalable_vector701func.func @test_trunci_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xi16> {702 %0 = arith.trunci %arg0 : vector<[8]xi32> to vector<[8]xi16>703 return %0 : vector<[8]xi16>704}705 706// CHECK-LABEL: test_truncf707func.func @test_truncf(%arg0 : f32) -> bf16 {708 %0 = arith.truncf %arg0 : f32 to bf16709 return %0 : bf16710}711 712// CHECK-LABEL: test_truncf_tensor713func.func @test_truncf_tensor(%arg0 : tensor<8x8xf32>) -> tensor<8x8xbf16> {714 %0 = arith.truncf %arg0 : tensor<8x8xf32> to tensor<8x8xbf16>715 return %0 : tensor<8x8xbf16>716}717 718// CHECK-LABEL: test_truncf_vector719func.func @test_truncf_vector(%arg0 : vector<8xf32>) -> vector<8xbf16> {720 %0 = arith.truncf %arg0 : vector<8xf32> to vector<8xbf16>721 return %0 : vector<8xbf16>722}723 724// CHECK-LABEL: test_truncf_scalable_vector725func.func @test_truncf_scalable_vector(%arg0 : vector<[8]xf32>) -> vector<[8]xbf16> {726 %0 = arith.truncf %arg0 : vector<[8]xf32> to vector<[8]xbf16>727 return %0 : vector<[8]xbf16>728}729 730// CHECK-LABEL: test_truncf_rounding_mode731func.func @test_truncf_rounding_mode(%arg0 : f64) -> (f32, f32, f32, f32, f32) {732 %0 = arith.truncf %arg0 to_nearest_even : f64 to f32733 %1 = arith.truncf %arg0 downward : f64 to f32734 %2 = arith.truncf %arg0 upward : f64 to f32735 %3 = arith.truncf %arg0 toward_zero : f64 to f32736 %4 = arith.truncf %arg0 to_nearest_away : f64 to f32737 return %0, %1, %2, %3, %4 : f32, f32, f32, f32, f32738}739 740// CHECK-LABEL: test_uitofp741func.func @test_uitofp(%arg0 : i32) -> f32 {742 %0 = arith.uitofp %arg0 : i32 to f32743 return %0 : f32744}745 746// CHECK-LABEL: test_uitofp_tensor747func.func @test_uitofp_tensor(%arg0 : tensor<8x8xi32>) -> tensor<8x8xf32> {748 %0 = arith.uitofp %arg0 : tensor<8x8xi32> to tensor<8x8xf32>749 return %0 : tensor<8x8xf32>750}751 752// CHECK-LABEL: test_uitofp_vector753func.func @test_uitofp_vector(%arg0 : vector<8xi32>) -> vector<8xf32> {754 %0 = arith.uitofp %arg0 : vector<8xi32> to vector<8xf32>755 return %0 : vector<8xf32>756}757 758// CHECK-LABEL: test_uitofp_scalable_vector759func.func @test_uitofp_scalable_vector(%arg0 : vector<[8]xi32>) -> vector<[8]xf32> {760 %0 = arith.uitofp %arg0 : vector<[8]xi32> to vector<[8]xf32>761 return %0 : vector<[8]xf32>762}763 764// CHECK-LABEL: test_sitofp765func.func @test_sitofp(%arg0 : i16) -> f64 {766 %0 = arith.sitofp %arg0 : i16 to f64767 return %0 : f64768}769 770// CHECK-LABEL: test_sitofp_tensor771func.func @test_sitofp_tensor(%arg0 : tensor<8x8xi16>) -> tensor<8x8xf64> {772 %0 = arith.sitofp %arg0 : tensor<8x8xi16> to tensor<8x8xf64>773 return %0 : tensor<8x8xf64>774}775 776// CHECK-LABEL: test_sitofp_vector777func.func @test_sitofp_vector(%arg0 : vector<8xi16>) -> vector<8xf64> {778 %0 = arith.sitofp %arg0 : vector<8xi16> to vector<8xf64>779 return %0 : vector<8xf64>780}781 782// CHECK-LABEL: test_sitofp_scalable_vector783func.func @test_sitofp_scalable_vector(%arg0 : vector<[8]xi16>) -> vector<[8]xf64> {784 %0 = arith.sitofp %arg0 : vector<[8]xi16> to vector<[8]xf64>785 return %0 : vector<[8]xf64>786}787 788// CHECK-LABEL: test_fptoui789func.func @test_fptoui(%arg0 : bf16) -> i8 {790 %0 = arith.fptoui %arg0 : bf16 to i8791 return %0 : i8792}793 794// CHECK-LABEL: test_fptoui_tensor795func.func @test_fptoui_tensor(%arg0 : tensor<8x8xbf16>) -> tensor<8x8xi8> {796 %0 = arith.fptoui %arg0 : tensor<8x8xbf16> to tensor<8x8xi8>797 return %0 : tensor<8x8xi8>798}799 800// CHECK-LABEL: test_fptoui_vector801func.func @test_fptoui_vector(%arg0 : vector<8xbf16>) -> vector<8xi8> {802 %0 = arith.fptoui %arg0 : vector<8xbf16> to vector<8xi8>803 return %0 : vector<8xi8>804}805 806// CHECK-LABEL: test_fptoui_scalable_vector807func.func @test_fptoui_scalable_vector(%arg0 : vector<[8]xbf16>) -> vector<[8]xi8> {808 %0 = arith.fptoui %arg0 : vector<[8]xbf16> to vector<[8]xi8>809 return %0 : vector<[8]xi8>810}811 812// CHECK-LABEL: test_fptosi813func.func @test_fptosi(%arg0 : f64) -> i64 {814 %0 = arith.fptosi %arg0 : f64 to i64815 return %0 : i64816}817 818// CHECK-LABEL: test_fptosi_tensor819func.func @test_fptosi_tensor(%arg0 : tensor<8x8xf64>) -> tensor<8x8xi64> {820 %0 = arith.fptosi %arg0 : tensor<8x8xf64> to tensor<8x8xi64>821 return %0 : tensor<8x8xi64>822}823 824// CHECK-LABEL: test_fptosi_vector825func.func @test_fptosi_vector(%arg0 : vector<8xf64>) -> vector<8xi64> {826 %0 = arith.fptosi %arg0 : vector<8xf64> to vector<8xi64>827 return %0 : vector<8xi64>828}829 830// CHECK-LABEL: test_fptosi_scalable_vector831func.func @test_fptosi_scalable_vector(%arg0 : vector<[8]xf64>) -> vector<[8]xi64> {832 %0 = arith.fptosi %arg0 : vector<[8]xf64> to vector<[8]xi64>833 return %0 : vector<[8]xi64>834}835 836// CHECK-LABEL: test_index_cast0837func.func @test_index_cast0(%arg0 : i32) -> index {838 %0 = arith.index_cast %arg0 : i32 to index839 return %0 : index840}841 842// CHECK-LABEL: test_index_cast_tensor0843func.func @test_index_cast_tensor0(%arg0 : tensor<8x8xi32>) -> tensor<8x8xindex> {844 %0 = arith.index_cast %arg0 : tensor<8x8xi32> to tensor<8x8xindex>845 return %0 : tensor<8x8xindex>846}847 848// CHECK-LABEL: test_index_cast_vector0849func.func @test_index_cast_vector0(%arg0 : vector<8xi32>) -> vector<8xindex> {850 %0 = arith.index_cast %arg0 : vector<8xi32> to vector<8xindex>851 return %0 : vector<8xindex>852}853 854// CHECK-LABEL: test_index_cast_scalable_vector0855func.func @test_index_cast_scalable_vector0(%arg0 : vector<[8]xi32>) -> vector<[8]xindex> {856 %0 = arith.index_cast %arg0 : vector<[8]xi32> to vector<[8]xindex>857 return %0 : vector<[8]xindex>858}859 860// CHECK-LABEL: test_index_cast1861func.func @test_index_cast1(%arg0 : index) -> i64 {862 %0 = arith.index_cast %arg0 : index to i64863 return %0 : i64864}865 866// CHECK-LABEL: test_index_cast_tensor1867func.func @test_index_cast_tensor1(%arg0 : tensor<8x8xindex>) -> tensor<8x8xi64> {868 %0 = arith.index_cast %arg0 : tensor<8x8xindex> to tensor<8x8xi64>869 return %0 : tensor<8x8xi64>870}871 872// CHECK-LABEL: test_index_cast_vector1873func.func @test_index_cast_vector1(%arg0 : vector<8xindex>) -> vector<8xi64> {874 %0 = arith.index_cast %arg0 : vector<8xindex> to vector<8xi64>875 return %0 : vector<8xi64>876}877 878// CHECK-LABEL: test_index_cast_scalable_vector1879func.func @test_index_cast_scalable_vector1(%arg0 : vector<[8]xindex>) -> vector<[8]xi64> {880 %0 = arith.index_cast %arg0 : vector<[8]xindex> to vector<[8]xi64>881 return %0 : vector<[8]xi64>882}883 884 885// CHECK-LABEL: test_index_castui0886func.func @test_index_castui0(%arg0 : i32) -> index {887 %0 = arith.index_castui %arg0 : i32 to index888 return %0 : index889}890 891// CHECK-LABEL: test_index_castui_tensor0892func.func @test_index_castui_tensor0(%arg0 : tensor<8x8xi32>) -> tensor<8x8xindex> {893 %0 = arith.index_castui %arg0 : tensor<8x8xi32> to tensor<8x8xindex>894 return %0 : tensor<8x8xindex>895}896 897// CHECK-LABEL: test_index_castui_vector0898func.func @test_index_castui_vector0(%arg0 : vector<8xi32>) -> vector<8xindex> {899 %0 = arith.index_castui %arg0 : vector<8xi32> to vector<8xindex>900 return %0 : vector<8xindex>901}902 903// CHECK-LABEL: test_index_castui_scalable_vector0904func.func @test_index_castui_scalable_vector0(%arg0 : vector<[8]xi32>) -> vector<[8]xindex> {905 %0 = arith.index_castui %arg0 : vector<[8]xi32> to vector<[8]xindex>906 return %0 : vector<[8]xindex>907}908 909// CHECK-LABEL: test_indexui_cast1910func.func @test_indexui_cast1(%arg0 : index) -> i64 {911 %0 = arith.index_castui %arg0 : index to i64912 return %0 : i64913}914 915// CHECK-LABEL: test_index_castui_tensor1916func.func @test_index_castui_tensor1(%arg0 : tensor<8x8xindex>) -> tensor<8x8xi64> {917 %0 = arith.index_castui %arg0 : tensor<8x8xindex> to tensor<8x8xi64>918 return %0 : tensor<8x8xi64>919}920 921// CHECK-LABEL: test_index_castui_vector1922func.func @test_index_castui_vector1(%arg0 : vector<8xindex>) -> vector<8xi64> {923 %0 = arith.index_castui %arg0 : vector<8xindex> to vector<8xi64>924 return %0 : vector<8xi64>925}926 927// CHECK-LABEL: test_index_castui_scalable_vector1928func.func @test_index_castui_scalable_vector1(%arg0 : vector<[8]xindex>) -> vector<[8]xi64> {929 %0 = arith.index_castui %arg0 : vector<[8]xindex> to vector<[8]xi64>930 return %0 : vector<[8]xi64>931}932 933// CHECK-LABEL: test_bitcast0934func.func @test_bitcast0(%arg0 : i64) -> f64 {935 %0 = arith.bitcast %arg0 : i64 to f64936 return %0 : f64937}938 939// CHECK-LABEL: test_bitcast_tensor0940func.func @test_bitcast_tensor0(%arg0 : tensor<8x8xi64>) -> tensor<8x8xf64> {941 %0 = arith.bitcast %arg0 : tensor<8x8xi64> to tensor<8x8xf64>942 return %0 : tensor<8x8xf64>943}944 945// CHECK-LABEL: test_bitcast_vector0946func.func @test_bitcast_vector0(%arg0 : vector<8xi64>) -> vector<8xf64> {947 %0 = arith.bitcast %arg0 : vector<8xi64> to vector<8xf64>948 return %0 : vector<8xf64>949}950 951// CHECK-LABEL: test_bitcast_scalable_vector0952func.func @test_bitcast_scalable_vector0(%arg0 : vector<[8]xi64>) -> vector<[8]xf64> {953 %0 = arith.bitcast %arg0 : vector<[8]xi64> to vector<[8]xf64>954 return %0 : vector<[8]xf64>955}956 957// CHECK-LABEL: test_bitcast1958func.func @test_bitcast1(%arg0 : f32) -> i32 {959 %0 = arith.bitcast %arg0 : f32 to i32960 return %0 : i32961}962 963// CHECK-LABEL: test_bitcast_tensor1964func.func @test_bitcast_tensor1(%arg0 : tensor<8x8xf32>) -> tensor<8x8xi32> {965 %0 = arith.bitcast %arg0 : tensor<8x8xf32> to tensor<8x8xi32>966 return %0 : tensor<8x8xi32>967}968 969// CHECK-LABEL: test_bitcast_vector1970func.func @test_bitcast_vector1(%arg0 : vector<8xf32>) -> vector<8xi32> {971 %0 = arith.bitcast %arg0 : vector<8xf32> to vector<8xi32>972 return %0 : vector<8xi32>973}974 975// CHECK-LABEL: test_bitcast_scalable_vector1976func.func @test_bitcast_scalable_vector1(%arg0 : vector<[8]xf32>) -> vector<[8]xi32> {977 %0 = arith.bitcast %arg0 : vector<[8]xf32> to vector<[8]xi32>978 return %0 : vector<[8]xi32>979}980 981// CHECK-LABEL: test_cmpi982func.func @test_cmpi(%arg0 : i64, %arg1 : i64) -> i1 {983 %0 = arith.cmpi ne, %arg0, %arg1 : i64984 return %0 : i1985}986 987// CHECK-LABEL: test_cmpi_tensor988func.func @test_cmpi_tensor(%arg0 : tensor<8x8xi64>, %arg1 : tensor<8x8xi64>) -> tensor<8x8xi1> {989 %0 = arith.cmpi slt, %arg0, %arg1 : tensor<8x8xi64>990 return %0 : tensor<8x8xi1>991}992 993// CHECK-LABEL: test_cmpi_tensor_encoding994func.func @test_cmpi_tensor_encoding(%arg0 : tensor<8x8xi64, "foo">, %arg1 : tensor<8x8xi64, "foo">) -> tensor<8x8xi1, "foo"> {995 %0 = arith.cmpi slt, %arg0, %arg1 : tensor<8x8xi64, "foo">996 return %0 : tensor<8x8xi1, "foo">997}998 999// CHECK-LABEL: test_cmpi_vector1000func.func @test_cmpi_vector(%arg0 : vector<8xi64>, %arg1 : vector<8xi64>) -> vector<8xi1> {1001 %0 = arith.cmpi ult, %arg0, %arg1 : vector<8xi64>1002 return %0 : vector<8xi1>1003}1004 1005// CHECK-LABEL: test_cmpi_scalable_vector1006func.func @test_cmpi_scalable_vector(%arg0 : vector<[8]xi64>, %arg1 : vector<[8]xi64>) -> vector<[8]xi1> {1007 %0 = arith.cmpi ult, %arg0, %arg1 : vector<[8]xi64>1008 return %0 : vector<[8]xi1>1009}1010 1011// CHECK-LABEL: test_cmpi_vector_0d1012func.func @test_cmpi_vector_0d(%arg0 : vector<i64>, %arg1 : vector<i64>) -> vector<i1> {1013 %0 = arith.cmpi ult, %arg0, %arg1 : vector<i64>1014 return %0 : vector<i1>1015}1016 1017// CHECK-LABEL: test_cmpf1018func.func @test_cmpf(%arg0 : f64, %arg1 : f64) -> i1 {1019 %0 = arith.cmpf oeq, %arg0, %arg1 : f641020 return %0 : i11021}1022 1023// CHECK-LABEL: test_cmpf_tensor1024func.func @test_cmpf_tensor(%arg0 : tensor<8x8xf64>, %arg1 : tensor<8x8xf64>) -> tensor<8x8xi1> {1025 %0 = arith.cmpf olt, %arg0, %arg1 : tensor<8x8xf64>1026 return %0 : tensor<8x8xi1>1027}1028 1029// CHECK-LABEL: test_cmpf_vector1030func.func @test_cmpf_vector(%arg0 : vector<8xf64>, %arg1 : vector<8xf64>) -> vector<8xi1> {1031 %0 = arith.cmpf ult, %arg0, %arg1 : vector<8xf64>1032 return %0 : vector<8xi1>1033}1034 1035// CHECK-LABEL: test_cmpf_scalable_vector1036func.func @test_cmpf_scalable_vector(%arg0 : vector<[8]xf64>, %arg1 : vector<[8]xf64>) -> vector<[8]xi1> {1037 %0 = arith.cmpf ult, %arg0, %arg1 : vector<[8]xf64>1038 return %0 : vector<[8]xi1>1039}1040 1041// CHECK-LABEL: test_index_cast1042func.func @test_index_cast(%arg0 : index) -> i64 {1043 %0 = arith.index_cast %arg0 : index to i641044 return %0 : i641045}1046 1047// CHECK-LABEL: test_index_cast_tensor1048func.func @test_index_cast_tensor(%arg0 : tensor<index>) -> tensor<i64> {1049 %0 = arith.index_cast %arg0 : tensor<index> to tensor<i64>1050 return %0 : tensor<i64>1051}1052 1053// CHECK-LABEL: test_index_cast_tensor_reverse1054func.func @test_index_cast_tensor_reverse(%arg0 : tensor<i64>) -> tensor<index> {1055 %0 = arith.index_cast %arg0 : tensor<i64> to tensor<index>1056 return %0 : tensor<index>1057}1058 1059// CHECK-LABEL: func @bitcast(1060func.func @bitcast(%arg : f32) -> i32 {1061 %res = arith.bitcast %arg : f32 to i321062 return %res : i321063}1064 1065// CHECK-LABEL: test_constant1066func.func @test_constant() -> () {1067 // CHECK: %c42_i32 = arith.constant 42 : i321068 %0 = "arith.constant"(){value = 42 : i32} : () -> i321069 1070 // CHECK: %c42_i32_0 = arith.constant 42 : i321071 %1 = arith.constant 42 : i321072 1073 // CHECK: %c43 = arith.constant {crazy = "func.foo"} 43 : index1074 %2 = arith.constant {crazy = "func.foo"} 43: index1075 1076 // CHECK: %cst = arith.constant 4.300000e+01 : bf161077 %3 = arith.constant 43.0 : bf161078 1079 // CHECK: %cst_1 = arith.constant dense<0> : vector<4xi32>1080 %4 = arith.constant dense<0> : vector<4 x i32>1081 1082 // CHECK: %cst_2 = arith.constant dense<0> : tensor<42xi32>1083 %5 = arith.constant dense<0> : tensor<42 x i32>1084 1085 // CHECK: %cst_3 = arith.constant dense<0> : vector<42xi32>1086 %6 = arith.constant dense<0> : vector<42 x i32>1087 1088 // CHECK: %true = arith.constant true1089 %7 = arith.constant true1090 1091 // CHECK: %false = arith.constant false1092 %8 = arith.constant false1093 1094 // CHECK: %c-1_i128 = arith.constant -1 : i1281095 %9 = arith.constant 340282366920938463463374607431768211455 : i1281096 1097 // CHECK: %c85070591730234615865843651857942052864_i128 = arith.constant 85070591730234615865843651857942052864 : i1281098 %10 = arith.constant 85070591730234615865843651857942052864 : i1281099 1100 return1101}1102 1103// CHECK-LABEL: func @maximum1104func.func @maximum(%v1: vector<4xf32>, %v2: vector<4xf32>,1105 %sv1: vector<[4]xf32>, %sv2: vector<[4]xf32>,1106 %f1: f32, %f2: f32,1107 %i1: i32, %i2: i32) {1108 %maximum_vector = arith.maximumf %v1, %v2 : vector<4xf32>1109 %maximum_scalable_vector = arith.maximumf %sv1, %sv2 : vector<[4]xf32>1110 %maximum_float = arith.maximumf %f1, %f2 : f321111 %maxnum_vector = arith.maxnumf %v1, %v2 : vector<4xf32>1112 %maxnum_scalable_vector = arith.maxnumf %sv1, %sv2 : vector<[4]xf32>1113 %maxnum_float = arith.maxnumf %f1, %f2 : f321114 %max_signed = arith.maxsi %i1, %i2 : i321115 %max_unsigned = arith.maxui %i1, %i2 : i321116 return1117}1118 1119// CHECK-LABEL: func @minimum1120func.func @minimum(%v1: vector<4xf32>, %v2: vector<4xf32>,1121 %sv1: vector<[4]xf32>, %sv2: vector<[4]xf32>,1122 %f1: f32, %f2: f32,1123 %i1: i32, %i2: i32) {1124 %minimum_vector = arith.minimumf %v1, %v2 : vector<4xf32>1125 %minimum_scalable_vector = arith.minimumf %sv1, %sv2 : vector<[4]xf32>1126 %minimum_float = arith.minimumf %f1, %f2 : f321127 %minnum_vector = arith.minnumf %v1, %v2 : vector<4xf32>1128 %minnum_scalable_vector = arith.minnumf %sv1, %sv2 : vector<[4]xf32>1129 %minnum_float = arith.minnumf %f1, %f2 : f321130 %min_signed = arith.minsi %i1, %i2 : i321131 %min_unsigned = arith.minui %i1, %i2 : i321132 return1133}1134 1135// CHECK-LABEL: @fastmath1136func.func @fastmath(%arg0: f32, %arg1: f32, %arg2: i32) {1137// CHECK: {{.*}} = arith.addf %arg0, %arg1 fastmath<fast> : f321138// CHECK: {{.*}} = arith.subf %arg0, %arg1 fastmath<fast> : f321139// CHECK: {{.*}} = arith.mulf %arg0, %arg1 fastmath<fast> : f321140// CHECK: {{.*}} = arith.divf %arg0, %arg1 fastmath<fast> : f321141// CHECK: {{.*}} = arith.remf %arg0, %arg1 fastmath<fast> : f321142// CHECK: {{.*}} = arith.negf %arg0 fastmath<fast> : f321143 %0 = arith.addf %arg0, %arg1 fastmath<fast> : f321144 %1 = arith.subf %arg0, %arg1 fastmath<fast> : f321145 %2 = arith.mulf %arg0, %arg1 fastmath<fast> : f321146 %3 = arith.divf %arg0, %arg1 fastmath<fast> : f321147 %4 = arith.remf %arg0, %arg1 fastmath<fast> : f321148 %5 = arith.negf %arg0 fastmath<fast> : f321149// CHECK: {{.*}} = arith.addf %arg0, %arg1 : f321150 %6 = arith.addf %arg0, %arg1 fastmath<none> : f321151// CHECK: {{.*}} = arith.addf %arg0, %arg1 fastmath<nnan,ninf> : f321152 %7 = arith.addf %arg0, %arg1 fastmath<nnan,ninf> : f321153// CHECK: {{.*}} = arith.mulf %arg0, %arg1 fastmath<fast> : f321154 %8 = arith.mulf %arg0, %arg1 fastmath<reassoc,nnan,ninf,nsz,arcp,contract,afn> : f321155// CHECK: {{.*}} = arith.cmpf oeq, %arg0, %arg1 fastmath<fast> : f321156 %9 = arith.cmpf oeq, %arg0, %arg1 fastmath<fast> : f321157 1158 return1159}1160 1161// CHECK-LABEL: @select_tensor1162func.func @select_tensor(%arg0 : tensor<8xi1>, %arg1 : tensor<8xi32>, %arg2 : tensor<8xi32>) -> tensor<8xi32> {1163 // CHECK: = arith.select %{{.*}}, %{{.*}}, %{{.*}} : tensor<8xi1>, tensor<8xi32>1164 %0 = arith.select %arg0, %arg1, %arg2 : tensor<8xi1>, tensor<8xi32>1165 return %0 : tensor<8xi32>1166}1167 1168// CHECK-LABEL: @select_tensor_encoding1169func.func @select_tensor_encoding(1170 %arg0 : tensor<8xi1, "foo">, %arg1 : tensor<8xi32, "foo">, %arg2 : tensor<8xi32, "foo">) -> tensor<8xi32, "foo"> {1171 // CHECK: = arith.select %{{.*}}, %{{.*}}, %{{.*}} : tensor<8xi1, "foo">, tensor<8xi32, "foo">1172 %0 = arith.select %arg0, %arg1, %arg2 : tensor<8xi1, "foo">, tensor<8xi32, "foo">1173 return %0 : tensor<8xi32, "foo">1174}1175 1176// CHECK-LABEL: @intflags_func1177func.func @intflags_func(%arg0: i64, %arg1: i64) {1178 // CHECK: %{{.*}} = arith.addi %{{.*}}, %{{.*}} overflow<nsw> : i641179 %0 = arith.addi %arg0, %arg1 overflow<nsw> : i641180 // CHECK: %{{.*}} = arith.subi %{{.*}}, %{{.*}} overflow<nuw> : i641181 %1 = arith.subi %arg0, %arg1 overflow<nuw> : i641182 // CHECK: %{{.*}} = arith.muli %{{.*}}, %{{.*}} overflow<nsw, nuw> : i641183 %2 = arith.muli %arg0, %arg1 overflow<nsw, nuw> : i641184 // CHECK: %{{.*}} = arith.shli %{{.*}}, %{{.*}} overflow<nsw, nuw> : i641185 %3 = arith.shli %arg0, %arg1 overflow<nsw, nuw> : i641186 // CHECK: %{{.*}} = arith.trunci %{{.*}} overflow<nsw, nuw> : i64 to i321187 %4 = arith.trunci %arg0 overflow<nsw, nuw> : i64 to i321188 return1189}1190