929 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd -verify-machineinstrs --show-mc-encoding | FileCheck %s3; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,nf -verify-machineinstrs --show-mc-encoding | FileCheck --check-prefix=NF %s4; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,nf -x86-enable-apx-for-relocation=true -verify-machineinstrs --show-mc-encoding | FileCheck --check-prefix=NF %s5 6define i8 @sub8rr(i8 noundef %a, i8 noundef %b) {7; CHECK-LABEL: sub8rr:8; CHECK: # %bb.0: # %entry9; CHECK-NEXT: subb %sil, %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0x28,0xf7]10; CHECK-NEXT: retq # encoding: [0xc3]11;12; NF-LABEL: sub8rr:13; NF: # %bb.0: # %entry14; NF-NEXT: {nf} subb %sil, %dil, %al # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x28,0xf7]15; NF-NEXT: retq # encoding: [0xc3]16entry:17 %sub = sub i8 %a, %b18 ret i8 %sub19}20 21define i16 @sub16rr(i16 noundef %a, i16 noundef %b) {22; CHECK-LABEL: sub16rr:23; CHECK: # %bb.0: # %entry24; CHECK-NEXT: subw %si, %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x29,0xf7]25; CHECK-NEXT: retq # encoding: [0xc3]26;27; NF-LABEL: sub16rr:28; NF: # %bb.0: # %entry29; NF-NEXT: {nf} subw %si, %di, %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0x29,0xf7]30; NF-NEXT: retq # encoding: [0xc3]31entry:32 %sub = sub i16 %a, %b33 ret i16 %sub34}35 36define i32 @sub32rr(i32 noundef %a, i32 noundef %b) {37; CHECK-LABEL: sub32rr:38; CHECK: # %bb.0: # %entry39; CHECK-NEXT: subl %esi, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x29,0xf7]40; CHECK-NEXT: retq # encoding: [0xc3]41;42; NF-LABEL: sub32rr:43; NF: # %bb.0: # %entry44; NF-NEXT: {nf} subl %esi, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x29,0xf7]45; NF-NEXT: retq # encoding: [0xc3]46entry:47 %sub = sub i32 %a, %b48 ret i32 %sub49}50 51define i64 @sub64rr(i64 noundef %a, i64 noundef %b) {52; CHECK-LABEL: sub64rr:53; CHECK: # %bb.0: # %entry54; CHECK-NEXT: subq %rsi, %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x29,0xf7]55; CHECK-NEXT: retq # encoding: [0xc3]56;57; NF-LABEL: sub64rr:58; NF: # %bb.0: # %entry59; NF-NEXT: {nf} subq %rsi, %rdi, %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0x29,0xf7]60; NF-NEXT: retq # encoding: [0xc3]61entry:62 %sub = sub i64 %a, %b63 ret i64 %sub64}65 66define i8 @sub8rm(i8 noundef %a, ptr %ptr) {67; CHECK-LABEL: sub8rm:68; CHECK: # %bb.0: # %entry69; CHECK-NEXT: subb (%rsi), %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0x2a,0x3e]70; CHECK-NEXT: retq # encoding: [0xc3]71;72; NF-LABEL: sub8rm:73; NF: # %bb.0: # %entry74; NF-NEXT: {nf} subb (%rsi), %dil, %al # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x2a,0x3e]75; NF-NEXT: retq # encoding: [0xc3]76entry:77 %b = load i8, ptr %ptr78 %sub = sub i8 %a, %b79 ret i8 %sub80}81 82define i16 @sub16rm(i16 noundef %a, ptr %ptr) {83; CHECK-LABEL: sub16rm:84; CHECK: # %bb.0: # %entry85; CHECK-NEXT: subw (%rsi), %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x2b,0x3e]86; CHECK-NEXT: retq # encoding: [0xc3]87;88; NF-LABEL: sub16rm:89; NF: # %bb.0: # %entry90; NF-NEXT: {nf} subw (%rsi), %di, %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0x2b,0x3e]91; NF-NEXT: retq # encoding: [0xc3]92entry:93 %b = load i16, ptr %ptr94 %sub = sub i16 %a, %b95 ret i16 %sub96}97 98define i32 @sub32rm(i32 noundef %a, ptr %ptr) {99; CHECK-LABEL: sub32rm:100; CHECK: # %bb.0: # %entry101; CHECK-NEXT: subl (%rsi), %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x2b,0x3e]102; CHECK-NEXT: retq # encoding: [0xc3]103;104; NF-LABEL: sub32rm:105; NF: # %bb.0: # %entry106; NF-NEXT: {nf} subl (%rsi), %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x2b,0x3e]107; NF-NEXT: retq # encoding: [0xc3]108entry:109 %b = load i32, ptr %ptr110 %sub = sub i32 %a, %b111 ret i32 %sub112}113 114define i64 @sub64rm(i64 noundef %a, ptr %ptr) {115; CHECK-LABEL: sub64rm:116; CHECK: # %bb.0: # %entry117; CHECK-NEXT: subq (%rsi), %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x2b,0x3e]118; CHECK-NEXT: retq # encoding: [0xc3]119;120; NF-LABEL: sub64rm:121; NF: # %bb.0: # %entry122; NF-NEXT: {nf} subq (%rsi), %rdi, %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0x2b,0x3e]123; NF-NEXT: retq # encoding: [0xc3]124entry:125 %b = load i64, ptr %ptr126 %sub = sub i64 %a, %b127 ret i64 %sub128}129 130define i16 @sub16ri8(i16 noundef %a) {131; CHECK-LABEL: sub16ri8:132; CHECK: # %bb.0: # %entry133; CHECK-NEXT: subw $-128, %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x83,0xef,0x80]134; CHECK-NEXT: retq # encoding: [0xc3]135;136; NF-LABEL: sub16ri8:137; NF: # %bb.0: # %entry138; NF-NEXT: {nf} subw $-128, %di, %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0x83,0xef,0x80]139; NF-NEXT: retq # encoding: [0xc3]140entry:141 %sub = sub i16 %a, -128142 ret i16 %sub143}144 145define i32 @sub32ri8(i32 noundef %a) {146; CHECK-LABEL: sub32ri8:147; CHECK: # %bb.0: # %entry148; CHECK-NEXT: subl $-128, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0x83,0xef,0x80]149; CHECK-NEXT: retq # encoding: [0xc3]150;151; NF-LABEL: sub32ri8:152; NF: # %bb.0: # %entry153; NF-NEXT: {nf} subl $-128, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x83,0xef,0x80]154; NF-NEXT: retq # encoding: [0xc3]155entry:156 %sub = sub i32 %a, -128157 ret i32 %sub158}159 160define i64 @sub64ri8(i64 noundef %a) {161; CHECK-LABEL: sub64ri8:162; CHECK: # %bb.0: # %entry163; CHECK-NEXT: subq $-128, %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x83,0xef,0x80]164; CHECK-NEXT: retq # encoding: [0xc3]165;166; NF-LABEL: sub64ri8:167; NF: # %bb.0: # %entry168; NF-NEXT: {nf} subq $-128, %rdi, %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0x83,0xef,0x80]169; NF-NEXT: retq # encoding: [0xc3]170entry:171 %sub = sub i64 %a, -128172 ret i64 %sub173}174 175define i8 @sub8ri(i8 noundef %a) {176; CHECK-LABEL: sub8ri:177; CHECK: # %bb.0: # %entry178; CHECK-NEXT: addb $-123, %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0x80,0xc7,0x85]179; CHECK-NEXT: retq # encoding: [0xc3]180;181; NF-LABEL: sub8ri:182; NF: # %bb.0: # %entry183; NF-NEXT: {nf} addb $-123, %dil, %al # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x80,0xc7,0x85]184; NF-NEXT: retq # encoding: [0xc3]185entry:186 %sub = sub i8 %a, 123187 ret i8 %sub188}189 190define i16 @sub16ri(i16 noundef %a) {191; CHECK-LABEL: sub16ri:192; CHECK: # %bb.0: # %entry193; CHECK-NEXT: addw $-1234, %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0x81,0xc7,0x2e,0xfb]194; CHECK-NEXT: # imm = 0xFB2E195; CHECK-NEXT: retq # encoding: [0xc3]196;197; NF-LABEL: sub16ri:198; NF: # %bb.0: # %entry199; NF-NEXT: {nf} addw $-1234, %di, %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0x81,0xc7,0x2e,0xfb]200; NF-NEXT: # imm = 0xFB2E201; NF-NEXT: retq # encoding: [0xc3]202entry:203 %sub = sub i16 %a, 1234204 ret i16 %sub205}206 207define i32 @sub32ri(i32 noundef %a) {208; CHECK-LABEL: sub32ri:209; CHECK: # %bb.0: # %entry210; CHECK-NEXT: leal -123456(%rdi), %eax # encoding: [0x8d,0x87,0xc0,0x1d,0xfe,0xff]211; CHECK-NEXT: retq # encoding: [0xc3]212;213; NF-LABEL: sub32ri:214; NF: # %bb.0: # %entry215; NF-NEXT: leal -123456(%rdi), %eax # encoding: [0x8d,0x87,0xc0,0x1d,0xfe,0xff]216; NF-NEXT: retq # encoding: [0xc3]217entry:218 %sub = sub i32 %a, 123456219 ret i32 %sub220}221 222define i64 @sub64ri(i64 noundef %a) {223; CHECK-LABEL: sub64ri:224; CHECK: # %bb.0: # %entry225; CHECK-NEXT: subq $-2147483648, %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x81,0xef,0x00,0x00,0x00,0x80]226; CHECK-NEXT: # imm = 0x80000000227; CHECK-NEXT: retq # encoding: [0xc3]228;229; NF-LABEL: sub64ri:230; NF: # %bb.0: # %entry231; NF-NEXT: {nf} subq $-2147483648, %rdi, %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0x81,0xef,0x00,0x00,0x00,0x80]232; NF-NEXT: # imm = 0x80000000233; NF-NEXT: retq # encoding: [0xc3]234entry:235 %sub = sub i64 %a, -2147483648236 ret i64 %sub237}238 239define i8 @sub8mr(ptr %a, i8 noundef %b) {240; CHECK-LABEL: sub8mr:241; CHECK: # %bb.0: # %entry242; CHECK-NEXT: subb %sil, (%rdi), %al # encoding: [0x62,0xf4,0x7c,0x18,0x28,0x37]243; CHECK-NEXT: retq # encoding: [0xc3]244;245; NF-LABEL: sub8mr:246; NF: # %bb.0: # %entry247; NF-NEXT: {nf} subb %sil, (%rdi), %al # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x28,0x37]248; NF-NEXT: retq # encoding: [0xc3]249entry:250 %t= load i8, ptr %a251 %sub = sub nsw i8 %t, %b252 ret i8 %sub253}254 255define i16 @sub16mr(ptr %a, i16 noundef %b) {256; CHECK-LABEL: sub16mr:257; CHECK: # %bb.0: # %entry258; CHECK-NEXT: subw %si, (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0x29,0x37]259; CHECK-NEXT: retq # encoding: [0xc3]260;261; NF-LABEL: sub16mr:262; NF: # %bb.0: # %entry263; NF-NEXT: {nf} subw %si, (%rdi), %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0x29,0x37]264; NF-NEXT: retq # encoding: [0xc3]265entry:266 %t= load i16, ptr %a267 %sub = sub nsw i16 %t, %b268 ret i16 %sub269}270 271define i32 @sub32mr(ptr %a, i32 noundef %b) {272; CHECK-LABEL: sub32mr:273; CHECK: # %bb.0: # %entry274; CHECK-NEXT: subl %esi, (%rdi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0x29,0x37]275; CHECK-NEXT: retq # encoding: [0xc3]276;277; NF-LABEL: sub32mr:278; NF: # %bb.0: # %entry279; NF-NEXT: {nf} subl %esi, (%rdi), %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x29,0x37]280; NF-NEXT: retq # encoding: [0xc3]281entry:282 %t= load i32, ptr %a283 %sub = sub nsw i32 %t, %b284 ret i32 %sub285}286 287define i64 @sub64mr(ptr %a, i64 noundef %b) {288; CHECK-LABEL: sub64mr:289; CHECK: # %bb.0: # %entry290; CHECK-NEXT: subq %rsi, (%rdi), %rax # encoding: [0x62,0xf4,0xfc,0x18,0x29,0x37]291; CHECK-NEXT: retq # encoding: [0xc3]292;293; NF-LABEL: sub64mr:294; NF: # %bb.0: # %entry295; NF-NEXT: {nf} subq %rsi, (%rdi), %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0x29,0x37]296; NF-NEXT: retq # encoding: [0xc3]297entry:298 %t= load i64, ptr %a299 %sub = sub nsw i64 %t, %b300 ret i64 %sub301}302 303define i16 @sub16mi8(ptr %a) {304; CHECK-LABEL: sub16mi8:305; CHECK: # %bb.0: # %entry306; CHECK-NEXT: subw $-128, (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0x83,0x2f,0x80]307; CHECK-NEXT: retq # encoding: [0xc3]308;309; NF-LABEL: sub16mi8:310; NF: # %bb.0: # %entry311; NF-NEXT: {nf} subw $-128, (%rdi), %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0x83,0x2f,0x80]312; NF-NEXT: retq # encoding: [0xc3]313entry:314 %t= load i16, ptr %a315 %sub = sub nsw i16 %t, -128316 ret i16 %sub317}318 319define i32 @sub32mi8(ptr %a) {320; CHECK-LABEL: sub32mi8:321; CHECK: # %bb.0: # %entry322; CHECK-NEXT: subl $-128, (%rdi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0x83,0x2f,0x80]323; CHECK-NEXT: retq # encoding: [0xc3]324;325; NF-LABEL: sub32mi8:326; NF: # %bb.0: # %entry327; NF-NEXT: {nf} subl $-128, (%rdi), %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x83,0x2f,0x80]328; NF-NEXT: retq # encoding: [0xc3]329entry:330 %t= load i32, ptr %a331 %sub = sub nsw i32 %t, -128332 ret i32 %sub333}334 335define i64 @sub64mi8(ptr %a) {336; CHECK-LABEL: sub64mi8:337; CHECK: # %bb.0: # %entry338; CHECK-NEXT: subq $-128, (%rdi), %rax # encoding: [0x62,0xf4,0xfc,0x18,0x83,0x2f,0x80]339; CHECK-NEXT: retq # encoding: [0xc3]340;341; NF-LABEL: sub64mi8:342; NF: # %bb.0: # %entry343; NF-NEXT: {nf} subq $-128, (%rdi), %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0x83,0x2f,0x80]344; NF-NEXT: retq # encoding: [0xc3]345entry:346 %t= load i64, ptr %a347 %sub = sub nsw i64 %t, -128348 ret i64 %sub349}350 351define i8 @sub8mi(ptr %a) {352; CHECK-LABEL: sub8mi:353; CHECK: # %bb.0: # %entry354; CHECK-NEXT: addb $-123, (%rdi), %al # encoding: [0x62,0xf4,0x7c,0x18,0x80,0x07,0x85]355; CHECK-NEXT: retq # encoding: [0xc3]356;357; NF-LABEL: sub8mi:358; NF: # %bb.0: # %entry359; NF-NEXT: {nf} addb $-123, (%rdi), %al # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x80,0x07,0x85]360; NF-NEXT: retq # encoding: [0xc3]361entry:362 %t= load i8, ptr %a363 %sub = sub nsw i8 %t, 123364 ret i8 %sub365}366 367define i16 @sub16mi(ptr %a) {368; CHECK-LABEL: sub16mi:369; CHECK: # %bb.0: # %entry370; CHECK-NEXT: addw $-1234, (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0x81,0x07,0x2e,0xfb]371; CHECK-NEXT: # imm = 0xFB2E372; CHECK-NEXT: retq # encoding: [0xc3]373;374; NF-LABEL: sub16mi:375; NF: # %bb.0: # %entry376; NF-NEXT: {nf} addw $-1234, (%rdi), %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0x81,0x07,0x2e,0xfb]377; NF-NEXT: # imm = 0xFB2E378; NF-NEXT: retq # encoding: [0xc3]379entry:380 %t= load i16, ptr %a381 %sub = sub nsw i16 %t, 1234382 ret i16 %sub383}384 385define i32 @sub32mi(ptr %a) {386; CHECK-LABEL: sub32mi:387; CHECK: # %bb.0: # %entry388; CHECK-NEXT: addl $-123456, (%rdi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0x81,0x07,0xc0,0x1d,0xfe,0xff]389; CHECK-NEXT: # imm = 0xFFFE1DC0390; CHECK-NEXT: retq # encoding: [0xc3]391;392; NF-LABEL: sub32mi:393; NF: # %bb.0: # %entry394; NF-NEXT: {nf} addl $-123456, (%rdi), %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0x81,0x07,0xc0,0x1d,0xfe,0xff]395; NF-NEXT: # imm = 0xFFFE1DC0396; NF-NEXT: retq # encoding: [0xc3]397entry:398 %t= load i32, ptr %a399 %sub = sub nsw i32 %t, 123456400 ret i32 %sub401}402 403define i64 @sub64mi(ptr %a) {404; CHECK-LABEL: sub64mi:405; CHECK: # %bb.0: # %entry406; CHECK-NEXT: subq $-2147483648, (%rdi), %rax # encoding: [0x62,0xf4,0xfc,0x18,0x81,0x2f,0x00,0x00,0x00,0x80]407; CHECK-NEXT: # imm = 0x80000000408; CHECK-NEXT: retq # encoding: [0xc3]409;410; NF-LABEL: sub64mi:411; NF: # %bb.0: # %entry412; NF-NEXT: {nf} subq $-2147483648, (%rdi), %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0x81,0x2f,0x00,0x00,0x00,0x80]413; NF-NEXT: # imm = 0x80000000414; NF-NEXT: retq # encoding: [0xc3]415entry:416 %t= load i64, ptr %a417 %sub = sub nsw i64 %t, -2147483648418 ret i64 %sub419}420 421declare i8 @llvm.usub.sat.i8(i8, i8)422declare i16 @llvm.usub.sat.i16(i16, i16)423declare i32 @llvm.usub.sat.i32(i32, i32)424declare i64 @llvm.usub.sat.i64(i64, i64)425 426define i8 @subflag8rr(i8 noundef %a, i8 noundef %b) {427; CHECK-LABEL: subflag8rr:428; CHECK: # %bb.0: # %entry429; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]430; CHECK-NEXT: subb %sil, %dil, %cl # encoding: [0x62,0xf4,0x74,0x18,0x28,0xf7]431; CHECK-NEXT: movzbl %cl, %ecx # encoding: [0x0f,0xb6,0xc9]432; CHECK-NEXT: cmovael %ecx, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc1]433; CHECK-NEXT: # kill: def $al killed $al killed $eax434; CHECK-NEXT: retq # encoding: [0xc3]435;436; NF-LABEL: subflag8rr:437; NF: # %bb.0: # %entry438; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]439; NF-NEXT: subb %sil, %dil, %cl # encoding: [0x62,0xf4,0x74,0x18,0x28,0xf7]440; NF-NEXT: movzbl %cl, %ecx # encoding: [0x0f,0xb6,0xc9]441; NF-NEXT: cmovael %ecx, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc1]442; NF-NEXT: # kill: def $al killed $al killed $eax443; NF-NEXT: retq # encoding: [0xc3]444entry:445 %sub = call i8 @llvm.usub.sat.i8(i8 %a, i8 %b)446 ret i8 %sub447}448 449define i16 @subflag16rr(i16 noundef %a, i16 noundef %b) {450; CHECK-LABEL: subflag16rr:451; CHECK: # %bb.0: # %entry452; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]453; CHECK-NEXT: subw %si, %di # EVEX TO LEGACY Compression encoding: [0x66,0x29,0xf7]454; CHECK-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]455; CHECK-NEXT: # kill: def $ax killed $ax killed $eax456; CHECK-NEXT: retq # encoding: [0xc3]457;458; NF-LABEL: subflag16rr:459; NF: # %bb.0: # %entry460; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]461; NF-NEXT: subw %si, %di # EVEX TO LEGACY Compression encoding: [0x66,0x29,0xf7]462; NF-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]463; NF-NEXT: # kill: def $ax killed $ax killed $eax464; NF-NEXT: retq # encoding: [0xc3]465entry:466 %sub = call i16 @llvm.usub.sat.i16(i16 %a, i16 %b)467 ret i16 %sub468}469 470define i32 @subflag32rr(i32 noundef %a, i32 noundef %b) {471; CHECK-LABEL: subflag32rr:472; CHECK: # %bb.0: # %entry473; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]474; CHECK-NEXT: subl %esi, %edi # EVEX TO LEGACY Compression encoding: [0x29,0xf7]475; CHECK-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]476; CHECK-NEXT: retq # encoding: [0xc3]477;478; NF-LABEL: subflag32rr:479; NF: # %bb.0: # %entry480; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]481; NF-NEXT: subl %esi, %edi # EVEX TO LEGACY Compression encoding: [0x29,0xf7]482; NF-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]483; NF-NEXT: retq # encoding: [0xc3]484entry:485 %sub = call i32 @llvm.usub.sat.i32(i32 %a, i32 %b)486 ret i32 %sub487}488 489define i64 @subflag64rr(i64 noundef %a, i64 noundef %b) {490; CHECK-LABEL: subflag64rr:491; CHECK: # %bb.0: # %entry492; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]493; CHECK-NEXT: subq %rsi, %rdi # EVEX TO LEGACY Compression encoding: [0x48,0x29,0xf7]494; CHECK-NEXT: cmovaeq %rdi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x0f,0x43,0xc7]495; CHECK-NEXT: retq # encoding: [0xc3]496;497; NF-LABEL: subflag64rr:498; NF: # %bb.0: # %entry499; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]500; NF-NEXT: subq %rsi, %rdi # EVEX TO LEGACY Compression encoding: [0x48,0x29,0xf7]501; NF-NEXT: cmovaeq %rdi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x0f,0x43,0xc7]502; NF-NEXT: retq # encoding: [0xc3]503entry:504 %sub = call i64 @llvm.usub.sat.i64(i64 %a, i64 %b)505 ret i64 %sub506}507 508define i8 @subflag8rm(i8 noundef %a, ptr %b) {509; CHECK-LABEL: subflag8rm:510; CHECK: # %bb.0: # %entry511; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]512; CHECK-NEXT: subb (%rsi), %dil, %cl # encoding: [0x62,0xf4,0x74,0x18,0x2a,0x3e]513; CHECK-NEXT: movzbl %cl, %ecx # encoding: [0x0f,0xb6,0xc9]514; CHECK-NEXT: cmovael %ecx, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc1]515; CHECK-NEXT: # kill: def $al killed $al killed $eax516; CHECK-NEXT: retq # encoding: [0xc3]517;518; NF-LABEL: subflag8rm:519; NF: # %bb.0: # %entry520; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]521; NF-NEXT: subb (%rsi), %dil, %cl # encoding: [0x62,0xf4,0x74,0x18,0x2a,0x3e]522; NF-NEXT: movzbl %cl, %ecx # encoding: [0x0f,0xb6,0xc9]523; NF-NEXT: cmovael %ecx, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc1]524; NF-NEXT: # kill: def $al killed $al killed $eax525; NF-NEXT: retq # encoding: [0xc3]526entry:527 %t = load i8, ptr %b528 %sub = call i8 @llvm.usub.sat.i8(i8 %a, i8 %t)529 ret i8 %sub530}531 532define i16 @subflag16rm(i16 noundef %a, ptr %b) {533; CHECK-LABEL: subflag16rm:534; CHECK: # %bb.0: # %entry535; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]536; CHECK-NEXT: subw (%rsi), %di # EVEX TO LEGACY Compression encoding: [0x66,0x2b,0x3e]537; CHECK-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]538; CHECK-NEXT: # kill: def $ax killed $ax killed $eax539; CHECK-NEXT: retq # encoding: [0xc3]540;541; NF-LABEL: subflag16rm:542; NF: # %bb.0: # %entry543; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]544; NF-NEXT: subw (%rsi), %di # EVEX TO LEGACY Compression encoding: [0x66,0x2b,0x3e]545; NF-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]546; NF-NEXT: # kill: def $ax killed $ax killed $eax547; NF-NEXT: retq # encoding: [0xc3]548entry:549 %t = load i16, ptr %b550 %sub = call i16 @llvm.usub.sat.i16(i16 %a, i16 %t)551 ret i16 %sub552}553 554define i32 @subflag32rm(i32 noundef %a, ptr %b) {555; CHECK-LABEL: subflag32rm:556; CHECK: # %bb.0: # %entry557; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]558; CHECK-NEXT: subl (%rsi), %edi # EVEX TO LEGACY Compression encoding: [0x2b,0x3e]559; CHECK-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]560; CHECK-NEXT: retq # encoding: [0xc3]561;562; NF-LABEL: subflag32rm:563; NF: # %bb.0: # %entry564; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]565; NF-NEXT: subl (%rsi), %edi # EVEX TO LEGACY Compression encoding: [0x2b,0x3e]566; NF-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]567; NF-NEXT: retq # encoding: [0xc3]568entry:569 %t = load i32, ptr %b570 %sub = call i32 @llvm.usub.sat.i32(i32 %a, i32 %t)571 ret i32 %sub572}573 574define i64 @subflag64rm(i64 noundef %a, ptr %b) {575; CHECK-LABEL: subflag64rm:576; CHECK: # %bb.0: # %entry577; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]578; CHECK-NEXT: subq (%rsi), %rdi # EVEX TO LEGACY Compression encoding: [0x48,0x2b,0x3e]579; CHECK-NEXT: cmovaeq %rdi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x0f,0x43,0xc7]580; CHECK-NEXT: retq # encoding: [0xc3]581;582; NF-LABEL: subflag64rm:583; NF: # %bb.0: # %entry584; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]585; NF-NEXT: subq (%rsi), %rdi # EVEX TO LEGACY Compression encoding: [0x48,0x2b,0x3e]586; NF-NEXT: cmovaeq %rdi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x0f,0x43,0xc7]587; NF-NEXT: retq # encoding: [0xc3]588entry:589 %t = load i64, ptr %b590 %sub = call i64 @llvm.usub.sat.i64(i64 %a, i64 %t)591 ret i64 %sub592}593 594define i16 @subflag16ri8(i16 noundef %a) {595; CHECK-LABEL: subflag16ri8:596; CHECK: # %bb.0: # %entry597; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]598; CHECK-NEXT: subw $123, %di # EVEX TO LEGACY Compression encoding: [0x66,0x83,0xef,0x7b]599; CHECK-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]600; CHECK-NEXT: # kill: def $ax killed $ax killed $eax601; CHECK-NEXT: retq # encoding: [0xc3]602;603; NF-LABEL: subflag16ri8:604; NF: # %bb.0: # %entry605; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]606; NF-NEXT: subw $123, %di # EVEX TO LEGACY Compression encoding: [0x66,0x83,0xef,0x7b]607; NF-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]608; NF-NEXT: # kill: def $ax killed $ax killed $eax609; NF-NEXT: retq # encoding: [0xc3]610entry:611 %sub = call i16 @llvm.usub.sat.i16(i16 %a, i16 123)612 ret i16 %sub613}614 615define i32 @subflag32ri8(i32 noundef %a) {616; CHECK-LABEL: subflag32ri8:617; CHECK: # %bb.0: # %entry618; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]619; CHECK-NEXT: subl $123, %edi # EVEX TO LEGACY Compression encoding: [0x83,0xef,0x7b]620; CHECK-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]621; CHECK-NEXT: retq # encoding: [0xc3]622;623; NF-LABEL: subflag32ri8:624; NF: # %bb.0: # %entry625; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]626; NF-NEXT: subl $123, %edi # EVEX TO LEGACY Compression encoding: [0x83,0xef,0x7b]627; NF-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]628; NF-NEXT: retq # encoding: [0xc3]629entry:630 %sub = call i32 @llvm.usub.sat.i32(i32 %a, i32 123)631 ret i32 %sub632}633 634define i64 @subflag64ri8(i64 noundef %a) {635; CHECK-LABEL: subflag64ri8:636; CHECK: # %bb.0: # %entry637; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]638; CHECK-NEXT: subq $123, %rdi # EVEX TO LEGACY Compression encoding: [0x48,0x83,0xef,0x7b]639; CHECK-NEXT: cmovaeq %rdi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x0f,0x43,0xc7]640; CHECK-NEXT: retq # encoding: [0xc3]641;642; NF-LABEL: subflag64ri8:643; NF: # %bb.0: # %entry644; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]645; NF-NEXT: subq $123, %rdi # EVEX TO LEGACY Compression encoding: [0x48,0x83,0xef,0x7b]646; NF-NEXT: cmovaeq %rdi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x0f,0x43,0xc7]647; NF-NEXT: retq # encoding: [0xc3]648entry:649 %sub = call i64 @llvm.usub.sat.i64(i64 %a, i64 123)650 ret i64 %sub651}652 653define i8 @subflag8ri(i8 noundef %a) {654; CHECK-LABEL: subflag8ri:655; CHECK: # %bb.0: # %entry656; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]657; CHECK-NEXT: subb $123, %dil, %cl # encoding: [0x62,0xf4,0x74,0x18,0x80,0xef,0x7b]658; CHECK-NEXT: movzbl %cl, %ecx # encoding: [0x0f,0xb6,0xc9]659; CHECK-NEXT: cmovael %ecx, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc1]660; CHECK-NEXT: # kill: def $al killed $al killed $eax661; CHECK-NEXT: retq # encoding: [0xc3]662;663; NF-LABEL: subflag8ri:664; NF: # %bb.0: # %entry665; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]666; NF-NEXT: subb $123, %dil, %cl # encoding: [0x62,0xf4,0x74,0x18,0x80,0xef,0x7b]667; NF-NEXT: movzbl %cl, %ecx # encoding: [0x0f,0xb6,0xc9]668; NF-NEXT: cmovael %ecx, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc1]669; NF-NEXT: # kill: def $al killed $al killed $eax670; NF-NEXT: retq # encoding: [0xc3]671entry:672 %sub = call i8 @llvm.usub.sat.i8(i8 %a, i8 123)673 ret i8 %sub674}675 676define i16 @subflag16ri(i16 noundef %a) {677; CHECK-LABEL: subflag16ri:678; CHECK: # %bb.0: # %entry679; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]680; CHECK-NEXT: subw $1234, %di # EVEX TO LEGACY Compression encoding: [0x66,0x81,0xef,0xd2,0x04]681; CHECK-NEXT: # imm = 0x4D2682; CHECK-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]683; CHECK-NEXT: # kill: def $ax killed $ax killed $eax684; CHECK-NEXT: retq # encoding: [0xc3]685;686; NF-LABEL: subflag16ri:687; NF: # %bb.0: # %entry688; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]689; NF-NEXT: subw $1234, %di # EVEX TO LEGACY Compression encoding: [0x66,0x81,0xef,0xd2,0x04]690; NF-NEXT: # imm = 0x4D2691; NF-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]692; NF-NEXT: # kill: def $ax killed $ax killed $eax693; NF-NEXT: retq # encoding: [0xc3]694entry:695 %sub = call i16 @llvm.usub.sat.i16(i16 %a, i16 1234)696 ret i16 %sub697}698 699define i32 @subflag32ri(i32 noundef %a) {700; CHECK-LABEL: subflag32ri:701; CHECK: # %bb.0: # %entry702; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]703; CHECK-NEXT: subl $123456, %edi # EVEX TO LEGACY Compression encoding: [0x81,0xef,0x40,0xe2,0x01,0x00]704; CHECK-NEXT: # imm = 0x1E240705; CHECK-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]706; CHECK-NEXT: retq # encoding: [0xc3]707;708; NF-LABEL: subflag32ri:709; NF: # %bb.0: # %entry710; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]711; NF-NEXT: subl $123456, %edi # EVEX TO LEGACY Compression encoding: [0x81,0xef,0x40,0xe2,0x01,0x00]712; NF-NEXT: # imm = 0x1E240713; NF-NEXT: cmovael %edi, %eax # EVEX TO LEGACY Compression encoding: [0x0f,0x43,0xc7]714; NF-NEXT: retq # encoding: [0xc3]715entry:716 %sub = call i32 @llvm.usub.sat.i32(i32 %a, i32 123456)717 ret i32 %sub718}719 720define i64 @subflag64ri(i64 noundef %a) {721; CHECK-LABEL: subflag64ri:722; CHECK: # %bb.0: # %entry723; CHECK-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]724; CHECK-NEXT: subq $123456, %rdi # EVEX TO LEGACY Compression encoding: [0x48,0x81,0xef,0x40,0xe2,0x01,0x00]725; CHECK-NEXT: # imm = 0x1E240726; CHECK-NEXT: cmovaeq %rdi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x0f,0x43,0xc7]727; CHECK-NEXT: retq # encoding: [0xc3]728;729; NF-LABEL: subflag64ri:730; NF: # %bb.0: # %entry731; NF-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]732; NF-NEXT: subq $123456, %rdi # EVEX TO LEGACY Compression encoding: [0x48,0x81,0xef,0x40,0xe2,0x01,0x00]733; NF-NEXT: # imm = 0x1E240734; NF-NEXT: cmovaeq %rdi, %rax # EVEX TO LEGACY Compression encoding: [0x48,0x0f,0x43,0xc7]735; NF-NEXT: retq # encoding: [0xc3]736entry:737 %sub = call i64 @llvm.usub.sat.i64(i64 %a, i64 123456)738 ret i64 %sub739}740 741@val = external hidden global i8742 743declare void @f()744 745define void @sub64ri_reloc(i64 %val) {746; CHECK-LABEL: sub64ri_reloc:747; CHECK: # %bb.0:748; CHECK-NEXT: cmpq $val, %rdi # encoding: [0x48,0x81,0xff,A,A,A,A]749; CHECK-NEXT: # fixup A - offset: 3, value: val, kind: reloc_signed_4byte750; CHECK-NEXT: jbe .LBB41_2 # encoding: [0x76,A]751; CHECK-NEXT: # fixup A - offset: 1, value: .LBB41_2, kind: FK_PCRel_1752; CHECK-NEXT: # %bb.1: # %t753; CHECK-NEXT: pushq %rax # encoding: [0x50]754; CHECK-NEXT: .cfi_def_cfa_offset 16755; CHECK-NEXT: callq f@PLT # encoding: [0xe8,A,A,A,A]756; CHECK-NEXT: # fixup A - offset: 1, value: f@PLT, kind: FK_PCRel_4757; CHECK-NEXT: popq %rax # encoding: [0x58]758; CHECK-NEXT: .cfi_def_cfa_offset 8759; CHECK-NEXT: .LBB41_2: # %f760; CHECK-NEXT: retq # encoding: [0xc3]761;762; NF-LABEL: sub64ri_reloc:763; NF: # %bb.0:764; NF-NEXT: cmpq $val, %rdi # encoding: [0x48,0x81,0xff,A,A,A,A]765; NF-NEXT: # fixup A - offset: 3, value: val, kind: reloc_signed_4byte766; NF-NEXT: jbe .LBB41_2 # encoding: [0x76,A]767; NF-NEXT: # fixup A - offset: 1, value: .LBB41_2, kind: FK_PCRel_1768; NF-NEXT: # %bb.1: # %t769; NF-NEXT: pushq %rax # encoding: [0x50]770; NF-NEXT: .cfi_def_cfa_offset 16771; NF-NEXT: callq f@PLT # encoding: [0xe8,A,A,A,A]772; NF-NEXT: # fixup A - offset: 1, value: f@PLT, kind: FK_PCRel_4773; NF-NEXT: popq %rax # encoding: [0x58]774; NF-NEXT: .cfi_def_cfa_offset 8775; NF-NEXT: .LBB41_2: # %f776; NF-NEXT: retq # encoding: [0xc3]777 %cmp = icmp ugt i64 %val, ptrtoint (ptr @val to i64)778 br i1 %cmp, label %t, label %f779 780t:781 call void @f()782 ret void783 784f:785 ret void786}787 788define void @sub8mr_legacy(ptr %a, i8 noundef %b) {789; CHECK-LABEL: sub8mr_legacy:790; CHECK: # %bb.0: # %entry791; CHECK-NEXT: subb %sil, (%rdi) # encoding: [0x40,0x28,0x37]792; CHECK-NEXT: retq # encoding: [0xc3]793;794; NF-LABEL: sub8mr_legacy:795; NF: # %bb.0: # %entry796; NF-NEXT: subb %sil, (%rdi) # encoding: [0x40,0x28,0x37]797; NF-NEXT: retq # encoding: [0xc3]798entry:799 %t= load i8, ptr %a800 %sub = sub i8 %t, %b801 store i8 %sub, ptr %a802 ret void803}804 805define void @sub16mr_legacy(ptr %a, i16 noundef %b) {806; CHECK-LABEL: sub16mr_legacy:807; CHECK: # %bb.0: # %entry808; CHECK-NEXT: subw %si, (%rdi) # encoding: [0x66,0x29,0x37]809; CHECK-NEXT: retq # encoding: [0xc3]810;811; NF-LABEL: sub16mr_legacy:812; NF: # %bb.0: # %entry813; NF-NEXT: subw %si, (%rdi) # encoding: [0x66,0x29,0x37]814; NF-NEXT: retq # encoding: [0xc3]815entry:816 %t= load i16, ptr %a817 %sub = sub i16 %t, %b818 store i16 %sub, ptr %a819 ret void820}821 822define void @sub32mr_legacy(ptr %a, i32 noundef %b) {823; CHECK-LABEL: sub32mr_legacy:824; CHECK: # %bb.0: # %entry825; CHECK-NEXT: subl %esi, (%rdi) # encoding: [0x29,0x37]826; CHECK-NEXT: retq # encoding: [0xc3]827;828; NF-LABEL: sub32mr_legacy:829; NF: # %bb.0: # %entry830; NF-NEXT: subl %esi, (%rdi) # encoding: [0x29,0x37]831; NF-NEXT: retq # encoding: [0xc3]832entry:833 %t= load i32, ptr %a834 %sub = sub i32 %t, %b835 store i32 %sub, ptr %a836 ret void837}838 839define void @sub64mr_legacy(ptr %a, i64 noundef %b) {840; CHECK-LABEL: sub64mr_legacy:841; CHECK: # %bb.0: # %entry842; CHECK-NEXT: subq %rsi, (%rdi) # encoding: [0x48,0x29,0x37]843; CHECK-NEXT: retq # encoding: [0xc3]844;845; NF-LABEL: sub64mr_legacy:846; NF: # %bb.0: # %entry847; NF-NEXT: subq %rsi, (%rdi) # encoding: [0x48,0x29,0x37]848; NF-NEXT: retq # encoding: [0xc3]849entry:850 %t= load i64, ptr %a851 %sub = sub i64 %t, %b852 store i64 %sub, ptr %a853 ret void854}855 856define void @sub8mi_legacy(ptr %a) {857; CHECK-LABEL: sub8mi_legacy:858; CHECK: # %bb.0: # %entry859; CHECK-NEXT: addb $-123, (%rdi) # encoding: [0x80,0x07,0x85]860; CHECK-NEXT: retq # encoding: [0xc3]861;862; NF-LABEL: sub8mi_legacy:863; NF: # %bb.0: # %entry864; NF-NEXT: addb $-123, (%rdi) # encoding: [0x80,0x07,0x85]865; NF-NEXT: retq # encoding: [0xc3]866entry:867 %t= load i8, ptr %a868 %sub = sub nsw i8 %t, 123869 store i8 %sub, ptr %a870 ret void871}872 873define void @sub16mi_legacy(ptr %a) {874; CHECK-LABEL: sub16mi_legacy:875; CHECK: # %bb.0: # %entry876; CHECK-NEXT: addw $-1234, (%rdi) # encoding: [0x66,0x81,0x07,0x2e,0xfb]877; CHECK-NEXT: # imm = 0xFB2E878; CHECK-NEXT: retq # encoding: [0xc3]879;880; NF-LABEL: sub16mi_legacy:881; NF: # %bb.0: # %entry882; NF-NEXT: addw $-1234, (%rdi) # encoding: [0x66,0x81,0x07,0x2e,0xfb]883; NF-NEXT: # imm = 0xFB2E884; NF-NEXT: retq # encoding: [0xc3]885entry:886 %t= load i16, ptr %a887 %sub = sub nsw i16 %t, 1234888 store i16 %sub, ptr %a889 ret void890}891 892define void @sub32mi_legacy(ptr %a) {893; CHECK-LABEL: sub32mi_legacy:894; CHECK: # %bb.0: # %entry895; CHECK-NEXT: addl $-123456, (%rdi) # encoding: [0x81,0x07,0xc0,0x1d,0xfe,0xff]896; CHECK-NEXT: # imm = 0xFFFE1DC0897; CHECK-NEXT: retq # encoding: [0xc3]898;899; NF-LABEL: sub32mi_legacy:900; NF: # %bb.0: # %entry901; NF-NEXT: addl $-123456, (%rdi) # encoding: [0x81,0x07,0xc0,0x1d,0xfe,0xff]902; NF-NEXT: # imm = 0xFFFE1DC0903; NF-NEXT: retq # encoding: [0xc3]904entry:905 %t= load i32, ptr %a906 %sub = sub nsw i32 %t, 123456907 store i32 %sub, ptr %a908 ret void909}910 911define void @sub64mi_legacy(ptr %a) {912; CHECK-LABEL: sub64mi_legacy:913; CHECK: # %bb.0: # %entry914; CHECK-NEXT: addq $-123456, (%rdi) # encoding: [0x48,0x81,0x07,0xc0,0x1d,0xfe,0xff]915; CHECK-NEXT: # imm = 0xFFFE1DC0916; CHECK-NEXT: retq # encoding: [0xc3]917;918; NF-LABEL: sub64mi_legacy:919; NF: # %bb.0: # %entry920; NF-NEXT: addq $-123456, (%rdi) # encoding: [0x48,0x81,0x07,0xc0,0x1d,0xfe,0xff]921; NF-NEXT: # imm = 0xFFFE1DC0922; NF-NEXT: retq # encoding: [0xc3]923entry:924 %t= load i64, ptr %a925 %sub = sub nsw i64 %t, 123456926 store i64 %sub, ptr %a927 ret void928}929