File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1957,6 +1957,37 @@ define <2 x float> @test_uitofp_2xi32_to_2xfloat(<2 x i32> %a) #0 {
19571957 ret <2 x float > %r
19581958}
19591959
1960+ define void @test_trunc_to_v2bf16 (<2 x float > %a , ptr %p ) {
1961+ ; CHECK-LABEL: test_trunc_to_v2bf16(
1962+ ; CHECK: {
1963+ ; CHECK-NEXT: .reg .b64 %rd<3>;
1964+ ; CHECK-EMPTY:
1965+ ; CHECK-NEXT: // %bb.0:
1966+ ; CHECK-NEXT: ld.param.b64 %rd2, [test_trunc_to_v2bf16_param_1];
1967+ ; CHECK-NEXT: ld.param.b64 %rd1, [test_trunc_to_v2bf16_param_0];
1968+ ; CHECK-NEXT: st.b32 [%rd2], %rd1;
1969+ ; CHECK-NEXT: ret;
1970+ %trunc = fptrunc <2 x float > %a to <2 x bfloat>
1971+ store <2 x bfloat> %trunc , ptr %p
1972+ ret void
1973+ }
1974+
1975+ define void @test_trunc_to_v2f16 (<2 x float > %a , ptr %p ) {
1976+ ; CHECK-LABEL: test_trunc_to_v2f16(
1977+ ; CHECK: {
1978+ ; CHECK-NEXT: .reg .b64 %rd<3>;
1979+ ; CHECK-EMPTY:
1980+ ; CHECK-NEXT: // %bb.0:
1981+ ; CHECK-NEXT: ld.param.b64 %rd2, [test_trunc_to_v2f16_param_1];
1982+ ; CHECK-NEXT: ld.param.b64 %rd1, [test_trunc_to_v2f16_param_0];
1983+ ; CHECK-NEXT: st.b32 [%rd2], %rd1;
1984+ ; CHECK-NEXT: ret;
1985+ %trunc = fptrunc <2 x float > %a to <2 x half >
1986+ store <2 x half > %trunc , ptr %p
1987+ ret void
1988+ }
1989+
1990+
19601991attributes #0 = { nounwind }
19611992attributes #1 = { "unsafe-fp-math" = "true" }
19621993attributes #2 = { "denormal-fp-math" ="preserve-sign" }
You can’t perform that action at this time.
0 commit comments