Files
clang-p2996/llvm/test/CodeGen/Lanai/lowering-128.ll
Serge Bazanski 788e7b3b8c [Lanai] implement wide immediate support
This fixes LanaiTTIImpl::getIntImmCost to return valid costs for i128
(and wider) values. Previously any immediate wider than
64 bits would cause Lanai llc to crash.

A regression test is also added that exercises this functionality.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D107091
2021-09-10 10:54:43 +00:00

23 lines
641 B
LLVM

; RUN: llc -march=lanai < %s | FileCheck %s
; Tests that lowering wide registers (128 bits or more) works on Lanai.
; The emitted assembly is not checked, we just do a smoketest.
target datalayout = "E-m:e-p:32:32-i64:64-a:0:32-n32-S64"
target triple = "lanai"
; CHECK-LABEL: add128:
define i128 @add128(i128 %x, i128 %y) {
%a = add i128 %x, %y
ret i128 %a
}
; CHECK-LABEL: immshift128:
define i128 @immshift128(i1 %sel) unnamed_addr {
%a = add i128 0, 340282366920938463463374007431768209319
%b = add i128 0, 340282366920938463463374607431768209320
%c = select i1 %sel, i128 %a, i128 %b
%d = shl i128 %a, 10
ret i128 %d
}