86 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt -p 'require<profile-summary>,function(codegenprepare)' -S %s \3; RUN: | FileCheck %s --check-prefix=SLOW4; RUN: opt -p 'require<profile-summary>,function(codegenprepare)' -S --mattr=+v,+zvbb %s \5; RUN: | FileCheck %s --check-prefix=FAST6; REQUIRES: riscv-registered-target7 8target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"9target triple = "riscv64"10 11define <4 x i1> @test_ult_2(<4 x i64> %x) {12; SLOW-LABEL: define <4 x i1> @test_ult_2(13; SLOW-SAME: <4 x i64> [[X:%.*]]) {14; SLOW-NEXT: [[TMP0:%.*]] = add <4 x i64> [[X]], splat (i64 -1)15; SLOW-NEXT: [[TMP1:%.*]] = and <4 x i64> [[X]], [[TMP0]]16; SLOW-NEXT: [[CMP1:%.*]] = icmp eq <4 x i64> [[TMP1]], zeroinitializer17; SLOW-NEXT: ret <4 x i1> [[CMP1]]18;19; FAST-LABEL: define <4 x i1> @test_ult_2(20; FAST-SAME: <4 x i64> [[X:%.*]]) #[[ATTR0:[0-9]+]] {21; FAST-NEXT: [[CTPOP:%.*]] = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> [[X]])22; FAST-NEXT: [[CMP1:%.*]] = icmp ult <4 x i64> [[CTPOP]], splat (i64 2)23; FAST-NEXT: ret <4 x i1> [[CMP1]]24;25 %ctpop = call <4 x i64> @llvm.ctpop(<4 x i64> %x)26 %cmp = icmp ult <4 x i64> %ctpop, splat (i64 2)27 ret <4 x i1> %cmp28}29 30define <4 x i1> @test_ugt_1(<4 x i64> %x) {31; SLOW-LABEL: define <4 x i1> @test_ugt_1(32; SLOW-SAME: <4 x i64> [[X:%.*]]) {33; SLOW-NEXT: [[TMP0:%.*]] = add <4 x i64> [[X]], splat (i64 -1)34; SLOW-NEXT: [[TMP1:%.*]] = and <4 x i64> [[X]], [[TMP0]]35; SLOW-NEXT: [[CMP1:%.*]] = icmp ne <4 x i64> [[TMP1]], zeroinitializer36; SLOW-NEXT: ret <4 x i1> [[CMP1]]37;38; FAST-LABEL: define <4 x i1> @test_ugt_1(39; FAST-SAME: <4 x i64> [[X:%.*]]) #[[ATTR0]] {40; FAST-NEXT: [[CTPOP:%.*]] = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> [[X]])41; FAST-NEXT: [[CMP1:%.*]] = icmp ugt <4 x i64> [[CTPOP]], splat (i64 1)42; FAST-NEXT: ret <4 x i1> [[CMP1]]43;44 %ctpop = call <4 x i64> @llvm.ctpop(<4 x i64> %x)45 %cmp = icmp ugt <4 x i64> %ctpop, splat (i64 1)46 ret <4 x i1> %cmp47}48 49define <4 x i1> @test_eq_1(<4 x i64> %x) {50; SLOW-LABEL: define <4 x i1> @test_eq_1(51; SLOW-SAME: <4 x i64> [[X:%.*]]) {52; SLOW-NEXT: [[TMP0:%.*]] = add <4 x i64> [[X]], splat (i64 -1)53; SLOW-NEXT: [[TMP1:%.*]] = xor <4 x i64> [[X]], [[TMP0]]54; SLOW-NEXT: [[TMP2:%.*]] = icmp ugt <4 x i64> [[TMP1]], [[TMP0]]55; SLOW-NEXT: ret <4 x i1> [[TMP2]]56;57; FAST-LABEL: define <4 x i1> @test_eq_1(58; FAST-SAME: <4 x i64> [[X:%.*]]) #[[ATTR0]] {59; FAST-NEXT: [[CTPOP:%.*]] = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> [[X]])60; FAST-NEXT: [[CMP1:%.*]] = icmp eq <4 x i64> [[CTPOP]], splat (i64 1)61; FAST-NEXT: ret <4 x i1> [[CMP1]]62;63 %ctpop = call <4 x i64> @llvm.ctpop(<4 x i64> %x)64 %cmp = icmp eq <4 x i64> %ctpop, splat (i64 1)65 ret <4 x i1> %cmp66}67 68define <4 x i1> @test_ne_1(<4 x i64> %x) {69; SLOW-LABEL: define <4 x i1> @test_ne_1(70; SLOW-SAME: <4 x i64> [[X:%.*]]) {71; SLOW-NEXT: [[TMP0:%.*]] = add <4 x i64> [[X]], splat (i64 -1)72; SLOW-NEXT: [[TMP1:%.*]] = xor <4 x i64> [[X]], [[TMP0]]73; SLOW-NEXT: [[TMP2:%.*]] = icmp ule <4 x i64> [[TMP1]], [[TMP0]]74; SLOW-NEXT: ret <4 x i1> [[TMP2]]75;76; FAST-LABEL: define <4 x i1> @test_ne_1(77; FAST-SAME: <4 x i64> [[X:%.*]]) #[[ATTR0]] {78; FAST-NEXT: [[CTPOP:%.*]] = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> [[X]])79; FAST-NEXT: [[CMP1:%.*]] = icmp ne <4 x i64> [[CTPOP]], splat (i64 1)80; FAST-NEXT: ret <4 x i1> [[CMP1]]81;82 %ctpop = call <4 x i64> @llvm.ctpop(<4 x i64> %x)83 %cmp = icmp ne <4 x i64> %ctpop, splat (i64 1)84 ret <4 x i1> %cmp85}86