gallivm: replace sub/floor/ifloor combo with ifloor_fract
authorRoland Scheidegger <sroland@vmware.com>
Fri, 8 Oct 2010 16:43:49 +0000 (18:43 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 8 Oct 2010 22:36:37 +0000 (00:36 +0200)
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c

index b8cf938acfe861fcd973de7aca50e2ee4dfb1bde..90fd99067b34f0a58ea7226fb41010fdfc72f5f5 100644 (file)
@@ -202,11 +202,7 @@ lp_build_coord_mirror(struct lp_build_sample_context *bld,
    struct lp_build_context *int_coord_bld = &bld->int_coord_bld;
    LLVMValueRef fract, flr, isOdd;
 
-   /* fract = coord - floor(coord) */
-   fract = lp_build_sub(coord_bld, coord, lp_build_floor(coord_bld, coord));
-
-   /* flr = ifloor(coord); */
-   flr = lp_build_ifloor(coord_bld, coord);
+   lp_build_ifloor_fract(coord_bld, coord, &flr, &fract);
 
    /* isOdd = flr & 1 */
    isOdd = LLVMBuildAnd(bld->builder, flr, int_coord_bld->one, "");