Mesa (master): pan/bit: Update f32->f16 convert test
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jul 31 14:34:44 UTC 2020
Module: Mesa
Branch: master
Commit: aa989aed6d68d50ff7900cfca4078ed4771c4b40
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=aa989aed6d68d50ff7900cfca4078ed4771c4b40
Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date: Thu Jul 30 20:22:56 2020 -0400
pan/bit: Update f32->f16 convert test
Needs a second argument to be consistent with the real IR and the
hardware instruction.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Fixes: 8a4efe2d730 ("pan/bi: Pack second argument of F32_TO_F16")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6142>
---
src/panfrost/bifrost/test/bi_interpret.c | 8 +-------
src/panfrost/bifrost/test/bi_test_pack.c | 7 +++++++
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/panfrost/bifrost/test/bi_interpret.c b/src/panfrost/bifrost/test/bi_interpret.c
index 43777ca72f8..a8fadb3627e 100644
--- a/src/panfrost/bifrost/test/bi_interpret.c
+++ b/src/panfrost/bifrost/test/bi_interpret.c
@@ -489,13 +489,7 @@ bit_step(struct bit_state *s, bi_instruction *ins, bool FMA)
dest.i32 = bit_as_int32(ins->src_types[0], srcs[0], comp, ins->roundmode);
else if (ins->dest_type == nir_type_float16) {
dest.u16[0] = bit_as_float16(ins->src_types[0], srcs[0], ins->swizzle[0][0]);
-
- if (ins->src_types[0] == nir_type_float32) {
- /* TODO: Second argument */
- dest.u16[1] = 0;
- } else {
- dest.u16[1] = bit_as_float16(ins->src_types[0], srcs[0], ins->swizzle[0][1]);
- }
+ dest.u16[1] = bit_as_float16(ins->src_types[0], srcs[0], ins->swizzle[0][1]);
} else if (ins->dest_type == nir_type_uint16) {
dest.u16[0] = bit_as_uint16(ins->src_types[0], srcs[0], ins->swizzle[0][0], ins->roundmode);
dest.u16[1] = bit_as_uint16(ins->src_types[0], srcs[0], ins->swizzle[0][1], ins->roundmode);
diff --git a/src/panfrost/bifrost/test/bi_test_pack.c b/src/panfrost/bifrost/test/bi_test_pack.c
index 81bf0b02263..9a9f991ad72 100644
--- a/src/panfrost/bifrost/test/bi_test_pack.c
+++ b/src/panfrost/bifrost/test/bi_test_pack.c
@@ -488,6 +488,13 @@ bit_convert_helper(struct panfrost_device *dev, unsigned from_size,
ins.swizzle[0][0] = cx;
ins.swizzle[0][1] = cy;
+ if (to_size == 16 && from_size == 32) {
+ ins.src_types[1] = ins.src_types[0];
+ ins.src[1] = ins.src[0];
+ } else {
+ ins.src[1] = ins.src_types[1] = 0;
+ }
+
bit_test_single(dev, &ins, input, FMA, debug);
}
}
More information about the mesa-commit
mailing list