diff --git a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-and.mir b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-and.mir --- a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-and.mir +++ b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-and.mir @@ -56,3 +56,64 @@ PseudoRET implicit $x10 ... +--- +name: and_i64 +body: | + bb.0.entry: + ; CHECK-LABEL: name: and_i64 + ; CHECK: %hi1:_(s32) = COPY $x10 + ; CHECK-NEXT: %lo1:_(s32) = COPY $x11 + ; CHECK-NEXT: %hi2:_(s32) = COPY $x12 + ; CHECK-NEXT: %lo2:_(s32) = COPY $x13 + ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND %hi1, %hi2 + ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[AND]](s32) + ; CHECK-NEXT: $x11 = COPY [[AND1]](s32) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11 + %hi1:_(s32) = COPY $x10 + %lo1:_(s32) = COPY $x11 + %hi2:_(s32) = COPY $x12 + %lo2:_(s32) = COPY $x13 + %x1:_(s64) = G_MERGE_VALUES %hi1(s32), %lo1(s32) + %x2:_(s64) = G_MERGE_VALUES %hi2(s32), %lo2(s32) + %y:_(s64) = G_AND %x1, %x2 + %hiy:_(s32), %loy:_(s32) = G_UNMERGE_VALUES %y(s64) + $x10 = COPY %hiy(s32) + $x11 = COPY %loy(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: and_i96 +body: | + bb.0.entry: + ; CHECK-LABEL: name: and_i96 + ; CHECK: %hi1:_(s32) = COPY $x10 + ; CHECK-NEXT: %mid1:_(s32) = COPY $x11 + ; CHECK-NEXT: %lo1:_(s32) = COPY $x12 + ; CHECK-NEXT: %hi2:_(s32) = COPY $x13 + ; CHECK-NEXT: %mid2:_(s32) = COPY $x14 + ; CHECK-NEXT: %lo2:_(s32) = COPY $x15 + ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND %hi1, %hi2 + ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND %mid1, %mid2 + ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[AND]](s32) + ; CHECK-NEXT: $x11 = COPY [[AND1]](s32) + ; CHECK-NEXT: $x12 = COPY [[AND2]](s32) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12 + %hi1:_(s32) = COPY $x10 + %mid1:_(s32) = COPY $x11 + %lo1:_(s32) = COPY $x12 + %hi2:_(s32) = COPY $x13 + %mid2:_(s32) = COPY $x14 + %lo2:_(s32) = COPY $x15 + %x1:_(s96) = G_MERGE_VALUES %hi1(s32), %mid1(s32), %lo1(s32) + %x2:_(s96) = G_MERGE_VALUES %hi2(s32), %mid2(s32), %lo2(s32) + %y:_(s96) = G_AND %x1, %x2 + %hi:_(s32), %mid:_(s32), %lo:_(s32) = G_UNMERGE_VALUES %y(s96) + $x10 = COPY %hi(s32) + $x11 = COPY %mid(s32) + $x12 = COPY %lo(s32) + PseudoRET implicit $x10, implicit $x11, implicit $x12 + +... diff --git a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-or.mir b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-or.mir --- a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-or.mir +++ b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-or.mir @@ -56,3 +56,64 @@ PseudoRET implicit $x10 ... +--- +name: and_i64 +body: | + bb.0.entry: + ; CHECK-LABEL: name: and_i64 + ; CHECK: %hi1:_(s32) = COPY $x10 + ; CHECK-NEXT: %lo1:_(s32) = COPY $x11 + ; CHECK-NEXT: %hi2:_(s32) = COPY $x12 + ; CHECK-NEXT: %lo2:_(s32) = COPY $x13 + ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR %hi1, %hi2 + ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[OR]](s32) + ; CHECK-NEXT: $x11 = COPY [[OR1]](s32) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11 + %hi1:_(s32) = COPY $x10 + %lo1:_(s32) = COPY $x11 + %hi2:_(s32) = COPY $x12 + %lo2:_(s32) = COPY $x13 + %x1:_(s64) = G_MERGE_VALUES %hi1(s32), %lo1(s32) + %x2:_(s64) = G_MERGE_VALUES %hi2(s32), %lo2(s32) + %y:_(s64) = G_OR %x1, %x2 + %hiy:_(s32), %loy:_(s32) = G_UNMERGE_VALUES %y(s64) + $x10 = COPY %hiy(s32) + $x11 = COPY %loy(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: and_i96 +body: | + bb.0.entry: + ; CHECK-LABEL: name: and_i96 + ; CHECK: %hi1:_(s32) = COPY $x10 + ; CHECK-NEXT: %mid1:_(s32) = COPY $x11 + ; CHECK-NEXT: %lo1:_(s32) = COPY $x12 + ; CHECK-NEXT: %hi2:_(s32) = COPY $x13 + ; CHECK-NEXT: %mid2:_(s32) = COPY $x14 + ; CHECK-NEXT: %lo2:_(s32) = COPY $x15 + ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR %hi1, %hi2 + ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR %mid1, %mid2 + ; CHECK-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[OR]](s32) + ; CHECK-NEXT: $x11 = COPY [[OR1]](s32) + ; CHECK-NEXT: $x12 = COPY [[OR2]](s32) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12 + %hi1:_(s32) = COPY $x10 + %mid1:_(s32) = COPY $x11 + %lo1:_(s32) = COPY $x12 + %hi2:_(s32) = COPY $x13 + %mid2:_(s32) = COPY $x14 + %lo2:_(s32) = COPY $x15 + %x1:_(s96) = G_MERGE_VALUES %hi1(s32), %mid1(s32), %lo1(s32) + %x2:_(s96) = G_MERGE_VALUES %hi2(s32), %mid2(s32), %lo2(s32) + %y:_(s96) = G_OR %x1, %x2 + %hi:_(s32), %mid:_(s32), %lo:_(s32) = G_UNMERGE_VALUES %y(s96) + $x10 = COPY %hi(s32) + $x11 = COPY %mid(s32) + $x12 = COPY %lo(s32) + PseudoRET implicit $x10, implicit $x11, implicit $x12 + +... diff --git a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-xor.mir b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-xor.mir --- a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-xor.mir +++ b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-xor.mir @@ -56,3 +56,64 @@ PseudoRET implicit $x10 ... +--- +name: xor_i64 +body: | + bb.0.entry: + ; CHECK-LABEL: name: xor_i64 + ; CHECK: %hi1:_(s32) = COPY $x10 + ; CHECK-NEXT: %lo1:_(s32) = COPY $x11 + ; CHECK-NEXT: %hi2:_(s32) = COPY $x12 + ; CHECK-NEXT: %lo2:_(s32) = COPY $x13 + ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR %hi1, %hi2 + ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s32) = G_XOR %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[XOR]](s32) + ; CHECK-NEXT: $x11 = COPY [[XOR1]](s32) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11 + %hi1:_(s32) = COPY $x10 + %lo1:_(s32) = COPY $x11 + %hi2:_(s32) = COPY $x12 + %lo2:_(s32) = COPY $x13 + %x1:_(s64) = G_MERGE_VALUES %hi1(s32), %lo1(s32) + %x2:_(s64) = G_MERGE_VALUES %hi2(s32), %lo2(s32) + %y:_(s64) = G_XOR %x1, %x2 + %hiy:_(s32), %loy:_(s32) = G_UNMERGE_VALUES %y(s64) + $x10 = COPY %hiy(s32) + $x11 = COPY %loy(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: xor_i96 +body: | + bb.0.entry: + ; CHECK-LABEL: name: xor_i96 + ; CHECK: %hi1:_(s32) = COPY $x10 + ; CHECK-NEXT: %mid1:_(s32) = COPY $x11 + ; CHECK-NEXT: %lo1:_(s32) = COPY $x12 + ; CHECK-NEXT: %hi2:_(s32) = COPY $x13 + ; CHECK-NEXT: %mid2:_(s32) = COPY $x14 + ; CHECK-NEXT: %lo2:_(s32) = COPY $x15 + ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR %hi1, %hi2 + ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s32) = G_XOR %mid1, %mid2 + ; CHECK-NEXT: [[XOR2:%[0-9]+]]:_(s32) = G_XOR %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[XOR]](s32) + ; CHECK-NEXT: $x11 = COPY [[XOR1]](s32) + ; CHECK-NEXT: $x12 = COPY [[XOR2]](s32) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12 + %hi1:_(s32) = COPY $x10 + %mid1:_(s32) = COPY $x11 + %lo1:_(s32) = COPY $x12 + %hi2:_(s32) = COPY $x13 + %mid2:_(s32) = COPY $x14 + %lo2:_(s32) = COPY $x15 + %x1:_(s96) = G_MERGE_VALUES %hi1(s32), %mid1(s32), %lo1(s32) + %x2:_(s96) = G_MERGE_VALUES %hi2(s32), %mid2(s32), %lo2(s32) + %y:_(s96) = G_XOR %x1, %x2 + %hi:_(s32), %mid:_(s32), %lo:_(s32) = G_UNMERGE_VALUES %y(s96) + $x10 = COPY %hi(s32) + $x11 = COPY %mid(s32) + $x12 = COPY %lo(s32) + PseudoRET implicit $x10, implicit $x11, implicit $x12 + +... diff --git a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-and.mir b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-and.mir --- a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-and.mir +++ b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-and.mir @@ -75,3 +75,64 @@ PseudoRET implicit $x10 ... +--- +name: and_i128 +body: | + bb.0.entry: + ; CHECK-LABEL: name: and_i128 + ; CHECK: %hi1:_(s64) = COPY $x10 + ; CHECK-NEXT: %lo1:_(s64) = COPY $x11 + ; CHECK-NEXT: %hi2:_(s64) = COPY $x12 + ; CHECK-NEXT: %lo2:_(s64) = COPY $x13 + ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %hi1, %hi2 + ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[AND]](s64) + ; CHECK-NEXT: $x11 = COPY [[AND1]](s64) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11 + %hi1:_(s64) = COPY $x10 + %lo1:_(s64) = COPY $x11 + %hi2:_(s64) = COPY $x12 + %lo2:_(s64) = COPY $x13 + %x1:_(s128) = G_MERGE_VALUES %hi1(s64), %lo1(s64) + %x2:_(s128) = G_MERGE_VALUES %hi2(s64), %lo2(s64) + %y:_(s128) = G_AND %x1, %x2 + %hiy:_(s64), %loy:_(s64) = G_UNMERGE_VALUES %y(s128) + $x10 = COPY %hiy(s64) + $x11 = COPY %loy(s64) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: and_i192 +body: | + bb.0.entry: + ; CHECK-LABEL: name: and_i192 + ; CHECK: %hi1:_(s64) = COPY $x10 + ; CHECK-NEXT: %mid1:_(s64) = COPY $x11 + ; CHECK-NEXT: %lo1:_(s64) = COPY $x12 + ; CHECK-NEXT: %hi2:_(s64) = COPY $x13 + ; CHECK-NEXT: %mid2:_(s64) = COPY $x14 + ; CHECK-NEXT: %lo2:_(s64) = COPY $x15 + ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %hi1, %hi2 + ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND %mid1, %mid2 + ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[AND]](s64) + ; CHECK-NEXT: $x11 = COPY [[AND1]](s64) + ; CHECK-NEXT: $x12 = COPY [[AND2]](s64) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12 + %hi1:_(s64) = COPY $x10 + %mid1:_(s64) = COPY $x11 + %lo1:_(s64) = COPY $x12 + %hi2:_(s64) = COPY $x13 + %mid2:_(s64) = COPY $x14 + %lo2:_(s64) = COPY $x15 + %x1:_(s192) = G_MERGE_VALUES %hi1(s64), %mid1(s64), %lo1(s64) + %x2:_(s192) = G_MERGE_VALUES %hi2(s64), %mid2(s64), %lo2(s64) + %y:_(s192) = G_AND %x1, %x2 + %hi:_(s64), %mid:_(s64), %lo:_(s64) = G_UNMERGE_VALUES %y(s192) + $x10 = COPY %hi(s64) + $x11 = COPY %mid(s64) + $x12 = COPY %lo(s64) + PseudoRET implicit $x10, implicit $x11, implicit $x12 + +... diff --git a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-or.mir b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-or.mir --- a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-or.mir +++ b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-or.mir @@ -75,3 +75,64 @@ PseudoRET implicit $x10 ... +--- +name: or_i128 +body: | + bb.0.entry: + ; CHECK-LABEL: name: or_i128 + ; CHECK: %hi1:_(s64) = COPY $x10 + ; CHECK-NEXT: %lo1:_(s64) = COPY $x11 + ; CHECK-NEXT: %hi2:_(s64) = COPY $x12 + ; CHECK-NEXT: %lo2:_(s64) = COPY $x13 + ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR %hi1, %hi2 + ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[OR]](s64) + ; CHECK-NEXT: $x11 = COPY [[OR1]](s64) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11 + %hi1:_(s64) = COPY $x10 + %lo1:_(s64) = COPY $x11 + %hi2:_(s64) = COPY $x12 + %lo2:_(s64) = COPY $x13 + %x1:_(s128) = G_MERGE_VALUES %hi1(s64), %lo1(s64) + %x2:_(s128) = G_MERGE_VALUES %hi2(s64), %lo2(s64) + %y:_(s128) = G_OR %x1, %x2 + %hiy:_(s64), %loy:_(s64) = G_UNMERGE_VALUES %y(s128) + $x10 = COPY %hiy(s64) + $x11 = COPY %loy(s64) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: or_i192 +body: | + bb.0.entry: + ; CHECK-LABEL: name: or_i192 + ; CHECK: %hi1:_(s64) = COPY $x10 + ; CHECK-NEXT: %mid1:_(s64) = COPY $x11 + ; CHECK-NEXT: %lo1:_(s64) = COPY $x12 + ; CHECK-NEXT: %hi2:_(s64) = COPY $x13 + ; CHECK-NEXT: %mid2:_(s64) = COPY $x14 + ; CHECK-NEXT: %lo2:_(s64) = COPY $x15 + ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR %hi1, %hi2 + ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR %mid1, %mid2 + ; CHECK-NEXT: [[OR2:%[0-9]+]]:_(s64) = G_OR %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[OR]](s64) + ; CHECK-NEXT: $x11 = COPY [[OR1]](s64) + ; CHECK-NEXT: $x12 = COPY [[OR2]](s64) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12 + %hi1:_(s64) = COPY $x10 + %mid1:_(s64) = COPY $x11 + %lo1:_(s64) = COPY $x12 + %hi2:_(s64) = COPY $x13 + %mid2:_(s64) = COPY $x14 + %lo2:_(s64) = COPY $x15 + %x1:_(s192) = G_MERGE_VALUES %hi1(s64), %mid1(s64), %lo1(s64) + %x2:_(s192) = G_MERGE_VALUES %hi2(s64), %mid2(s64), %lo2(s64) + %y:_(s192) = G_OR %x1, %x2 + %hi:_(s64), %mid:_(s64), %lo:_(s64) = G_UNMERGE_VALUES %y(s192) + $x10 = COPY %hi(s64) + $x11 = COPY %mid(s64) + $x12 = COPY %lo(s64) + PseudoRET implicit $x10, implicit $x11, implicit $x12 + +... diff --git a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-xor.mir b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-xor.mir --- a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-xor.mir +++ b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-xor.mir @@ -75,3 +75,64 @@ PseudoRET implicit $x10 ... +--- +name: xor_i128 +body: | + bb.0.entry: + ; CHECK-LABEL: name: xor_i128 + ; CHECK: %hi1:_(s64) = COPY $x10 + ; CHECK-NEXT: %lo1:_(s64) = COPY $x11 + ; CHECK-NEXT: %hi2:_(s64) = COPY $x12 + ; CHECK-NEXT: %lo2:_(s64) = COPY $x13 + ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR %hi1, %hi2 + ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s64) = G_XOR %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[XOR]](s64) + ; CHECK-NEXT: $x11 = COPY [[XOR1]](s64) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11 + %hi1:_(s64) = COPY $x10 + %lo1:_(s64) = COPY $x11 + %hi2:_(s64) = COPY $x12 + %lo2:_(s64) = COPY $x13 + %x1:_(s128) = G_MERGE_VALUES %hi1(s64), %lo1(s64) + %x2:_(s128) = G_MERGE_VALUES %hi2(s64), %lo2(s64) + %y:_(s128) = G_XOR %x1, %x2 + %hiy:_(s64), %loy:_(s64) = G_UNMERGE_VALUES %y(s128) + $x10 = COPY %hiy(s64) + $x11 = COPY %loy(s64) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: xor_i192 +body: | + bb.0.entry: + ; CHECK-LABEL: name: xor_i192 + ; CHECK: %hi1:_(s64) = COPY $x10 + ; CHECK-NEXT: %mid1:_(s64) = COPY $x11 + ; CHECK-NEXT: %lo1:_(s64) = COPY $x12 + ; CHECK-NEXT: %hi2:_(s64) = COPY $x13 + ; CHECK-NEXT: %mid2:_(s64) = COPY $x14 + ; CHECK-NEXT: %lo2:_(s64) = COPY $x15 + ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR %hi1, %hi2 + ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s64) = G_XOR %mid1, %mid2 + ; CHECK-NEXT: [[XOR2:%[0-9]+]]:_(s64) = G_XOR %lo1, %lo2 + ; CHECK-NEXT: $x10 = COPY [[XOR]](s64) + ; CHECK-NEXT: $x11 = COPY [[XOR1]](s64) + ; CHECK-NEXT: $x12 = COPY [[XOR2]](s64) + ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12 + %hi1:_(s64) = COPY $x10 + %mid1:_(s64) = COPY $x11 + %lo1:_(s64) = COPY $x12 + %hi2:_(s64) = COPY $x13 + %mid2:_(s64) = COPY $x14 + %lo2:_(s64) = COPY $x15 + %x1:_(s192) = G_MERGE_VALUES %hi1(s64), %mid1(s64), %lo1(s64) + %x2:_(s192) = G_MERGE_VALUES %hi2(s64), %mid2(s64), %lo2(s64) + %y:_(s192) = G_XOR %x1, %x2 + %hi:_(s64), %mid:_(s64), %lo:_(s64) = G_UNMERGE_VALUES %y(s192) + $x10 = COPY %hi(s64) + $x11 = COPY %mid(s64) + $x12 = COPY %lo(s64) + PseudoRET implicit $x10, implicit $x11, implicit $x12 + +...