intel/compiler: Make the CMPN builder work like the CMP builder
Since the CMPN builder was never used, there was no reason to make its
interface usable. :)
Fixes: 2f2c00c727
("i965: Lower min/max after optimization on Gen4/5.")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9027>
This commit is contained in:
@@ -610,7 +610,6 @@ namespace brw {
|
||||
ALU3(BFI2)
|
||||
ALU1(BFREV)
|
||||
ALU1(CBIT)
|
||||
ALU2(CMPN)
|
||||
ALU1(DIM)
|
||||
ALU2(DP2)
|
||||
ALU2(DP3)
|
||||
@@ -678,6 +677,31 @@ namespace brw {
|
||||
fix_unsigned_negate(src1)));
|
||||
}
|
||||
|
||||
/**
|
||||
* CMPN: Behaves like CMP, but produces true if src1 is NaN.
|
||||
*/
|
||||
instruction *
|
||||
CMPN(const dst_reg &dst, const src_reg &src0, const src_reg &src1,
|
||||
brw_conditional_mod condition) const
|
||||
{
|
||||
/* Take the instruction:
|
||||
*
|
||||
* CMP null<d> src0<f> src1<f>
|
||||
*
|
||||
* Original gen4 does type conversion to the destination type
|
||||
* before comparison, producing garbage results for floating
|
||||
* point comparisons.
|
||||
*
|
||||
* The destination type doesn't matter on newer generations,
|
||||
* so we set the type to match src0 so we can compact the
|
||||
* instruction.
|
||||
*/
|
||||
return set_condmod(condition,
|
||||
emit(BRW_OPCODE_CMPN, retype(dst, src0.type),
|
||||
fix_unsigned_negate(src0),
|
||||
fix_unsigned_negate(src1)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gen4 predicated IF.
|
||||
*/
|
||||
|
@@ -403,7 +403,6 @@ namespace brw {
|
||||
ALU3(BFI2)
|
||||
ALU1(BFREV)
|
||||
ALU1(CBIT)
|
||||
ALU2(CMPN)
|
||||
ALU3(CSEL)
|
||||
ALU1(DIM)
|
||||
ALU2(DP2)
|
||||
@@ -470,6 +469,31 @@ namespace brw {
|
||||
fix_unsigned_negate(src1)));
|
||||
}
|
||||
|
||||
/**
|
||||
* CMPN: Behaves like CMP, but produces true if src1 is NaN.
|
||||
*/
|
||||
instruction *
|
||||
CMPN(const dst_reg &dst, const src_reg &src0, const src_reg &src1,
|
||||
brw_conditional_mod condition) const
|
||||
{
|
||||
/* Take the instruction:
|
||||
*
|
||||
* CMPN null<d> src0<f> src1<f>
|
||||
*
|
||||
* Original gen4 does type conversion to the destination type
|
||||
* before comparison, producing garbage results for floating
|
||||
* point comparisons.
|
||||
*
|
||||
* The destination type doesn't matter on newer generations,
|
||||
* so we set the type to match src0 so we can compact the
|
||||
* instruction.
|
||||
*/
|
||||
return set_condmod(condition,
|
||||
emit(BRW_OPCODE_CMPN, retype(dst, src0.type),
|
||||
fix_unsigned_negate(src0),
|
||||
fix_unsigned_negate(src1)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gen4 predicated IF.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user