@@ -1060,24 +1060,24 @@ namespace skvm {
1060
1060
this ->byte (mod_rm (Mod::Direct, dst&7 , y&7 ));
1061
1061
}
1062
1062
1063
- void Assembler::vpaddd (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 , 0x0f ,0xfe , dst,x,y); }
1064
- void Assembler::vpsubd (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 , 0x0f ,0xfa , dst,x,y); }
1065
- void Assembler::vpmulld (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 ,0x380f ,0x40 , dst,x,y); }
1063
+ void Assembler::vpaddd (Ymm dst, Ymm x, YmmOrLabel y) { this ->op (0x66 , 0x0f ,0xfe , dst,x,y); }
1064
+ void Assembler::vpsubd (Ymm dst, Ymm x, YmmOrLabel y) { this ->op (0x66 , 0x0f ,0xfa , dst,x,y); }
1065
+ void Assembler::vpmulld (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 ,0x380f ,0x40 , dst,x,y); }
1066
1066
1067
1067
void Assembler::vpsubw (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 ,0x0f ,0xf9 , dst,x,y); }
1068
1068
void Assembler::vpmullw (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 ,0x0f ,0xd5 , dst,x,y); }
1069
1069
1070
- void Assembler::vpand (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 ,0x0f ,0xdb , dst,x,y); }
1071
- void Assembler::vpor (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 ,0x0f ,0xeb , dst,x,y); }
1072
- void Assembler::vpxor (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 ,0x0f ,0xef , dst,x,y); }
1073
- void Assembler::vpandn (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 ,0x0f ,0xdf , dst,x,y); }
1070
+ void Assembler::vpand (Ymm dst, Ymm x, YmmOrLabel y) { this ->op (0x66 ,0x0f ,0xdb , dst,x,y); }
1071
+ void Assembler::vpor (Ymm dst, Ymm x, YmmOrLabel y) { this ->op (0x66 ,0x0f ,0xeb , dst,x,y); }
1072
+ void Assembler::vpxor (Ymm dst, Ymm x, YmmOrLabel y) { this ->op (0x66 ,0x0f ,0xef , dst,x,y); }
1073
+ void Assembler::vpandn (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 ,0x0f ,0xdf , dst,x,y); }
1074
1074
1075
- void Assembler::vaddps (Ymm dst, Ymm x, Ymm y) { this ->op (0 ,0x0f ,0x58 , dst,x,y); }
1076
- void Assembler::vsubps (Ymm dst, Ymm x, Ymm y) { this ->op (0 ,0x0f ,0x5c , dst,x,y); }
1077
- void Assembler::vmulps (Ymm dst, Ymm x, Ymm y) { this ->op (0 ,0x0f ,0x59 , dst,x,y); }
1078
- void Assembler::vdivps (Ymm dst, Ymm x, Ymm y) { this ->op (0 ,0x0f ,0x5e , dst,x,y); }
1079
- void Assembler::vminps (Ymm dst, Ymm x, Ymm y) { this ->op (0 ,0x0f ,0x5d , dst,x,y); }
1080
- void Assembler::vmaxps (Ymm dst, Ymm x, Ymm y) { this ->op (0 ,0x0f ,0x5f , dst,x,y); }
1075
+ void Assembler::vaddps (Ymm dst, Ymm x, YmmOrLabel y) { this ->op (0 ,0x0f ,0x58 , dst,x,y); }
1076
+ void Assembler::vsubps (Ymm dst, Ymm x, YmmOrLabel y) { this ->op (0 ,0x0f ,0x5c , dst,x,y); }
1077
+ void Assembler::vmulps (Ymm dst, Ymm x, YmmOrLabel y) { this ->op (0 ,0x0f ,0x59 , dst,x,y); }
1078
+ void Assembler::vdivps (Ymm dst, Ymm x, Ymm y) { this ->op (0 ,0x0f ,0x5e , dst,x,y); }
1079
+ void Assembler::vminps (Ymm dst, Ymm x, YmmOrLabel y) { this ->op (0 ,0x0f ,0x5d , dst,x,y); }
1080
+ void Assembler::vmaxps (Ymm dst, Ymm x, YmmOrLabel y) { this ->op (0 ,0x0f ,0x5f , dst,x,y); }
1081
1081
1082
1082
void Assembler::vfmadd132ps (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 ,0x380f ,0x98 , dst,x,y); }
1083
1083
void Assembler::vfmadd213ps (Ymm dst, Ymm x, Ymm y) { this ->op (0x66 ,0x380f ,0xa8 , dst,x,y); }
@@ -1168,11 +1168,12 @@ namespace skvm {
1168
1168
this ->word (this ->disp32 (l));
1169
1169
}
1170
1170
1171
- void Assembler::vpshufb (Ymm dst, Ymm x, Label* l) { this -> op ( 0x66 , 0x380f , 0x00 , dst,x,l); }
1172
- void Assembler::vpaddd (Ymm dst, Ymm x, Label* l) { this ->op (0x66 , 0x0f , 0xfe , dst,x,l); }
1173
- void Assembler::vpsubd (Ymm dst, Ymm x, Label* l) { this ->op (0x66 , 0x0f , 0xfa , dst,x,l); }
1174
- void Assembler::vmulps (Ymm dst, Ymm x, Label* l) { this -> op ( 0 , 0x0f , 0x59 , dst,x,l); }
1171
+ void Assembler::op ( int prefix, int map, int opcode, Ymm dst, Ymm x, YmmOrLabel y) {
1172
+ y. label ? this ->op (prefix,map,opcode, dst,x, y. label )
1173
+ : this ->op (prefix,map,opcode, dst,x, y. ymm );
1174
+ }
1175
1175
1176
+ void Assembler::vpshufb (Ymm dst, Ymm x, Label* l) { this ->op (0x66 ,0x380f ,0x00 , dst,x,l); }
1176
1177
void Assembler::vptest (Ymm dst, Label* l) { this ->op (0x66 , 0x380f , 0x17 , dst, (Ymm)0 , l); }
1177
1178
1178
1179
void Assembler::vbroadcastss (Ymm dst, Label* l) { this ->op (0x66 ,0x380f ,0x18 , dst, (Ymm)0 , l); }
@@ -2296,7 +2297,11 @@ namespace skvm {
2296
2297
a->vfmadd132ps (dst (),r[z], r[y]); }
2297
2298
break ;
2298
2299
2300
+ case Op::add_f32_imm: a->vaddps (dst (), r[x], &constants[immy].label ); break ;
2301
+ case Op::sub_f32_imm: a->vsubps (dst (), r[x], &constants[immy].label ); break ;
2299
2302
case Op::mul_f32_imm: a->vmulps (dst (), r[x], &constants[immy].label ); break ;
2303
+ case Op::min_f32_imm: a->vminps (dst (), r[x], &constants[immy].label ); break ;
2304
+ case Op::max_f32_imm: a->vmaxps (dst (), r[x], &constants[immy].label ); break ;
2300
2305
2301
2306
case Op::add_i32: a->vpaddd (dst (), r[x], r[y]); break ;
2302
2307
case Op::sub_i32: a->vpsubd (dst (), r[x], r[y]); break ;
@@ -2312,6 +2317,10 @@ namespace skvm {
2312
2317
case Op::bit_clear: a->vpandn (dst (), r[y], r[x]); break ; // N.B. Y then X.
2313
2318
case Op::select : a->vpblendvb (dst (), r[z], r[y], r[x]); break ;
2314
2319
2320
+ case Op::bit_and_imm: a->vpand (dst (), r[x], &constants[immy].label ); break ;
2321
+ case Op::bit_or_imm : a->vpor (dst (), r[x], &constants[immy].label ); break ;
2322
+ case Op::bit_xor_imm: a->vpxor (dst (), r[x], &constants[immy].label ); break ;
2323
+
2315
2324
case Op::shl_i32: a->vpslld (dst (), r[x], immy); break ;
2316
2325
case Op::shr_i32: a->vpsrld (dst (), r[x], immy); break ;
2317
2326
case Op::sra_i32: a->vpsrad (dst (), r[x], immy); break ;
0 commit comments