brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 5778a94 Raw
65 lines · plain
1; RUN: llc < %s -mattr=+sign-ext -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers | FileCheck %s2; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers | FileCheck %s --check-prefix=NOSIGNEXT3 4target triple = "wasm32-unknown-unknown"5 6; CHECK-LABEL: i32_extend8_s:7; CHECK-NEXT: .functype i32_extend8_s (i32) -> (i32){{$}}8; CHECK-NEXT: i32.extend8_s $push[[NUM:[0-9]+]]=, $0{{$}}9; CHECK-NEXT: return $pop[[NUM]]{{$}}10 11; NOSIGNEXT-LABEL: i32_extend8_s12; NOSIGNEXT-NOT: i32.extend8_s13define i32 @i32_extend8_s(i8 %x) {14  %a = sext i8 %x to i3215  ret i32 %a16}17 18; CHECK-LABEL: i32_extend16_s:19; CHECK-NEXT: .functype i32_extend16_s (i32) -> (i32){{$}}20; CHECK-NEXT: i32.extend16_s $push[[NUM:[0-9]+]]=, $0{{$}}21; CHECK-NEXT: return $pop[[NUM]]{{$}}22 23; NOSIGNEXT-LABEL: i32_extend16_s24; NOSIGNEXT-NOT: i32.extend16_s25define i32 @i32_extend16_s(i16 %x) {26  %a = sext i16 %x to i3227  ret i32 %a28}29 30; CHECK-LABEL: i64_extend8_s:31; CHECK-NEXT: .functype i64_extend8_s (i32) -> (i64){{$}}32; CHECK-NEXT: i64.extend_i32_u $push[[NUM1:[0-9]+]]=, $0{{$}}33; CHECK-NEXT: i64.extend8_s $push[[NUM2:[0-9]+]]=, $pop[[NUM1]]{{$}}34; CHECK-NEXT: return $pop[[NUM2]]{{$}}35 36; NOSIGNEXT-LABEL: i64_extend8_s37; NOSIGNEXT-NOT: i64.extend8_s38define i64 @i64_extend8_s(i8 %x) {39  %a = sext i8 %x to i6440  ret i64 %a41}42 43; CHECK-LABEL: i64_extend16_s:44; CHECK-NEXT: .functype i64_extend16_s (i32) -> (i64){{$}}45; CHECK-NEXT: i64.extend_i32_u $push[[NUM1:[0-9]+]]=, $0{{$}}46; CHECK-NEXT: i64.extend16_s $push[[NUM2:[0-9]+]]=, $pop[[NUM1]]{{$}}47; CHECK-NEXT: return $pop[[NUM2]]{{$}}48 49; NOSIGNEXT-LABEL: i64_extend16_s50; NOSIGNEXT-NOT: i16.extend16_s51define i64 @i64_extend16_s(i16 %x) {52  %a = sext i16 %x to i6453  ret i64 %a54}55 56; No SIGN_EXTEND_INREG is needed for 32->64 extension.57; CHECK-LABEL: i64_extend32_s:58; CHECK-NEXT: .functype i64_extend32_s (i32) -> (i64){{$}}59; CHECK-NEXT: i64.extend_i32_s $push[[NUM:[0-9]+]]=, $0{{$}}60; CHECK-NEXT: return $pop[[NUM]]{{$}}61define i64 @i64_extend32_s(i32 %x) {62  %a = sext i32 %x to i6463  ret i64 %a64}65