94 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 42; RUN: llc < %s -mtriple=i386-unknown-unknown | FileCheck %s --check-prefixes=X863; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=X644 5define i64 @sub8(i64 noundef %res, ptr %byte) {6; X86-LABEL: sub8:7; X86: # %bb.0: # %entry8; X86-NEXT: movl {{[0-9]+}}(%esp), %eax9; X86-NEXT: movl {{[0-9]+}}(%esp), %edx10; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx11; X86-NEXT: movb (%ecx), %al12; X86-NEXT: retl13;14; X64-LABEL: sub8:15; X64: # %bb.0: # %entry16; X64-NEXT: movq %rdi, %rax17; X64-NEXT: movb (%rsi), %al18; X64-NEXT: retq19entry:20 %and = and i64 %res, -25621 %d = load i8, ptr %byte, align 122 %conv2 = zext i8 %d to i6423 %or = or i64 %and, %conv224 ret i64 %or25}26 27define i64 @sub16(i64 noundef %res, ptr %byte) {28; X86-LABEL: sub16:29; X86: # %bb.0: # %entry30; X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx31; X86-NEXT: shll $16, %ecx32; X86-NEXT: movl {{[0-9]+}}(%esp), %edx33; X86-NEXT: movl {{[0-9]+}}(%esp), %eax34; X86-NEXT: movzwl (%eax), %eax35; X86-NEXT: orl %ecx, %eax36; X86-NEXT: retl37;38; X64-LABEL: sub16:39; X64: # %bb.0: # %entry40; X64-NEXT: movq %rdi, %rax41; X64-NEXT: movw (%rsi), %ax42; X64-NEXT: retq43entry:44 %and = and i64 %res, -6553645 %d = load i16, ptr %byte, align 146 %conv2 = zext i16 %d to i6447 %or = or i64 %and, %conv248 ret i64 %or49}50 51define i32 @sub8_32(i32 noundef %res, ptr %byte) {52; X86-LABEL: sub8_32:53; X86: # %bb.0: # %entry54; X86-NEXT: movl {{[0-9]+}}(%esp), %eax55; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx56; X86-NEXT: movb (%ecx), %al57; X86-NEXT: retl58;59; X64-LABEL: sub8_32:60; X64: # %bb.0: # %entry61; X64-NEXT: movl %edi, %eax62; X64-NEXT: movb (%rsi), %al63; X64-NEXT: retq64entry:65 %and = and i32 %res, -25666 %d = load i8, ptr %byte, align 167 %conv2 = zext i8 %d to i3268 %or = or i32 %and, %conv269 ret i32 %or70}71 72define i32 @sub16_32(i32 noundef %res, ptr %byte) {73; X86-LABEL: sub16_32:74; X86: # %bb.0: # %entry75; X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx76; X86-NEXT: shll $16, %ecx77; X86-NEXT: movl {{[0-9]+}}(%esp), %eax78; X86-NEXT: movzwl (%eax), %eax79; X86-NEXT: orl %ecx, %eax80; X86-NEXT: retl81;82; X64-LABEL: sub16_32:83; X64: # %bb.0: # %entry84; X64-NEXT: movl %edi, %eax85; X64-NEXT: movw (%rsi), %ax86; X64-NEXT: retq87entry:88 %and = and i32 %res, -6553689 %d = load i16, ptr %byte, align 190 %conv2 = zext i16 %d to i3291 %or = or i32 %and, %conv292 ret i32 %or93}94