Ejemplo n.º 1
0
    def test_width_check(self):
        # type: () -> None
        x = XForm(
            Rtl(self.v0 << copy(self.v1)),
            Rtl((self.v2, self.v3) << isplit(self.v1),
                self.v0 << iconcat(self.v2, self.v3)))

        WideInt = TypeSet(lanes=(1, 256), ints=(16, 64))
        self.check_yo_check(x, typeset_check(self.v1, WideInt))
Ejemplo n.º 2
0
    def test_lanes_check(self):
        # type: () -> None
        x = XForm(
            Rtl(self.v0 << copy(self.v1)),
            Rtl((self.v2, self.v3) << vsplit(self.v1),
                self.v0 << vconcat(self.v2, self.v3)))

        WideVec = TypeSet(lanes=(2, 256),
                          ints=(8, 64),
                          floats=(32, 64),
                          bools=(1, 64))
        self.check_yo_check(x, typeset_check(self.v1, WideVec))
Ejemplo n.º 3
0
    def test_vselect_imm(self):
        # type: () -> None
        ts = TypeSet(lanes=(2, 256), ints=True, floats=True, bools=(8, 64))
        r = Rtl(
            self.v0 << iconst(self.imm0),
            self.v1 << icmp(intcc.eq, self.v2, self.v0),
            self.v5 << vselect(self.v1, self.v3, self.v4),
        )
        x = XForm(r, r)
        tv2_exp = 'Some({}).map(|t: crate::ir::Type| t.as_bool())'\
            .format(self.v2.get_typevar().name)
        tv3_exp = 'Some({}).map(|t: crate::ir::Type| t.as_bool())'\
            .format(self.v3.get_typevar().name)

        self.check_yo_check(
            x,
            sequence(typeset_check(self.v3, ts), equiv_check(tv2_exp,
                                                             tv3_exp)))