244 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc --mtriple=loongarch32 -mattr=+d < %s | FileCheck %s --check-prefix=LA323; RUN: llc --mtriple=loongarch64 -mattr=+d < %s | FileCheck %s --check-prefix=LA644 5define i8 @nor_i8(i8 %a, i8 %b) nounwind {6; LA32-LABEL: nor_i8:7; LA32: # %bb.0:8; LA32-NEXT: nor $a0, $a0, $a19; LA32-NEXT: ret10;11; LA64-LABEL: nor_i8:12; LA64: # %bb.0:13; LA64-NEXT: nor $a0, $a0, $a114; LA64-NEXT: ret15 %or = or i8 %a, %b16 %neg = xor i8 %or, -117 ret i8 %neg18}19 20define i16 @nor_i16(i16 %a, i16 %b) nounwind {21; LA32-LABEL: nor_i16:22; LA32: # %bb.0:23; LA32-NEXT: nor $a0, $a0, $a124; LA32-NEXT: ret25;26; LA64-LABEL: nor_i16:27; LA64: # %bb.0:28; LA64-NEXT: nor $a0, $a0, $a129; LA64-NEXT: ret30 %or = or i16 %a, %b31 %neg = xor i16 %or, -132 ret i16 %neg33}34 35define i32 @nor_i32(i32 %a, i32 %b) nounwind {36; LA32-LABEL: nor_i32:37; LA32: # %bb.0:38; LA32-NEXT: nor $a0, $a0, $a139; LA32-NEXT: ret40;41; LA64-LABEL: nor_i32:42; LA64: # %bb.0:43; LA64-NEXT: nor $a0, $a0, $a144; LA64-NEXT: ret45 %or = or i32 %a, %b46 %neg = xor i32 %or, -147 ret i32 %neg48}49 50define i64 @nor_i64(i64 %a, i64 %b) nounwind {51; LA32-LABEL: nor_i64:52; LA32: # %bb.0:53; LA32-NEXT: nor $a0, $a0, $a254; LA32-NEXT: nor $a1, $a1, $a355; LA32-NEXT: ret56;57; LA64-LABEL: nor_i64:58; LA64: # %bb.0:59; LA64-NEXT: nor $a0, $a0, $a160; LA64-NEXT: ret61 %or = or i64 %a, %b62 %neg = xor i64 %or, -163 ret i64 %neg64}65 66define i8 @nor_zero_i8(i8 %a) nounwind {67; LA32-LABEL: nor_zero_i8:68; LA32: # %bb.0:69; LA32-NEXT: nor $a0, $a0, $zero70; LA32-NEXT: ret71;72; LA64-LABEL: nor_zero_i8:73; LA64: # %bb.0:74; LA64-NEXT: nor $a0, $a0, $zero75; LA64-NEXT: ret76 %neg = xor i8 %a, -177 ret i8 %neg78}79 80define i16 @nor_zero_i16(i16 %a) nounwind {81; LA32-LABEL: nor_zero_i16:82; LA32: # %bb.0:83; LA32-NEXT: nor $a0, $a0, $zero84; LA32-NEXT: ret85;86; LA64-LABEL: nor_zero_i16:87; LA64: # %bb.0:88; LA64-NEXT: nor $a0, $a0, $zero89; LA64-NEXT: ret90 %neg = xor i16 %a, -191 ret i16 %neg92}93 94define i32 @nor_zero_i32(i32 %a) nounwind {95; LA32-LABEL: nor_zero_i32:96; LA32: # %bb.0:97; LA32-NEXT: nor $a0, $a0, $zero98; LA32-NEXT: ret99;100; LA64-LABEL: nor_zero_i32:101; LA64: # %bb.0:102; LA64-NEXT: nor $a0, $a0, $zero103; LA64-NEXT: ret104 %neg = xor i32 %a, -1105 ret i32 %neg106}107 108define i64 @nor_zero_i64(i64 %a) nounwind {109; LA32-LABEL: nor_zero_i64:110; LA32: # %bb.0:111; LA32-NEXT: nor $a0, $a0, $zero112; LA32-NEXT: nor $a1, $a1, $zero113; LA32-NEXT: ret114;115; LA64-LABEL: nor_zero_i64:116; LA64: # %bb.0:117; LA64-NEXT: nor $a0, $a0, $zero118; LA64-NEXT: ret119 %neg = xor i64 %a, -1120 ret i64 %neg121}122 123define i8 @orn_i8(i8 %a, i8 %b) nounwind {124; LA32-LABEL: orn_i8:125; LA32: # %bb.0:126; LA32-NEXT: orn $a0, $a0, $a1127; LA32-NEXT: ret128;129; LA64-LABEL: orn_i8:130; LA64: # %bb.0:131; LA64-NEXT: orn $a0, $a0, $a1132; LA64-NEXT: ret133 %neg = xor i8 %b, -1134 %or = or i8 %neg, %a135 ret i8 %or136}137 138define i16 @orn_i16(i16 %a, i16 %b) nounwind {139; LA32-LABEL: orn_i16:140; LA32: # %bb.0:141; LA32-NEXT: orn $a0, $a0, $a1142; LA32-NEXT: ret143;144; LA64-LABEL: orn_i16:145; LA64: # %bb.0:146; LA64-NEXT: orn $a0, $a0, $a1147; LA64-NEXT: ret148 %neg = xor i16 %b, -1149 %or = or i16 %neg, %a150 ret i16 %or151}152 153define i32 @orn_i32(i32 %a, i32 %b) nounwind {154; LA32-LABEL: orn_i32:155; LA32: # %bb.0:156; LA32-NEXT: orn $a0, $a0, $a1157; LA32-NEXT: ret158;159; LA64-LABEL: orn_i32:160; LA64: # %bb.0:161; LA64-NEXT: orn $a0, $a0, $a1162; LA64-NEXT: ret163 %neg = xor i32 %b, -1164 %or = or i32 %neg, %a165 ret i32 %or166}167 168define i64 @orn_i64(i64 %a, i64 %b) nounwind {169; LA32-LABEL: orn_i64:170; LA32: # %bb.0:171; LA32-NEXT: orn $a0, $a0, $a2172; LA32-NEXT: orn $a1, $a1, $a3173; LA32-NEXT: ret174;175; LA64-LABEL: orn_i64:176; LA64: # %bb.0:177; LA64-NEXT: orn $a0, $a0, $a1178; LA64-NEXT: ret179 %neg = xor i64 %b, -1180 %or = or i64 %neg, %a181 ret i64 %or182}183 184define i8 @andn_i8(i8 %a, i8 %b) nounwind {185; LA32-LABEL: andn_i8:186; LA32: # %bb.0:187; LA32-NEXT: andn $a0, $a0, $a1188; LA32-NEXT: ret189;190; LA64-LABEL: andn_i8:191; LA64: # %bb.0:192; LA64-NEXT: andn $a0, $a0, $a1193; LA64-NEXT: ret194 %neg = xor i8 %b, -1195 %and = and i8 %neg, %a196 ret i8 %and197}198 199define i16 @andn_i16(i16 %a, i16 %b) nounwind {200; LA32-LABEL: andn_i16:201; LA32: # %bb.0:202; LA32-NEXT: andn $a0, $a0, $a1203; LA32-NEXT: ret204;205; LA64-LABEL: andn_i16:206; LA64: # %bb.0:207; LA64-NEXT: andn $a0, $a0, $a1208; LA64-NEXT: ret209 %neg = xor i16 %b, -1210 %and = and i16 %neg, %a211 ret i16 %and212}213 214define i32 @andn_i32(i32 %a, i32 %b) nounwind {215; LA32-LABEL: andn_i32:216; LA32: # %bb.0:217; LA32-NEXT: andn $a0, $a0, $a1218; LA32-NEXT: ret219;220; LA64-LABEL: andn_i32:221; LA64: # %bb.0:222; LA64-NEXT: andn $a0, $a0, $a1223; LA64-NEXT: ret224 %neg = xor i32 %b, -1225 %and = and i32 %neg, %a226 ret i32 %and227}228 229define i64 @andn_i64(i64 %a, i64 %b) nounwind {230; LA32-LABEL: andn_i64:231; LA32: # %bb.0:232; LA32-NEXT: andn $a0, $a0, $a2233; LA32-NEXT: andn $a1, $a1, $a3234; LA32-NEXT: ret235;236; LA64-LABEL: andn_i64:237; LA64: # %bb.0:238; LA64-NEXT: andn $a0, $a0, $a1239; LA64-NEXT: ret240 %neg = xor i64 %b, -1241 %and = and i64 %neg, %a242 ret i64 %and243}244