00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "brw_context.h"
00034 #include "brw_defines.h"
00035 #include "brw_eu.h"
00036
00037
00038 void brw_math_invert( struct brw_compile *p,
00039 struct brw_reg dst,
00040 struct brw_reg src)
00041 {
00042 brw_math( p,
00043 dst,
00044 BRW_MATH_FUNCTION_INV,
00045 BRW_MATH_SATURATE_NONE,
00046 0,
00047 src,
00048 BRW_MATH_PRECISION_FULL,
00049 BRW_MATH_DATA_VECTOR );
00050 }
00051
00052
00053
00054 void brw_copy4(struct brw_compile *p,
00055 struct brw_reg dst,
00056 struct brw_reg src,
00057 unsigned count)
00058 {
00059 unsigned i;
00060
00061 dst = vec4(dst);
00062 src = vec4(src);
00063
00064 for (i = 0; i < count; i++)
00065 {
00066 unsigned delta = i*32;
00067 brw_MOV(p, byte_offset(dst, delta), byte_offset(src, delta));
00068 brw_MOV(p, byte_offset(dst, delta+16), byte_offset(src, delta+16));
00069 }
00070 }
00071
00072
00073 void brw_copy8(struct brw_compile *p,
00074 struct brw_reg dst,
00075 struct brw_reg src,
00076 unsigned count)
00077 {
00078 unsigned i;
00079
00080 dst = vec8(dst);
00081 src = vec8(src);
00082
00083 for (i = 0; i < count; i++)
00084 {
00085 unsigned delta = i*32;
00086 brw_MOV(p, byte_offset(dst, delta), byte_offset(src, delta));
00087 }
00088 }
00089
00090
00091 void brw_copy_indirect_to_indirect(struct brw_compile *p,
00092 struct brw_indirect dst_ptr,
00093 struct brw_indirect src_ptr,
00094 unsigned count)
00095 {
00096 unsigned i;
00097
00098 for (i = 0; i < count; i++)
00099 {
00100 unsigned delta = i*32;
00101 brw_MOV(p, deref_4f(dst_ptr, delta), deref_4f(src_ptr, delta));
00102 brw_MOV(p, deref_4f(dst_ptr, delta+16), deref_4f(src_ptr, delta+16));
00103 }
00104 }
00105
00106
00107 void brw_copy_from_indirect(struct brw_compile *p,
00108 struct brw_reg dst,
00109 struct brw_indirect ptr,
00110 unsigned count)
00111 {
00112 unsigned i;
00113
00114 dst = vec4(dst);
00115
00116 for (i = 0; i < count; i++)
00117 {
00118 unsigned delta = i*32;
00119 brw_MOV(p, byte_offset(dst, delta), deref_4f(ptr, delta));
00120 brw_MOV(p, byte_offset(dst, delta+16), deref_4f(ptr, delta+16));
00121 }
00122 }
00123
00124
00125
00126