Open Bug 1870408 Opened 2 years ago Updated 2 years ago

Attempt to reduce and remove jump from minMaxFloat32x4

Categories

(Core :: JavaScript: WebAssembly, enhancement, P3)

x86_64
Unspecified
enhancement

Tracking

()

People

(Reporter: yury, Assigned: yury)

References

(Blocks 1 open bug)

Details

Our implementations of MacroAssemblerX86Shared::minMaxFloatXXXXX contain jump instruction in case if lanes contain NaN (slow path). It is possible to remove some operations from the generic implementations if we can assume that some of the data is has no NaNs, e.g. one of the operands is a constant, or it is used in min(max(,),) expression.

Ideas to address some of bug 1869645 comment 12:

local.get 0
local.get 1
local.get 2
f32x4.min
f32x4.max

If we can combine two as one operation, we can remove at least vptest() + j() for AVX.

I see also

local.get 0
v128.const f32x4 ...
f32x4.min
v128.const f32x4 ...
f32x4.max

Having separate masm operations with constants (plus combination as in above case) can remove several machine instructions.

Severity: -- → N/A
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.