1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/test/CodeGen/X86/h-registers-1.ll
Derek Schuff 6b7c9ae783 x32. Fixes a bug in i8mem_NOREX declaration.
The old implementation assumed LP64 which is broken for x32.  Specifically, the
MOVE8rm_NOREX and MOVE8mr_NOREX, when selected, would cause a 'Cannot emit
physreg copy instruction' error message to be reported.

This patch also enable the h-register*ll tests for x32.

Differential Revision: http://reviews.llvm.org/D12336

Patch by João Porto

llvm-svn: 247058
2015-09-08 19:47:15 +00:00

50 lines
1.3 KiB
LLVM

; RUN: llc -mattr=-bmi < %s -mtriple=x86_64-linux | FileCheck %s
; RUN: llc -mattr=-bmi < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s
; LLVM creates virtual registers for values live across blocks
; based on the type of the value. Make sure that the extracts
; here use the GR64_NOREX register class for their result,
; instead of plain GR64.
; CHECK: foo:
; CHECK: movzbl %{{[abcd]}}h, %e
; CHECK: movzbl %{{[abcd]}}h, %e
; CHECK: movzbl %{{[abcd]}}h, %e
; CHECK: movzbl %{{[abcd]}}h, %e
; CHECK: movzbl %{{[abcd]}}h, %e
; CHECK: movzbl %{{[abcd]}}h, %e
; CHECK: movzbl %{{[abcd]}}h, %e
; CHECK: movzbl %{{[abcd]}}h, %e
; CHECK: ret
define i64 @foo(i64 %a, i64 %b, i64 %c, i64 %d,
i64 %e, i64 %f, i64 %g, i64 %h) {
%sa = lshr i64 %a, 8
%A = and i64 %sa, 255
%sb = lshr i64 %b, 8
%B = and i64 %sb, 255
%sc = lshr i64 %c, 8
%C = and i64 %sc, 255
%sd = lshr i64 %d, 8
%D = and i64 %sd, 255
%se = lshr i64 %e, 8
%E = and i64 %se, 255
%sf = lshr i64 %f, 8
%F = and i64 %sf, 255
%sg = lshr i64 %g, 8
%G = and i64 %sg, 255
%sh = lshr i64 %h, 8
%H = and i64 %sh, 255
br label %next
next:
%u = add i64 %A, %B
%v = add i64 %C, %D
%w = add i64 %E, %F
%x = add i64 %G, %H
%y = add i64 %u, %v
%z = add i64 %w, %x
%t = add i64 %y, %z
ret i64 %t
}