1772c2f46SSanjay Patel; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2772c2f46SSanjay Patel; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s | FileCheck -check-prefixes=RV32 %s 3772c2f46SSanjay Patel; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s | FileCheck -check-prefixes=RV64 %s 4772c2f46SSanjay Patel 5772c2f46SSanjay Pateldefine i64 @test_clear_mask_i64_i32(i64 %x) nounwind { 6772c2f46SSanjay Patel; RV32-LABEL: test_clear_mask_i64_i32: 7772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 8772c2f46SSanjay Patel; RV32-NEXT: bltz a0, .LBB0_2 9772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 10772c2f46SSanjay Patel; RV32-NEXT: li a1, 0 11772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 12772c2f46SSanjay Patel; RV32-NEXT: .LBB0_2: # %f 13772c2f46SSanjay Patel; RV32-NEXT: ret 14772c2f46SSanjay Patel; 15772c2f46SSanjay Patel; RV64-LABEL: test_clear_mask_i64_i32: 16772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 17772c2f46SSanjay Patel; RV64-NEXT: slli a1, a0, 32 18772c2f46SSanjay Patel; RV64-NEXT: bltz a1, .LBB0_2 19772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 20772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 21772c2f46SSanjay Patel; RV64-NEXT: .LBB0_2: # %f 22772c2f46SSanjay Patel; RV64-NEXT: ret 23772c2f46SSanjay Patelentry: 24772c2f46SSanjay Patel %a = and i64 %x, 2147483648 25772c2f46SSanjay Patel %r = icmp eq i64 %a, 0 26772c2f46SSanjay Patel br i1 %r, label %t, label %f 27772c2f46SSanjay Patelt: 28772c2f46SSanjay Patel br label %f 29772c2f46SSanjay Patelf: 30772c2f46SSanjay Patel %ret = phi i64 [ %x, %entry], [ 42, %t] 31772c2f46SSanjay Patel ret i64 %ret 32772c2f46SSanjay Patel} 33772c2f46SSanjay Patel 34772c2f46SSanjay Pateldefine i64 @test_set_mask_i64_i32(i64 %x) nounwind { 35772c2f46SSanjay Patel; RV32-LABEL: test_set_mask_i64_i32: 36772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 37772c2f46SSanjay Patel; RV32-NEXT: bgez a0, .LBB1_2 38772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 39772c2f46SSanjay Patel; RV32-NEXT: li a1, 0 40772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 41772c2f46SSanjay Patel; RV32-NEXT: .LBB1_2: # %f 42772c2f46SSanjay Patel; RV32-NEXT: ret 43772c2f46SSanjay Patel; 44772c2f46SSanjay Patel; RV64-LABEL: test_set_mask_i64_i32: 45772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 46772c2f46SSanjay Patel; RV64-NEXT: slli a1, a0, 32 47772c2f46SSanjay Patel; RV64-NEXT: bgez a1, .LBB1_2 48772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 49772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 50772c2f46SSanjay Patel; RV64-NEXT: .LBB1_2: # %f 51772c2f46SSanjay Patel; RV64-NEXT: ret 52772c2f46SSanjay Patelentry: 53772c2f46SSanjay Patel %a = and i64 %x, 2147483648 54772c2f46SSanjay Patel %r = icmp ne i64 %a, 0 55772c2f46SSanjay Patel br i1 %r, label %t, label %f 56772c2f46SSanjay Patelt: 57772c2f46SSanjay Patel br label %f 58772c2f46SSanjay Patelf: 59772c2f46SSanjay Patel %ret = phi i64 [ %x, %entry], [ 42, %t] 60772c2f46SSanjay Patel ret i64 %ret 61772c2f46SSanjay Patel} 62772c2f46SSanjay Patel 63772c2f46SSanjay Pateldefine i64 @test_clear_mask_i64_i16(i64 %x) nounwind { 64772c2f46SSanjay Patel; RV32-LABEL: test_clear_mask_i64_i16: 65772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 66772c2f46SSanjay Patel; RV32-NEXT: slli a2, a0, 16 67772c2f46SSanjay Patel; RV32-NEXT: bltz a2, .LBB2_2 68772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 69772c2f46SSanjay Patel; RV32-NEXT: li a1, 0 70772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 71772c2f46SSanjay Patel; RV32-NEXT: .LBB2_2: # %f 72772c2f46SSanjay Patel; RV32-NEXT: ret 73772c2f46SSanjay Patel; 74772c2f46SSanjay Patel; RV64-LABEL: test_clear_mask_i64_i16: 75772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 76772c2f46SSanjay Patel; RV64-NEXT: slli a1, a0, 48 77772c2f46SSanjay Patel; RV64-NEXT: bltz a1, .LBB2_2 78772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 79772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 80772c2f46SSanjay Patel; RV64-NEXT: .LBB2_2: # %f 81772c2f46SSanjay Patel; RV64-NEXT: ret 82772c2f46SSanjay Patelentry: 83772c2f46SSanjay Patel %a = and i64 %x, 32768 84772c2f46SSanjay Patel %r = icmp eq i64 %a, 0 85772c2f46SSanjay Patel br i1 %r, label %t, label %f 86772c2f46SSanjay Patelt: 87772c2f46SSanjay Patel br label %f 88772c2f46SSanjay Patelf: 89772c2f46SSanjay Patel %ret = phi i64 [ %x, %entry], [ 42, %t] 90772c2f46SSanjay Patel ret i64 %ret 91772c2f46SSanjay Patel} 92772c2f46SSanjay Patel 93772c2f46SSanjay Pateldefine i64 @test_set_mask_i64_i16(i64 %x) nounwind { 94772c2f46SSanjay Patel; RV32-LABEL: test_set_mask_i64_i16: 95772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 96772c2f46SSanjay Patel; RV32-NEXT: slli a2, a0, 16 97772c2f46SSanjay Patel; RV32-NEXT: bgez a2, .LBB3_2 98772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 99772c2f46SSanjay Patel; RV32-NEXT: li a1, 0 100772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 101772c2f46SSanjay Patel; RV32-NEXT: .LBB3_2: # %f 102772c2f46SSanjay Patel; RV32-NEXT: ret 103772c2f46SSanjay Patel; 104772c2f46SSanjay Patel; RV64-LABEL: test_set_mask_i64_i16: 105772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 106772c2f46SSanjay Patel; RV64-NEXT: slli a1, a0, 48 107772c2f46SSanjay Patel; RV64-NEXT: bgez a1, .LBB3_2 108772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 109772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 110772c2f46SSanjay Patel; RV64-NEXT: .LBB3_2: # %f 111772c2f46SSanjay Patel; RV64-NEXT: ret 112772c2f46SSanjay Patelentry: 113772c2f46SSanjay Patel %a = and i64 %x, 32768 114772c2f46SSanjay Patel %r = icmp ne i64 %a, 0 115772c2f46SSanjay Patel br i1 %r, label %t, label %f 116772c2f46SSanjay Patelt: 117772c2f46SSanjay Patel br label %f 118772c2f46SSanjay Patelf: 119772c2f46SSanjay Patel %ret = phi i64 [ %x, %entry], [ 42, %t] 120772c2f46SSanjay Patel ret i64 %ret 121772c2f46SSanjay Patel} 122772c2f46SSanjay Patel 123772c2f46SSanjay Pateldefine i64 @test_clear_mask_i64_i8(i64 %x) nounwind { 124772c2f46SSanjay Patel; RV32-LABEL: test_clear_mask_i64_i8: 125772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 126772c2f46SSanjay Patel; RV32-NEXT: andi a2, a0, 128 127772c2f46SSanjay Patel; RV32-NEXT: bnez a2, .LBB4_2 128772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 129772c2f46SSanjay Patel; RV32-NEXT: li a1, 0 130772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 131772c2f46SSanjay Patel; RV32-NEXT: .LBB4_2: # %f 132772c2f46SSanjay Patel; RV32-NEXT: ret 133772c2f46SSanjay Patel; 134772c2f46SSanjay Patel; RV64-LABEL: test_clear_mask_i64_i8: 135772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 136772c2f46SSanjay Patel; RV64-NEXT: andi a1, a0, 128 137772c2f46SSanjay Patel; RV64-NEXT: bnez a1, .LBB4_2 138772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 139772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 140772c2f46SSanjay Patel; RV64-NEXT: .LBB4_2: # %f 141772c2f46SSanjay Patel; RV64-NEXT: ret 142772c2f46SSanjay Patelentry: 143772c2f46SSanjay Patel %a = and i64 %x, 128 144772c2f46SSanjay Patel %r = icmp eq i64 %a, 0 145772c2f46SSanjay Patel br i1 %r, label %t, label %f 146772c2f46SSanjay Patelt: 147772c2f46SSanjay Patel br label %f 148772c2f46SSanjay Patelf: 149772c2f46SSanjay Patel %ret = phi i64 [ %x, %entry], [ 42, %t] 150772c2f46SSanjay Patel ret i64 %ret 151772c2f46SSanjay Patel} 152772c2f46SSanjay Patel 153772c2f46SSanjay Pateldefine i64 @test_set_mask_i64_i8(i64 %x) nounwind { 154772c2f46SSanjay Patel; RV32-LABEL: test_set_mask_i64_i8: 155772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 156772c2f46SSanjay Patel; RV32-NEXT: andi a2, a0, 128 157772c2f46SSanjay Patel; RV32-NEXT: beqz a2, .LBB5_2 158772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 159772c2f46SSanjay Patel; RV32-NEXT: li a1, 0 160772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 161772c2f46SSanjay Patel; RV32-NEXT: .LBB5_2: # %f 162772c2f46SSanjay Patel; RV32-NEXT: ret 163772c2f46SSanjay Patel; 164772c2f46SSanjay Patel; RV64-LABEL: test_set_mask_i64_i8: 165772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 166772c2f46SSanjay Patel; RV64-NEXT: andi a1, a0, 128 167772c2f46SSanjay Patel; RV64-NEXT: beqz a1, .LBB5_2 168772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 169772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 170772c2f46SSanjay Patel; RV64-NEXT: .LBB5_2: # %f 171772c2f46SSanjay Patel; RV64-NEXT: ret 172772c2f46SSanjay Patelentry: 173772c2f46SSanjay Patel %a = and i64 %x, 128 174772c2f46SSanjay Patel %r = icmp ne i64 %a, 0 175772c2f46SSanjay Patel br i1 %r, label %t, label %f 176772c2f46SSanjay Patelt: 177772c2f46SSanjay Patel br label %f 178772c2f46SSanjay Patelf: 179772c2f46SSanjay Patel %ret = phi i64 [ %x, %entry], [ 42, %t] 180772c2f46SSanjay Patel ret i64 %ret 181772c2f46SSanjay Patel} 182772c2f46SSanjay Patel 183772c2f46SSanjay Pateldefine i32 @test_clear_mask_i32_i16(i32 %x) nounwind { 184772c2f46SSanjay Patel; RV32-LABEL: test_clear_mask_i32_i16: 185772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 186772c2f46SSanjay Patel; RV32-NEXT: slli a1, a0, 16 187772c2f46SSanjay Patel; RV32-NEXT: bltz a1, .LBB6_2 188772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 189772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 190772c2f46SSanjay Patel; RV32-NEXT: .LBB6_2: # %f 191772c2f46SSanjay Patel; RV32-NEXT: ret 192772c2f46SSanjay Patel; 193772c2f46SSanjay Patel; RV64-LABEL: test_clear_mask_i32_i16: 194772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 195772c2f46SSanjay Patel; RV64-NEXT: slli a1, a0, 48 196772c2f46SSanjay Patel; RV64-NEXT: bltz a1, .LBB6_2 197772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 198772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 199772c2f46SSanjay Patel; RV64-NEXT: .LBB6_2: # %f 200772c2f46SSanjay Patel; RV64-NEXT: ret 201772c2f46SSanjay Patelentry: 202772c2f46SSanjay Patel %a = and i32 %x, 32768 203772c2f46SSanjay Patel %r = icmp eq i32 %a, 0 204772c2f46SSanjay Patel br i1 %r, label %t, label %f 205772c2f46SSanjay Patelt: 206772c2f46SSanjay Patel br label %f 207772c2f46SSanjay Patelf: 208772c2f46SSanjay Patel %ret = phi i32 [ %x, %entry], [ 42, %t] 209772c2f46SSanjay Patel ret i32 %ret 210772c2f46SSanjay Patel} 211772c2f46SSanjay Patel 212772c2f46SSanjay Pateldefine i32 @test_set_mask_i32_i16(i32 %x) nounwind { 213772c2f46SSanjay Patel; RV32-LABEL: test_set_mask_i32_i16: 214772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 215772c2f46SSanjay Patel; RV32-NEXT: slli a1, a0, 16 216772c2f46SSanjay Patel; RV32-NEXT: bgez a1, .LBB7_2 217772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 218772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 219772c2f46SSanjay Patel; RV32-NEXT: .LBB7_2: # %f 220772c2f46SSanjay Patel; RV32-NEXT: ret 221772c2f46SSanjay Patel; 222772c2f46SSanjay Patel; RV64-LABEL: test_set_mask_i32_i16: 223772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 224772c2f46SSanjay Patel; RV64-NEXT: slli a1, a0, 48 225772c2f46SSanjay Patel; RV64-NEXT: bgez a1, .LBB7_2 226772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 227772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 228772c2f46SSanjay Patel; RV64-NEXT: .LBB7_2: # %f 229772c2f46SSanjay Patel; RV64-NEXT: ret 230772c2f46SSanjay Patelentry: 231772c2f46SSanjay Patel %a = and i32 %x, 32768 232772c2f46SSanjay Patel %r = icmp ne i32 %a, 0 233772c2f46SSanjay Patel br i1 %r, label %t, label %f 234772c2f46SSanjay Patelt: 235772c2f46SSanjay Patel br label %f 236772c2f46SSanjay Patelf: 237772c2f46SSanjay Patel %ret = phi i32 [ %x, %entry], [ 42, %t] 238772c2f46SSanjay Patel ret i32 %ret 239772c2f46SSanjay Patel} 240772c2f46SSanjay Patel 241772c2f46SSanjay Pateldefine i32 @test_clear_mask_i32_i8(i32 %x) nounwind { 242772c2f46SSanjay Patel; RV32-LABEL: test_clear_mask_i32_i8: 243772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 244772c2f46SSanjay Patel; RV32-NEXT: andi a1, a0, 128 245772c2f46SSanjay Patel; RV32-NEXT: bnez a1, .LBB8_2 246772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 247772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 248772c2f46SSanjay Patel; RV32-NEXT: .LBB8_2: # %f 249772c2f46SSanjay Patel; RV32-NEXT: ret 250772c2f46SSanjay Patel; 251772c2f46SSanjay Patel; RV64-LABEL: test_clear_mask_i32_i8: 252772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 253772c2f46SSanjay Patel; RV64-NEXT: andi a1, a0, 128 254772c2f46SSanjay Patel; RV64-NEXT: bnez a1, .LBB8_2 255772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 256772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 257772c2f46SSanjay Patel; RV64-NEXT: .LBB8_2: # %f 258772c2f46SSanjay Patel; RV64-NEXT: ret 259772c2f46SSanjay Patelentry: 260772c2f46SSanjay Patel %a = and i32 %x, 128 261772c2f46SSanjay Patel %r = icmp eq i32 %a, 0 262772c2f46SSanjay Patel br i1 %r, label %t, label %f 263772c2f46SSanjay Patelt: 264772c2f46SSanjay Patel br label %f 265772c2f46SSanjay Patelf: 266772c2f46SSanjay Patel %ret = phi i32 [ %x, %entry], [ 42, %t] 267772c2f46SSanjay Patel ret i32 %ret 268772c2f46SSanjay Patel} 269772c2f46SSanjay Patel 270772c2f46SSanjay Pateldefine i32 @test_set_mask_i32_i8(i32 %x) nounwind { 271772c2f46SSanjay Patel; RV32-LABEL: test_set_mask_i32_i8: 272772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 273772c2f46SSanjay Patel; RV32-NEXT: andi a1, a0, 128 274772c2f46SSanjay Patel; RV32-NEXT: beqz a1, .LBB9_2 275772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 276772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 277772c2f46SSanjay Patel; RV32-NEXT: .LBB9_2: # %f 278772c2f46SSanjay Patel; RV32-NEXT: ret 279772c2f46SSanjay Patel; 280772c2f46SSanjay Patel; RV64-LABEL: test_set_mask_i32_i8: 281772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 282772c2f46SSanjay Patel; RV64-NEXT: andi a1, a0, 128 283772c2f46SSanjay Patel; RV64-NEXT: beqz a1, .LBB9_2 284772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 285772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 286772c2f46SSanjay Patel; RV64-NEXT: .LBB9_2: # %f 287772c2f46SSanjay Patel; RV64-NEXT: ret 288772c2f46SSanjay Patelentry: 289772c2f46SSanjay Patel %a = and i32 %x, 128 290772c2f46SSanjay Patel %r = icmp ne i32 %a, 0 291772c2f46SSanjay Patel br i1 %r, label %t, label %f 292772c2f46SSanjay Patelt: 293772c2f46SSanjay Patel br label %f 294772c2f46SSanjay Patelf: 295772c2f46SSanjay Patel %ret = phi i32 [ %x, %entry], [ 42, %t] 296772c2f46SSanjay Patel ret i32 %ret 297772c2f46SSanjay Patel} 298772c2f46SSanjay Patel 299772c2f46SSanjay Pateldefine i16 @test_clear_mask_i16_i8(i16 %x) nounwind { 300772c2f46SSanjay Patel; RV32-LABEL: test_clear_mask_i16_i8: 301772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 302772c2f46SSanjay Patel; RV32-NEXT: andi a1, a0, 128 303772c2f46SSanjay Patel; RV32-NEXT: bnez a1, .LBB10_2 304772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 305772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 306*7d40ea85SCraig Topper; RV32-NEXT: ret 307*7d40ea85SCraig Topper; RV32-NEXT: .LBB10_2: 308*7d40ea85SCraig Topper; RV32-NEXT: slli a0, a0, 16 309*7d40ea85SCraig Topper; RV32-NEXT: srli a0, a0, 16 310772c2f46SSanjay Patel; RV32-NEXT: ret 311772c2f46SSanjay Patel; 312772c2f46SSanjay Patel; RV64-LABEL: test_clear_mask_i16_i8: 313772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 314772c2f46SSanjay Patel; RV64-NEXT: andi a1, a0, 128 315772c2f46SSanjay Patel; RV64-NEXT: bnez a1, .LBB10_2 316772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 317772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 318*7d40ea85SCraig Topper; RV64-NEXT: ret 319*7d40ea85SCraig Topper; RV64-NEXT: .LBB10_2: 320*7d40ea85SCraig Topper; RV64-NEXT: slli a0, a0, 48 321*7d40ea85SCraig Topper; RV64-NEXT: srli a0, a0, 48 322772c2f46SSanjay Patel; RV64-NEXT: ret 323772c2f46SSanjay Patelentry: 324772c2f46SSanjay Patel %a = and i16 %x, 128 325772c2f46SSanjay Patel %r = icmp eq i16 %a, 0 326772c2f46SSanjay Patel br i1 %r, label %t, label %f 327772c2f46SSanjay Patelt: 328772c2f46SSanjay Patel br label %f 329772c2f46SSanjay Patelf: 330772c2f46SSanjay Patel %ret = phi i16 [ %x, %entry], [ 42, %t] 331772c2f46SSanjay Patel ret i16 %ret 332772c2f46SSanjay Patel} 333772c2f46SSanjay Patel 334772c2f46SSanjay Pateldefine i16 @test_set_mask_i16_i8(i16 %x) nounwind { 335772c2f46SSanjay Patel; RV32-LABEL: test_set_mask_i16_i8: 336772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 337772c2f46SSanjay Patel; RV32-NEXT: andi a1, a0, 128 338772c2f46SSanjay Patel; RV32-NEXT: beqz a1, .LBB11_2 339772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 340772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 341*7d40ea85SCraig Topper; RV32-NEXT: ret 342*7d40ea85SCraig Topper; RV32-NEXT: .LBB11_2: 343*7d40ea85SCraig Topper; RV32-NEXT: slli a0, a0, 16 344*7d40ea85SCraig Topper; RV32-NEXT: srli a0, a0, 16 345772c2f46SSanjay Patel; RV32-NEXT: ret 346772c2f46SSanjay Patel; 347772c2f46SSanjay Patel; RV64-LABEL: test_set_mask_i16_i8: 348772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 349772c2f46SSanjay Patel; RV64-NEXT: andi a1, a0, 128 350772c2f46SSanjay Patel; RV64-NEXT: beqz a1, .LBB11_2 351772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 352772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 353*7d40ea85SCraig Topper; RV64-NEXT: ret 354*7d40ea85SCraig Topper; RV64-NEXT: .LBB11_2: 355*7d40ea85SCraig Topper; RV64-NEXT: slli a0, a0, 48 356*7d40ea85SCraig Topper; RV64-NEXT: srli a0, a0, 48 357772c2f46SSanjay Patel; RV64-NEXT: ret 358772c2f46SSanjay Patelentry: 359772c2f46SSanjay Patel %a = and i16 %x, 128 360772c2f46SSanjay Patel %r = icmp ne i16 %a, 0 361772c2f46SSanjay Patel br i1 %r, label %t, label %f 362772c2f46SSanjay Patelt: 363772c2f46SSanjay Patel br label %f 364772c2f46SSanjay Patelf: 365772c2f46SSanjay Patel %ret = phi i16 [ %x, %entry], [ 42, %t] 366772c2f46SSanjay Patel ret i16 %ret 367772c2f46SSanjay Patel} 368772c2f46SSanjay Patel 369772c2f46SSanjay Pateldefine i16 @test_set_mask_i16_i7(i16 %x) nounwind { 370772c2f46SSanjay Patel; RV32-LABEL: test_set_mask_i16_i7: 371772c2f46SSanjay Patel; RV32: # %bb.0: # %entry 372772c2f46SSanjay Patel; RV32-NEXT: andi a1, a0, 64 373772c2f46SSanjay Patel; RV32-NEXT: beqz a1, .LBB12_2 374772c2f46SSanjay Patel; RV32-NEXT: # %bb.1: # %t 375772c2f46SSanjay Patel; RV32-NEXT: li a0, 42 376*7d40ea85SCraig Topper; RV32-NEXT: ret 377*7d40ea85SCraig Topper; RV32-NEXT: .LBB12_2: 378*7d40ea85SCraig Topper; RV32-NEXT: slli a0, a0, 16 379*7d40ea85SCraig Topper; RV32-NEXT: srli a0, a0, 16 380772c2f46SSanjay Patel; RV32-NEXT: ret 381772c2f46SSanjay Patel; 382772c2f46SSanjay Patel; RV64-LABEL: test_set_mask_i16_i7: 383772c2f46SSanjay Patel; RV64: # %bb.0: # %entry 384772c2f46SSanjay Patel; RV64-NEXT: andi a1, a0, 64 385772c2f46SSanjay Patel; RV64-NEXT: beqz a1, .LBB12_2 386772c2f46SSanjay Patel; RV64-NEXT: # %bb.1: # %t 387772c2f46SSanjay Patel; RV64-NEXT: li a0, 42 388*7d40ea85SCraig Topper; RV64-NEXT: ret 389*7d40ea85SCraig Topper; RV64-NEXT: .LBB12_2: 390*7d40ea85SCraig Topper; RV64-NEXT: slli a0, a0, 48 391*7d40ea85SCraig Topper; RV64-NEXT: srli a0, a0, 48 392772c2f46SSanjay Patel; RV64-NEXT: ret 393772c2f46SSanjay Patelentry: 394772c2f46SSanjay Patel %a = and i16 %x, 64 395772c2f46SSanjay Patel %r = icmp ne i16 %a, 0 396772c2f46SSanjay Patel br i1 %r, label %t, label %f 397772c2f46SSanjay Patelt: 398772c2f46SSanjay Patel br label %f 399772c2f46SSanjay Patelf: 400772c2f46SSanjay Patel %ret = phi i16 [ %x, %entry], [ 42, %t] 401772c2f46SSanjay Patel ret i16 %ret 402772c2f46SSanjay Patel} 403