Commit 8b8af824 by Nicolas Capens

Implement bitcast between i32 and (emulated) v4i8.

BUG=swiftshader:15 Change-Id: Ic795def8a914508ab0d850c846b73b343ace45de
parent ef8210d9
...@@ -3212,7 +3212,14 @@ void TargetX86Base<TraitsType>::lowerCast(const InstCast *Instr) { ...@@ -3212,7 +3212,14 @@ void TargetX86Base<TraitsType>::lowerCast(const InstCast *Instr) {
case IceType_v16i8: case IceType_v16i8:
case IceType_v4i32: case IceType_v4i32:
case IceType_v4f32: { case IceType_v4f32: {
if (Src0->getType() == IceType_i32) {
// Bitcast requires equal type sizes, which isn't strictly the case
// between scalars and vectors, but to emulate v4i8 vectors one has to
// use v16i8 vectors.
_movd(Dest, legalize(Src0, Legal_Reg | Legal_Mem));
} else {
_movp(Dest, legalizeToReg(Src0)); _movp(Dest, legalizeToReg(Src0));
}
} break; } break;
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment