Bug 1041648: added float32x4 clamp test case; r=bbouvier

This commit is contained in:
ProgramFOX 2014-07-22 03:21:32 -07:00
parent 2cfb959a9f
commit f1dd3163f4

View File

@ -3,20 +3,19 @@ var BUGNUMBER = 946042;
var float32x4 = SIMD.float32x4;
var int32x4 = SIMD.int32x4;
var summary = 'float32x4 add';
var summary = 'float32x4 clamp';
function test() {
print(BUGNUMBER + ": " + summary);
// FIXME -- Bug 948379: Amend to check for correctness of border cases.
var a = float32x4(1, 2, 3, 4);
var b = float32x4(10, 20, 30, 40);
var c = SIMD.float32x4.add(a, b);
assertEq(c.x, 11);
assertEq(c.y, 22);
assertEq(c.z, 33);
assertEq(c.w, 44);
var a = float32x4(-13.37, 10.46, 31.79, 0.54);
var lower = float32x4(2.1, 1.1, 50.13, 0.0);
var upper = float32x4(2.56, 5.55, 55.93, 1.1);
var c = SIMD.float32x4.clamp(a, lower, upper);
assertEq(c.x, Math.fround(2.1));
assertEq(c.y, Math.fround(5.55));
assertEq(c.z, Math.fround(50.13));
assertEq(c.w, Math.fround(0.54));
if (typeof reportCompare === "function")
reportCompare(true, true);