search for: max_sint_n

Displaying 4 results from an estimated 4 matches for "max_sint_n".

2015 Jan 14
5
[LLVMdev] [RFC] Integer Saturation Intrinsics
...(unsigned/signed). Quoting the added documentation: %r = call i32 @llvm.ssat.i32(i32 %x, i32 %n) is equivalent to the expression min(max(x, -2^(n-1)), 2^(n-1)-1), itself implementable as the following IR: %min_sint_n = i32 ... ; the min. signed integer of bitwidth n, -2^(n-1) %max_sint_n = i32 ... ; the max. signed integer of bitwidth n, 2^(n-1)-1 %0 = icmp slt i32 %x, %min_sint_n %1 = select i1 %0, i32 %min_sint_n, i32 %x %2 = icmp sgt i32 %1, %max_sint_n %r = select i1 %2, i32 %max_sint_n, i32 %1 As a starting point, here are two patches: - http://review...
2015 Jan 15
2
[LLVMdev] [RFC] Integer Saturation Intrinsics
...= call i32 @llvm.ssat.i32(i32 %x, i32 %n) >> >> is equivalent to the expression min(max(x, -2^(n-1)), 2^(n-1)-1), itself >> implementable as the following IR: >> >> %min_sint_n = i32 ... ; the min. signed integer of bitwidth n, >> -2^(n-1) >> %max_sint_n = i32 ... ; the max. signed integer of bitwidth n, >> 2^(n-1)-1 >> %0 = icmp slt i32 %x, %min_sint_n >> %1 = select i1 %0, i32 %min_sint_n, i32 %x >> %2 = icmp sgt i32 %1, %max_sint_n >> %r = select i1 %2, i32 %max_sint_n, i32 %1 >> &g...
2015 Jan 15
3
[LLVMdev] [RFC] Integer Saturation Intrinsics
...r = call i32 @llvm.ssat.i32(i32 %x, i32 %n) > > > > is equivalent to the expression min(max(x, -2^(n-1)), 2^(n-1)-1), itself > > implementable as the following IR: > > > > %min_sint_n = i32 ... ; the min. signed integer of bitwidth n, > -2^(n-1) > > %max_sint_n = i32 ... ; the max. signed integer of bitwidth n, > 2^(n-1)-1 > > %0 = icmp slt i32 %x, %min_sint_n > > %1 = select i1 %0, i32 %min_sint_n, i32 %x > > %2 = icmp sgt i32 %1, %max_sint_n > > %r = select i1 %2, i32 %max_sint_n, i32 %1 > > > >...
2015 Jan 15
0
[LLVMdev] [RFC] Integer Saturation Intrinsics
...%x, i32 %n) >>> >>> is equivalent to the expression min(max(x, -2^(n-1)), 2^(n-1)-1), itself >>> implementable as the following IR: >>> >>> %min_sint_n = i32 ... ; the min. signed integer of bitwidth n, >>> -2^(n-1) >>> %max_sint_n = i32 ... ; the max. signed integer of bitwidth n, >>> 2^(n-1)-1 >>> %0 = icmp slt i32 %x, %min_sint_n >>> %1 = select i1 %0, i32 %min_sint_n, i32 %x >>> %2 = icmp sgt i32 %1, %max_sint_n >>> %r = select i1 %2, i32 %max_si...