From 20c67f243e9a5ba2c1e691e82172afe3a2789236 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Tue, 27 Aug 2019 16:04:08 -0700 Subject: [PATCH] Add boolean shuffle test --- .../filetests/filetests/isa/x86/shuffle-run.clif | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cranelift/filetests/filetests/isa/x86/shuffle-run.clif b/cranelift/filetests/filetests/isa/x86/shuffle-run.clif index 60fd7d7b25..bc9eecb689 100644 --- a/cranelift/filetests/filetests/isa/x86/shuffle-run.clif +++ b/cranelift/filetests/filetests/isa/x86/shuffle-run.clif @@ -42,3 +42,19 @@ ebb0: } ; run + + +function %compare_shuffle() -> b32 { +ebb0: + v1 = vconst.b32x4 [true false true false] + v2 = raw_bitcast.b8x16 v1 ; we have to cast because shuffle is type-limited to Tx16 + ; pair up the true values to make the entire vector true + v3 = shuffle v2, v2, [0 1 2 3 0 1 2 3 8 9 10 11 8 9 10 11] + v4 = raw_bitcast.b32x4 v3 + v5 = extractlane v4, 3 + v6 = extractlane v4, 0 + v7 = band v5, v6 + return v7 +} + +; run