MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / undef_vector_vars

Function undef_vector_vars

cranelift/frontend/src/frontend.rs:1834–1877  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1832
1833 #[test]
1834 fn undef_vector_vars() {
1835 let mut sig = Signature::new(CallConv::SystemV);
1836 sig.returns.push(AbiParam::new(I8X16));
1837 sig.returns.push(AbiParam::new(I8X16));
1838 sig.returns.push(AbiParam::new(F32X4));
1839
1840 let mut fn_ctx = FunctionBuilderContext::new();
1841 let mut func = Function::with_name_signature(UserFuncName::testcase("sample"), sig);
1842 {
1843 let mut builder = FunctionBuilder::new(&mut func, &mut fn_ctx);
1844
1845 let block0 = builder.create_block();
1846 let a = builder.declare_var(I8X16);
1847 let b = builder.declare_var(I8X16);
1848 let c = builder.declare_var(F32X4);
1849 builder.switch_to_block(block0);
1850
1851 let a = builder.use_var(a);
1852 let b = builder.use_var(b);
1853 let c = builder.use_var(c);
1854 builder.ins().return_(&[a, b, c]);
1855
1856 builder.seal_all_blocks();
1857 builder.finalize();
1858 }
1859
1860 check(
1861 &func,
1862 "function %sample() -> i8x16, i8x16, f32x4 system_v {
1863 const0 = 0x00000000000000000000000000000000
1864
1865block0:
1866 v5 = f32const 0.0
1867 v6 = splat.f32x4 v5 ; v5 = 0.0
1868 v2 -> v6
1869 v4 = vconst.i8x16 const0
1870 v1 -> v4
1871 v3 = vconst.i8x16 const0
1872 v0 -> v3
1873 return v0, v1, v2 ; v0 = const0, v1 = const0
1874}
1875",
1876 );
1877 }
1878
1879 #[test]
1880 fn test_greatest_divisible_power_of_two() {

Callers

nothing calls this directly

Calls 10

create_blockMethod · 0.80
declare_varMethod · 0.80
switch_to_blockMethod · 0.80
checkFunction · 0.70
newFunction · 0.50
pushMethod · 0.45
use_varMethod · 0.45
insMethod · 0.45
seal_all_blocksMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected