MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / createZExtOrTrunc

Method createZExtOrTrunc

lib/llvm/llvm.h:1371–1385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1369 return LLVMBuildTruncOrBitCast(Ref, Val.unwrap(), DestTy.unwrap(), Name);
1370 }
1371 Value createZExtOrTrunc(Value Val, Type DestTy,
1372 const char *Name = "") noexcept {
1373 const auto VTy = Val.getType();
1374 assuming(DestTy.isIntegerTy() || DestTy.isVectorTy());
1375 assuming(VTy.isIntegerTy() || VTy.isVectorTy());
1376 const auto VTySize = VTy.getPrimitiveSizeInBits();
1377 const auto DestTySize = DestTy.getPrimitiveSizeInBits();
1378 if (VTySize < DestTySize) {
1379 return createZExt(Val, DestTy, Name);
1380 }
1381 if (VTySize > DestTySize) {
1382 return createTrunc(Val, DestTy, Name);
1383 }
1384 return Val;
1385 }
1386 Value createSExtOrTrunc(Value Val, Type DestTy,
1387 const char *Name = "") noexcept {
1388 const auto VTy = Val.getType();

Callers 3

compileAtomicWaitMethod · 0.80
compileAtomicStoreMethod · 0.80
compileVectorShiftOpMethod · 0.80

Calls 4

isIntegerTyMethod · 0.80
isVectorTyMethod · 0.80
getTypeMethod · 0.45

Tested by

no test coverage detected